mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-18 13:00:18 +00:00
Compare commits
184 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 343c8a4319 | |||
| a368356c6f | |||
| f8e87ac49b | |||
| 6a2e8400c1 | |||
| e797546edb | |||
| 16ca2bd984 | |||
| fb796254cf | |||
| 77bd649251 | |||
| 1471381b12 | |||
| fc6c1da3e0 | |||
| ebac413997 | |||
|
|
9fa17c1360 | ||
|
|
982b401b28 | ||
|
|
26b864a314 | ||
|
|
f2fae9184f | ||
|
|
32db4a19d2 | ||
|
|
613f6de483 | ||
|
|
f89849218a | ||
|
|
05341be534 | ||
| 45b99d85ff | |||
| a0fdebd13e | |||
| fb1ff6e4fd | |||
| 6f64ed1032 | |||
| 91a5340b23 | |||
| 8883a9ee51 | |||
| 610ada505f | |||
| 236f484e10 | |||
|
|
3383bcaff3 | ||
|
|
83352dd284 | ||
| b27efd118b | |||
|
|
18fcb6bb97 | ||
| 5baa09f0c1 | |||
|
|
bfff55ab08 | ||
|
|
051922b4c2 | ||
| 9dd80be36d | |||
|
|
873905a288 | ||
|
|
f8066431d3 | ||
| 5c655dd84c | |||
| 00aefefc31 | |||
|
|
d865a60151 | ||
| 1eef5bb239 | |||
|
|
0457792d99 | ||
|
|
8c9f0ae922 | ||
|
|
44a8186830 | ||
|
|
d4698301ad | ||
|
|
b7d3d849eb | ||
|
|
cb33176e8b | ||
|
|
6edf466220 | ||
| 0d4452d0f5 | |||
| e02f74d77d | |||
| 47a8739db5 | |||
| 760e8b0491 | |||
| fe518a0d8f | |||
| 227849a14c | |||
| 9e2c23cf2d | |||
| acd241e31e | |||
| 9cfc98bb67 | |||
| 6a9407f15c | |||
| af79e26855 | |||
| 02a404b805 | |||
| f2e97df44c | |||
| 63a695dcc5 | |||
| 66cf0689e1 | |||
| c7b8187829 | |||
| 5cfc350c13 | |||
| a3ef66bbfb | |||
| 738728f647 | |||
| abbb4e2dff | |||
| c3fa8a6d33 | |||
| fb2b912f93 | |||
| 46c5c62e15 | |||
| 60fdbb8ac4 | |||
| 86bd5eaa07 | |||
| 57122cc2f9 | |||
| 91a8058a3a | |||
| 97836c5f4e | |||
| 1a8cfefa4d | |||
| 0e97a63103 | |||
| 24269cc774 | |||
| d960d94c0d | |||
| 663d63b009 | |||
| 7118631213 | |||
| ff34017a03 | |||
| 96a7a2acab | |||
| 71c830fc2e | |||
| 271e7d2157 | |||
| cf5e5a1d1e | |||
| 186d6931ac | |||
| 6ec686040c | |||
| 211cef298c | |||
| 8de41bdd99 | |||
| 7a5c9c7ef8 | |||
| 4dec85ee60 | |||
| 4622509356 | |||
| 30e44d6bf2 | |||
| e403bbca0b | |||
| 93e06a5765 | |||
| 718f6ab366 | |||
| 6f776576ab | |||
| fcdaeb2e8f | |||
| 1e679ce50b | |||
| fe4be69051 | |||
| 06ba14e8be | |||
| ca1b196942 | |||
| dc5d8afe32 | |||
| b843fd9188 | |||
| d56173eceb | |||
| 97621bca67 | |||
| 7e986b2088 | |||
| cfc2fd1b47 | |||
| 905486fff9 | |||
| 6acf4bc927 | |||
| 64a1aeef2c | |||
| 6db88eb8bd | |||
| 4e416aaf44 | |||
| 71b9f15e40 | |||
| 4dc2bfc8bf | |||
| 31c1055f3d | |||
| 3da2229a9c | |||
| 624289cc8e | |||
| 9edc8a0d5a | |||
| 3bf914471a | |||
| 7d3c8a2d27 | |||
| f12628bec3 | |||
| c1734e6d12 | |||
| 4bff860c01 | |||
| 6a8b83f750 | |||
| ab9718b7c6 | |||
| 0a9235bcd9 | |||
| eff2f2ba41 | |||
| db644c93ff | |||
| 28e031265c | |||
| 84abd006ad | |||
| 5f4a327c2e | |||
| c5102590cc | |||
| 072264faad | |||
| 6b74bc155e | |||
| 9d506b11a3 | |||
| f47b3673a7 | |||
| dbb8be502a | |||
| 170747741f | |||
| e4a3acdd68 | |||
| 953bdef657 | |||
| 64ef0fa160 | |||
| c1f40c1030 | |||
| 8de584b292 | |||
| cb7bb01671 | |||
| a7b2bb820b | |||
| be9c0cff61 | |||
| 6ac6ad0c0a | |||
| dbc69def0b | |||
| b8061966be | |||
| 0e0af73633 | |||
| 2a2aeed045 | |||
| fdc007f609 | |||
| dec55cfb2d | |||
| 3997af171e | |||
| d963cdae35 | |||
| 8ec209422a | |||
| 8ca86b1e14 | |||
| ffba4e9cef | |||
| 544192ad5f | |||
| 08b0564dba | |||
| 009c49247d | |||
| dd7a3ced4d | |||
| ceff85fcfd | |||
| bb62f9fbd6 | |||
| 7bbbf54775 | |||
| 1b506cb820 | |||
| 3f988d1529 | |||
| 2da28cea01 | |||
| 42e6013d95 | |||
| 3c8dbe70dc | |||
| 4a1989fb79 | |||
| b559dbbe66 | |||
| d72fb6e3e8 | |||
| 092722fad8 | |||
| 63633e8891 | |||
| 61cdfa264e | |||
| 6262b0581a | |||
| 8694b31066 | |||
| 5a541271b8 | |||
|
|
9b14e9079b | ||
| fd26d14380 |
14
.github/workflows/packages_publishing.yml
vendored
14
.github/workflows/packages_publishing.yml
vendored
@@ -20,15 +20,17 @@ jobs:
|
|||||||
run: ./gradlew ksp
|
run: ./gradlew ksp
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
- name: API compatibility check
|
||||||
|
run: ./gradlew apiCheck
|
||||||
|
- name: Publish to GithubPackages
|
||||||
|
continue-on-error: true
|
||||||
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Publish to Gitea
|
- name: Publish to Gitea
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
||||||
env:
|
env:
|
||||||
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
||||||
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
||||||
- name: Publish to GithubPackages
|
|
||||||
continue-on-error: true
|
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
|
||||||
env:
|
|
||||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
|
||||||
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
116
CHANGELOG.md
116
CHANGELOG.md
@@ -1,5 +1,121 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 15.1.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.7** (thanks to [bpavuk](https://threads.net/b_pavuchok))
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.6** (with participation and help of [bpavuk](https://threads.net/b_pavuchok))
|
||||||
|
|
||||||
|
* Add support of paid media
|
||||||
|
* Update web apps
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.21.1` -> `0.21.2`
|
||||||
|
* `Core`:
|
||||||
|
* `TelegramMedia` has been separated onto two interfaces: `TelegramFreeMedia` and `TelegramPaidMedia`
|
||||||
|
* `TelegramFreeMedia` has replaced `TelegramMedia` on all old places where it have been used
|
||||||
|
* `Photo` has been renamed to `PhotoFile`
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* Add notification when handling of `/privacy` command is absence
|
||||||
|
* Add several extensions to simplify setting up `/privacy` reaction
|
||||||
|
|
||||||
|
## 15.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.5**
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.21.0` -> `0.21.1`
|
||||||
|
* A lot of `edit` methods and classes has been changed to support business connection id
|
||||||
|
|
||||||
|
## 14.1.0
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Coroutines`: `1.8.0` -> `1.8.1`
|
||||||
|
* `Ktor`: `2.3.10` -> `2.3.11`
|
||||||
|
* `MicroUtils`: `0.20.45` -> `0.21.0`
|
||||||
|
* `KSLog`: `1.3.3` -> `1.3.4`
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* `BehaviourContext` updates listening job will be weakly subscribed. It means that `BehaviourContext` scope will
|
||||||
|
not be prevented from cancelling by this job anymore
|
||||||
|
* `BehaviourContext.doInContext` will not stop automatically current `BehaviourContext` job anymore
|
||||||
|
* `BehaviourContext.createSubContextAndDoWithUpdatesFilter` will use `supervisorScope` instead of
|
||||||
|
`LinkedSupervisorScope`. That will prevent scope leaking in runtime
|
||||||
|
|
||||||
|
## 14.0.1
|
||||||
|
|
||||||
|
* In `core` and `api` modules related to invoices changed their APIs to suite current API
|
||||||
|
|
||||||
|
## 14.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
|
||||||
|
* All the methods/classes related to sending of messages got `effectId` parameter
|
||||||
|
* All the methods/classes related to sending of photos/animations/videos got `showCaptionAboveMedia` parameter
|
||||||
|
|
||||||
|
## 13.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.3](https://core.telegram.org/bots/api-changelog#may-6-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* For polls, `textSources` now means `question` text sources. For `QuizPoll` there are `explanation` and `explanationTextSources`
|
||||||
|
for hinting
|
||||||
|
* `API`:
|
||||||
|
* A lot of API related to `Poll`s has been changed to include opportunity to pass `ParseMode` and `TextSource`s list
|
||||||
|
|
||||||
|
## 12.0.1
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Ktor`: `2.3.9` -> `2.3.10`
|
||||||
|
* `MicroUtils`: `0.20.39` -> `0.20.45`
|
||||||
|
* `UUID`: `0.8.2` -> `0.8.4`
|
||||||
|
|
||||||
|
## 12.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
||||||
|
|
||||||
|
## 11.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* `MessageId` now is `value class`. `MessageIdentifier` become deprecated
|
||||||
|
* `MessageThreadId` now is `value class`
|
||||||
|
* `InlineQueryIdentifier` now is `value class`
|
||||||
|
* `MediaGroupIdentifier` has been renamed to `MediaGroupId` and now is `value class`
|
||||||
|
* `CallbackQueryIdentifier` has been renamed to `CallbackQueryId` and now is `value class`
|
||||||
|
* `WebAppQueryId` now is `value class`
|
||||||
|
* `PreCheckoutQueryId` now is `value class`
|
||||||
|
* `FileUniqueId` has been renamed to `TgFileUniqueId` and now is `value class`
|
||||||
|
* `UpdateIdentifier` has been renamed to `UpdateId` and now is `value class`
|
||||||
|
* `InlineMessageIdentifier` has been renamed to `InlineMessageId` and now is `value class`
|
||||||
|
* `ShippingQueryIdentifier` has been renamed to `ShippingQueryId` and now is `value class`
|
||||||
|
* `Identifier` has been renamed to `RawChatId` and now is `value class`
|
||||||
|
* `ShippingOptionIdentifier` has been renamed to `ShippingOptionId` and now is `value class`
|
||||||
|
* `PollIdentifier` has been renamed to `PollId` and now is `value class`
|
||||||
|
* `StickerSetName` now is `value class`
|
||||||
|
|
||||||
|
## 10.1.2
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `1.9.22` -> `1.9.23`
|
||||||
|
* `Korlibs`: `5.3.2` -> `5.4.0`
|
||||||
|
* `Ktor`: `2.3.8` -> `2.3.9`
|
||||||
|
* `MicroUtils`: `0.20.37` -> `0.20.39`
|
||||||
|
* `KSLog`: `1.3.2` -> `1.3.3`
|
||||||
|
|
||||||
## 10.1.1
|
## 10.1.1
|
||||||
|
|
||||||
* `Version`:
|
* `Version`:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#february-16-2024)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-7-2024)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
|
|||||||
@@ -17,15 +17,16 @@ buildscript {
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin.dokka)
|
alias(libs.plugins.kotlin.dokka)
|
||||||
alias(libs.plugins.versions)
|
alias(libs.plugins.versions)
|
||||||
|
alias(libs.plugins.validator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// temporal crutch until legacy tests will be stabled or legacy target will be removed
|
// temporal crutch until legacy tests will be stabled or legacy target will be removed
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
|
||||||
}
|
}
|
||||||
if (it != rootProject.findProject("docs")) {
|
if (it != rootProject.findProject("docs")) {
|
||||||
tasks.whenTaskAdded { task ->
|
tasks.whenTaskAdded { task ->
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=10.1.1
|
library_version=15.1.0
|
||||||
|
|||||||
@@ -1,25 +1,27 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.9.22"
|
kotlin = "1.9.23"
|
||||||
kotlin-serialization = "1.6.3"
|
kotlin-serialization = "1.6.3"
|
||||||
kotlin-coroutines = "1.8.0"
|
kotlin-coroutines = "1.8.1"
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.3.2"
|
korlibs = "5.4.0"
|
||||||
uuid = "0.8.2"
|
uuid = "0.8.4"
|
||||||
ktor = "2.3.8"
|
ktor = "2.3.11"
|
||||||
|
|
||||||
ksp = "1.9.22-1.0.18"
|
ksp = "1.9.23-1.0.20"
|
||||||
kotlin-poet = "1.16.0"
|
kotlin-poet = "1.16.0"
|
||||||
|
|
||||||
microutils = "0.20.37"
|
microutils = "0.21.2"
|
||||||
kslog = "1.3.2"
|
kslog = "1.3.4"
|
||||||
|
|
||||||
versions = "0.51.0"
|
versions = "0.51.0"
|
||||||
|
|
||||||
github-release-plugin = "2.5.2"
|
github-release-plugin = "2.5.2"
|
||||||
dokka = "1.9.10"
|
dokka = "1.9.20"
|
||||||
|
|
||||||
|
validator = "0.14.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -78,3 +80,4 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref
|
|||||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||||
|
validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "validator" }
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
|
|||||||
@@ -38,14 +38,14 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
|
||||||
maven {
|
maven {
|
||||||
name = "GithubPackages"
|
name = "GithubPackages"
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
|
||||||
|
|
||||||
credentials {
|
credentials {
|
||||||
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
|
||||||
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/TelegramBotAPI"},{"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://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||||
2281
tgbotapi.api/api/tgbotapi.api.api
Normal file
2281
tgbotapi.api/api/tgbotapi.api.api
Normal file
File diff suppressed because it is too large
Load Diff
@@ -27,15 +27,6 @@ suspend fun TelegramBot.deleteMessages(
|
|||||||
messageIds = messageIds.toList()
|
messageIds = messageIds.toList()
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId
|
|
||||||
) = deleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = (listOf(firstMessageId) + messageIds.toList())
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
suspend fun TelegramBot.deleteMessages(
|
||||||
messagesMetas: List<Message.MetaInfo>
|
messagesMetas: List<Message.MetaInfo>
|
||||||
) = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
) = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
||||||
@@ -60,14 +51,6 @@ suspend fun TelegramBot.delete(
|
|||||||
messageIds: Array<MessageId>
|
messageIds: Array<MessageId>
|
||||||
) = deleteMessages(chatId = chatId, messageIds = messageIds)
|
) = deleteMessages(chatId = chatId, messageIds = messageIds)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
secondMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId
|
|
||||||
) = deleteMessages(chatId = chatId, messageIds = (listOf(firstMessageId, secondMessageId) + messageIds.toList()))
|
|
||||||
|
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
messagesMetas: List<Message.MetaInfo>
|
messagesMetas: List<Message.MetaInfo>
|
||||||
) = deleteMessages(messagesMetas)
|
) = deleteMessages(messagesMetas)
|
||||||
|
|||||||
@@ -48,25 +48,6 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = (listOf(firstMessageId) + messageIds.toList()),
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
suspend fun TelegramBot.forwardMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
@@ -139,26 +120,6 @@ suspend fun TelegramBot.forward(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
firstMessageId = firstMessageId,
|
|
||||||
messageIds = *messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
suspend fun TelegramBot.forward(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.*
|
|||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
suspend fun TelegramBot.getUpdates(
|
suspend fun TelegramBot.getUpdates(
|
||||||
offset: UpdateIdentifier? = null,
|
offset: UpdateId? = null,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.GetUpdates
|
|
||||||
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
suspend fun TelegramBot.getRawUpdates(
|
suspend fun TelegramBot.getRawUpdates(
|
||||||
offset: UpdateIdentifier? = null,
|
offset: UpdateId? = null,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
import dev.inmo.tgbotapi.types.MediaGroupId
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.update.*
|
import dev.inmo.tgbotapi.types.update.*
|
||||||
@@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage
|
|||||||
*/
|
*/
|
||||||
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
||||||
val resultUpdates = mutableListOf<Update>()
|
val resultUpdates = mutableListOf<Update>()
|
||||||
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
val mediaGroups = mutableMapOf<MediaGroupId, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
||||||
|
|
||||||
for (update in this) {
|
for (update in this) {
|
||||||
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
||||||
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
|
||||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.abstracts.*
|
import dev.inmo.tgbotapi.abstracts.*
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
@@ -9,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.edit
|
|||||||
import dev.inmo.tgbotapi.extensions.api.send.send
|
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.location.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
@@ -42,34 +44,47 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
||||||
while (isActive) {
|
null
|
||||||
delay(liveTimeMillis)
|
} else {
|
||||||
// Remove previous location message info to resend live location message
|
val scope = currentCoroutineContext().LinkedSupervisorScope()
|
||||||
currentLiveLocationMessage = null
|
scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||||
|
while (scope.isActive) {
|
||||||
|
delay(liveTimeMillis)
|
||||||
|
// Remove previous location message info to resend live location message
|
||||||
|
currentLiveLocationMessage = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
locationsFlow.collect {
|
locationsFlow.collect {
|
||||||
val capturedLiveLocationMessage = currentLiveLocationMessage
|
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||||
if (capturedLiveLocationMessage == null) {
|
if (capturedLiveLocationMessage == null) {
|
||||||
updateMessageJob.start()
|
updateMessageJob ?.start()
|
||||||
currentLiveLocationMessage = send(
|
currentLiveLocationMessage = send(
|
||||||
chatId,
|
chatId,
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
|
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
||||||
|
LiveLocation.INDEFINITE_LIVE_PERIOD
|
||||||
|
} else {
|
||||||
|
ceil(liveTimeMillis.toDouble() / 1000).toInt()
|
||||||
|
},
|
||||||
it.horizontalAccuracy,
|
it.horizontalAccuracy,
|
||||||
it.heading,
|
it.heading,
|
||||||
it.proximityAlertRadius,
|
it.proximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
@@ -77,13 +92,13 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
edit(
|
edit(
|
||||||
capturedLiveLocationMessage,
|
message = capturedLiveLocationMessage,
|
||||||
it.latitude,
|
latitude = it.latitude,
|
||||||
it.longitude,
|
longitude = it.longitude,
|
||||||
it.horizontalAccuracy,
|
horizontalAccuracy = it.horizontalAccuracy,
|
||||||
it.heading,
|
heading = it.heading,
|
||||||
it.proximityAlertRadius,
|
proximityAlertRadius = it.proximityAlertRadius,
|
||||||
it.replyMarkup
|
replyMarkup = it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
sentMessageFlow ?.emit(it)
|
sentMessageFlow ?.emit(it)
|
||||||
}
|
}
|
||||||
@@ -102,14 +117,16 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
locationsFlow: Flow<Location>,
|
locationsFlow: Flow<Location>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map {
|
locationsFlow = locationsFlow.map {
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -119,12 +136,14 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
sentMessageFlow
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,24 +158,28 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
locationsFlow: Flow<Pair<Double, Double>>,
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map { (lat, long) ->
|
locationsFlow = locationsFlow.map { (lat, long) ->
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
lat,
|
lat,
|
||||||
long
|
long
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
sentMessageFlow
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
|||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
||||||
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -22,7 +23,8 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
||||||
|
const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see startLiveLocation
|
* @see startLiveLocation
|
||||||
@@ -63,7 +65,7 @@ class LiveLocationProvider internal constructor(
|
|||||||
message = requestsExecutor.editLiveLocation(
|
message = requestsExecutor.editLiveLocation(
|
||||||
message,
|
message,
|
||||||
location,
|
location,
|
||||||
replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
return lastLocation
|
return lastLocation
|
||||||
} else {
|
} else {
|
||||||
@@ -94,8 +96,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
@@ -110,8 +114,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -139,8 +145,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -153,8 +161,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -172,8 +182,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -186,8 +198,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -205,8 +219,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -219,8 +235,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -239,8 +257,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||||
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -253,8 +273,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -272,8 +294,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||||
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -285,8 +309,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.StopPoll
|
import dev.inmo.tgbotapi.requests.StopPoll
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
@@ -14,9 +15,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
StopPoll(chatId, messageId, replyMarkup)
|
StopPoll(chatId, messageId, businessConnectionId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,8 +28,9 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, messageId, replyMarkup)
|
) = stopPoll(chat.id, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -36,8 +39,9 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
) = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -46,5 +50,6 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
) = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.answers
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
|
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.CallbackQueryIdentifier
|
import dev.inmo.tgbotapi.types.CallbackQueryId
|
||||||
|
|
||||||
suspend fun TelegramBot.answerCallbackQuery(
|
suspend fun TelegramBot.answerCallbackQuery(
|
||||||
callbackQueryId: CallbackQueryIdentifier,
|
callbackQueryId: CallbackQueryId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
showAlert: Boolean? = null,
|
showAlert: Boolean? = null,
|
||||||
url: String? = null,
|
url: String? = null,
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.answers.AnswerInlineQuery
|
|||||||
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
|
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
import dev.inmo.tgbotapi.types.InlineQueryId
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQueryID: InlineQueryIdentifier,
|
inlineQueryID: InlineQueryId,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
isPersonal: Boolean? = null,
|
isPersonal: Boolean? = null,
|
||||||
@@ -37,7 +37,7 @@ suspend fun TelegramBot.answer(
|
|||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQueryID: InlineQueryIdentifier,
|
inlineQueryID: InlineQueryId,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
isPersonal: Boolean? = null,
|
isPersonal: Boolean? = null,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.answers.payments
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryError
|
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryError
|
||||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryOk
|
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryOk
|
||||||
import dev.inmo.tgbotapi.types.ShippingQueryIdentifier
|
import dev.inmo.tgbotapi.types.ShippingQueryId
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
|
||||||
suspend fun TelegramBot.answerShippingQueryOk(
|
suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
id: ShippingQueryIdentifier,
|
id: ShippingQueryId,
|
||||||
shippingOptions: List<ShippingOption>
|
shippingOptions: List<ShippingOption>
|
||||||
) = execute(AnswerShippingQueryOk(id, shippingOptions))
|
) = execute(AnswerShippingQueryOk(id, shippingOptions))
|
||||||
suspend fun TelegramBot.answerShippingQueryOk(
|
suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
@@ -17,7 +17,7 @@ suspend fun TelegramBot.answerShippingQueryOk(
|
|||||||
) = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
) = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerShippingQueryError(
|
suspend fun TelegramBot.answerShippingQueryError(
|
||||||
id: ShippingQueryIdentifier,
|
id: ShippingQueryId,
|
||||||
error: String
|
error: String
|
||||||
) = execute(AnswerShippingQueryError(id, error))
|
) = execute(AnswerShippingQueryError(id, error))
|
||||||
suspend fun TelegramBot.answerShippingQueryError(
|
suspend fun TelegramBot.answerShippingQueryError(
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ 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.reply_markup.editMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
@@ -29,9 +30,11 @@ suspend fun <T> TelegramBot.edit(
|
|||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, text, parseMode, replyMarkup)
|
return editMessageCaption(message, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,9 +44,11 @@ suspend fun <T> TelegramBot.edit(
|
|||||||
suspend fun <T> TelegramBot.edit(
|
suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, entities, replyMarkup)
|
return editMessageCaption(message, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,11 +60,13 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -70,11 +77,13 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -84,11 +93,13 @@ suspend fun TelegramBot.edit(
|
|||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -98,9 +109,10 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(
|
) = editLiveLocation(
|
||||||
chatId, messageId, location, replyMarkup
|
chatId, messageId, location, businessConnectionId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,8 +123,9 @@ suspend fun TelegramBot.edit(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, location, replyMarkup)
|
) = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -121,8 +134,9 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message, location, replyMarkup)
|
) = editLiveLocation(message, location, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -131,9 +145,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chatId, messageId, media, replyMarkup)
|
) = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -142,9 +157,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat, messageId, media, replyMarkup)
|
) = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -152,9 +168,10 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<MediaContent>,
|
message: ContentMessage<MediaContent>,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(message, media, replyMarkup)
|
) = editMessageMedia(message, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -163,8 +180,9 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -173,8 +191,9 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -182,8 +201,9 @@ suspend fun TelegramBot.edit(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message, replyMarkup)
|
) = editMessageReplyMarkup(message, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -194,9 +214,10 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -206,9 +227,10 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -218,10 +240,11 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -231,10 +254,11 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -244,9 +268,10 @@ suspend fun TelegramBot.edit(
|
|||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = edit(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -255,9 +280,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = edit(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -266,10 +292,11 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -278,10 +305,11 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -290,10 +318,11 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -302,7 +331,8 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -1,21 +1,15 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.edit
|
package dev.inmo.tgbotapi.extensions.api.edit
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.TextedWithTextSources
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
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.location.live.editLiveLocation
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
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.reply_markup.editMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||||
@@ -26,7 +20,7 @@ import dev.inmo.tgbotapi.utils.buildEntities
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -40,7 +34,7 @@ suspend fun TelegramBot.edit(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(
|
) = editLiveLocation(
|
||||||
@@ -52,8 +46,8 @@ suspend fun TelegramBot.edit(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(messageId, media, replyMarkup)
|
) = editMessageMedia(messageId, media, replyMarkup)
|
||||||
|
|
||||||
@@ -62,7 +56,7 @@ suspend fun TelegramBot.edit(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(messageId, replyMarkup)
|
) = editMessageReplyMarkup(messageId, replyMarkup)
|
||||||
|
|
||||||
@@ -71,44 +65,48 @@ suspend fun TelegramBot.edit(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -24,9 +26,11 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,8 +42,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -49,10 +55,12 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +71,11 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,9 +85,11 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -85,11 +97,13 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
*/
|
*/
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,8 +113,10 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup)
|
return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.caption
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.caption.EditInlineMessageCaption
|
import dev.inmo.tgbotapi.requests.edit.caption.EditInlineMessageCaption
|
||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
@@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -23,7 +23,7 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))
|
) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.location.live
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.location.live.EditChatMessageLiveLocation
|
import dev.inmo.tgbotapi.requests.edit.location.live.EditChatMessageLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
@@ -18,13 +19,15 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageLiveLocation(
|
EditChatMessageLiveLocation(
|
||||||
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
|
chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,11 +40,13 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -51,11 +56,13 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
|
livePeriod: Seconds? = null,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -65,10 +72,11 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageLiveLocation(
|
EditChatMessageLiveLocation(
|
||||||
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
|
chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -80,8 +88,9 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -90,5 +99,6 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
|
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
@@ -20,7 +20,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
|
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
@@ -16,10 +18,11 @@ import dev.inmo.tgbotapi.types.message.content.LocationContent
|
|||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
StopChatMessageLiveLocation(
|
StopChatMessageLiveLocation(
|
||||||
chatId, messageId, replyMarkup
|
chatId, messageId, businessConnectionId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -30,8 +33,9 @@ suspend fun TelegramBot.stopLiveLocation(
|
|||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopLiveLocation(chat.id, messageId, replyMarkup)
|
) = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -39,5 +43,6 @@ suspend fun TelegramBot.stopLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopLiveLocation(message.chat, message.messageId, replyMarkup)
|
) = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.location.live
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.location.live.StopInlineMessageLiveLocation
|
import dev.inmo.tgbotapi.requests.edit.location.live.StopInlineMessageLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
StopInlineMessageLiveLocation(
|
StopInlineMessageLiveLocation(
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.edit.media
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
|
import dev.inmo.tgbotapi.requests.edit.media.EditChatMessageMedia
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
@@ -17,10 +19,11 @@ import dev.inmo.tgbotapi.types.message.content.MediaContent
|
|||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageMedia(chatId, messageId, media, replyMarkup)
|
EditChatMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,9 +33,10 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat.id, messageId, media, replyMarkup)
|
) = editMessageMedia(chat.id, messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -40,6 +44,7 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
message: ContentMessage<out MediaContent>,
|
message: ContentMessage<out MediaContent>,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(message.chat.id, message.messageId, media, replyMarkup)
|
) = editMessageMedia(message.chat.id, message.messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.edit.media
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.media.EditInlineMessageMedia
|
import dev.inmo.tgbotapi.requests.edit.media.EditInlineMessageMedia
|
||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup
|
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditChatMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
@@ -15,9 +17,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup)
|
EditChatMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,8 +30,9 @@ suspend fun TelegramBot.editMessageReplyMarkup(
|
|||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chat.id, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -36,6 +40,7 @@ suspend fun TelegramBot.editMessageReplyMarkup(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup)
|
) = editMessageReplyMarkup(message.chat.id, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.reply_markup
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditInlineMessageReplyMarkup
|
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditInlineMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,6 +10,6 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup))
|
) = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup))
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.LinkPreviewOptions
|
import dev.inmo.tgbotapi.types.LinkPreviewOptions
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -24,10 +26,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
EditChatMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,9 +42,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -51,9 +55,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -63,10 +68,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
EditChatMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,10 +83,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -90,10 +97,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -103,9 +111,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -115,10 +124,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -128,10 +138,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -140,9 +151,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -151,10 +163,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -163,10 +176,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -176,9 +190,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -188,10 +203,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -201,7 +217,8 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.text
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.edit.text.EditInlineMessageText
|
import dev.inmo.tgbotapi.requests.edit.text.EditInlineMessageText
|
||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||||
import dev.inmo.tgbotapi.types.LinkPreviewOptions
|
import dev.inmo.tgbotapi.types.LinkPreviewOptions
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
@@ -16,44 +16,48 @@ import dev.inmo.tgbotapi.utils.buildEntities
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, entities, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.chat.CommonUser
|
|||||||
|
|
||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
inlineMessageId: InlineMessageIdentifier
|
inlineMessageId: InlineMessageId
|
||||||
) = execute(
|
) = execute(
|
||||||
GetGameHighScoresByInlineMessageId(
|
GetGameHighScoresByInlineMessageId(
|
||||||
userId, inlineMessageId
|
userId, inlineMessageId
|
||||||
@@ -16,5 +16,5 @@ suspend fun TelegramBot.getGameScore(
|
|||||||
|
|
||||||
suspend fun TelegramBot.getGameScore(
|
suspend fun TelegramBot.getGameScore(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
inlineMessageId: InlineMessageIdentifier
|
inlineMessageId: InlineMessageId
|
||||||
) = getGameScore(user.id, inlineMessageId)
|
) = getGameScore(user.id, inlineMessageId)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.chat.CommonUser
|
|||||||
suspend fun TelegramBot.setGameScore(
|
suspend fun TelegramBot.setGameScore(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
score: Long,
|
score: Long,
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -20,7 +20,7 @@ suspend fun TelegramBot.setGameScore(
|
|||||||
suspend fun TelegramBot.setGameScore(
|
suspend fun TelegramBot.setGameScore(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
score: Long,
|
score: Long,
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageId,
|
||||||
force: Boolean = false,
|
force: Boolean = false,
|
||||||
disableEditMessage: Boolean = false
|
disableEditMessage: Boolean = false
|
||||||
) = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage)
|
) = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.get
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.common.Warning
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.get.GetBusinessConnection
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getBusinessConnection(
|
||||||
|
id: BusinessConnectionId
|
||||||
|
) = execute(GetBusinessConnection(businessConnectionId = id))
|
||||||
|
|
||||||
|
@Warning("This method may lead to error due to raw String type usage")
|
||||||
|
suspend fun TelegramBot.getBusinessConnection(
|
||||||
|
id: String
|
||||||
|
) = getBusinessConnection(
|
||||||
|
BusinessConnectionId(id)
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.get
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.get.GetStarTransactions
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getStarTransactions(
|
||||||
|
offset: Int? = null,
|
||||||
|
limit: Int? = null,
|
||||||
|
) = execute(
|
||||||
|
GetStarTransactions(
|
||||||
|
offset = offset,
|
||||||
|
limit = limit
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -2,14 +2,21 @@ package dev.inmo.tgbotapi.extensions.api.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
||||||
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
import dev.inmo.tgbotapi.types.files.Sticker
|
||||||
|
|
||||||
suspend fun TelegramBot.getStickerSet(
|
suspend fun TelegramBot.getStickerSet(
|
||||||
name: String
|
name: StickerSetName
|
||||||
) = execute(
|
) = execute(
|
||||||
GetStickerSet(name)
|
GetStickerSet(name)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getStickerSet(
|
||||||
|
name: String
|
||||||
|
) = getStickerSet(
|
||||||
|
StickerSetName(name)
|
||||||
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.getStickerSetOrNull(
|
suspend fun TelegramBot.getStickerSetOrNull(
|
||||||
sticker: Sticker
|
sticker: Sticker
|
||||||
) = sticker.stickerSetName ?.let {
|
) = sticker.stickerSetName ?.let {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -31,6 +32,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -49,12 +51,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, 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
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -66,12 +69,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -83,12 +87,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +105,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -111,6 +117,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -128,12 +135,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -144,12 +152,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -160,12 +169,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -176,12 +186,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.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
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -192,12 +203,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -207,12 +219,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -222,12 +235,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = 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
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -239,6 +253,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -251,6 +266,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
toChatId,
|
toChatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -269,6 +285,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -280,6 +297,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -297,6 +315,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -308,6 +327,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -325,6 +345,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -336,6 +357,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -353,6 +375,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -364,6 +387,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
messageId,
|
messageId,
|
||||||
toChatId,
|
toChatId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -381,6 +405,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -391,6 +416,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -407,6 +433,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -417,6 +444,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChatId,
|
fromChatId,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
@@ -433,6 +461,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
@@ -443,6 +472,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
fromChat.id,
|
fromChat.id,
|
||||||
messageId,
|
messageId,
|
||||||
entities,
|
entities,
|
||||||
|
showCaptionAboveMedia,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
|||||||
@@ -47,25 +47,6 @@ suspend fun TelegramBot.copyMessages(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = (listOf(firstMessageId) + messageIds.toList()),
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copyMessages(
|
suspend fun TelegramBot.copyMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
@@ -138,26 +119,6 @@ suspend fun TelegramBot.copy(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.copy(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
firstMessageId: MessageId,
|
|
||||||
vararg messageIds: MessageId,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
firstMessageId = firstMessageId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copy(
|
suspend fun TelegramBot.copy(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -24,13 +25,14 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
) as ContentMessage<T>
|
) as ContentMessage<T>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will send [content] to the [chatId] as is
|
* This method will send [content] to the [chat] as is
|
||||||
*/
|
*/
|
||||||
suspend inline fun <T : MessageContent> TelegramBot.resend(
|
suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
@@ -38,6 +40,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -46,6 +49,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -61,6 +65,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chatId.threadId,
|
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -69,6 +74,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -84,6 +90,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
@@ -92,6 +99,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,127 +5,152 @@ import dev.inmo.tgbotapi.requests.send.SendAction
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.actions.*
|
import dev.inmo.tgbotapi.types.actions.*
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
suspend fun TelegramBot.sendBotAction(
|
suspend fun TelegramBot.sendBotAction(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
action: BotAction,
|
action: BotAction,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAction(chatId, action, threadId)
|
SendAction(chatId, action, threadId, businessConnectionId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendBotAction(
|
suspend fun TelegramBot.sendBotAction(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
action: BotAction,
|
action: BotAction,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat.id, action, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat.id, action, threadId, businessConnectionId)
|
||||||
|
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionTyping(
|
suspend fun TelegramBot.sendActionTyping(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, TypingAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, TypingAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadPhoto(
|
suspend fun TelegramBot.sendActionUploadPhoto(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, UploadPhotoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, UploadPhotoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVideo(
|
suspend fun TelegramBot.sendActionRecordVideo(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, RecordVideoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, RecordVideoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVideo(
|
suspend fun TelegramBot.sendActionUploadVideo(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, UploadVideoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, UploadVideoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVoice(
|
suspend fun TelegramBot.sendActionRecordVoice(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, RecordVoiceAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, RecordVoiceAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVoice(
|
suspend fun TelegramBot.sendActionUploadVoice(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, UploadVoiceAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, UploadVoiceAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadDocument(
|
suspend fun TelegramBot.sendActionUploadDocument(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, UploadDocumentAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, UploadDocumentAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionFindLocation(
|
suspend fun TelegramBot.sendActionFindLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, FindLocationAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, FindLocationAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVideoNote(
|
suspend fun TelegramBot.sendActionRecordVideoNote(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, RecordVideoNoteAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVideoNote(
|
suspend fun TelegramBot.sendActionUploadVideoNote(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
threadId: MessageThreadId? = chatId.threadId
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
) = sendBotAction(chatId, UploadVideoNoteAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
) = sendBotAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionTyping(
|
suspend fun TelegramBot.sendActionTyping(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, TypingAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, TypingAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadPhoto(
|
suspend fun TelegramBot.sendActionUploadPhoto(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, UploadPhotoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, UploadPhotoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVideo(
|
suspend fun TelegramBot.sendActionRecordVideo(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, RecordVideoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, RecordVideoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVideo(
|
suspend fun TelegramBot.sendActionUploadVideo(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, UploadVideoAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, UploadVideoAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVoice(
|
suspend fun TelegramBot.sendActionRecordVoice(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, RecordVoiceAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, RecordVoiceAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVoice(
|
suspend fun TelegramBot.sendActionUploadVoice(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, UploadVoiceAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, UploadVoiceAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadDocument(
|
suspend fun TelegramBot.sendActionUploadDocument(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, UploadDocumentAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, UploadDocumentAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionFindLocation(
|
suspend fun TelegramBot.sendActionFindLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, FindLocationAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, FindLocationAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionRecordVideoNote(
|
suspend fun TelegramBot.sendActionRecordVideoNote(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, RecordVideoNoteAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, RecordVideoNoteAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionUploadVideoNote(
|
suspend fun TelegramBot.sendActionUploadVideoNote(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, UploadVideoNoteAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, UploadVideoNoteAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.sendActionChooseStickerAction(
|
suspend fun TelegramBot.sendActionChooseStickerAction(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
threadId: MessageThreadId? = chat.id.threadId
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
) = sendBotAction(chat, ChooseStickerAction, threadId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
) = sendBotAction(chat, ChooseStickerAction, threadId, businessConnectionId)
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.send.SendAction
|
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.actions.*
|
import dev.inmo.tgbotapi.types.actions.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlin.contracts.*
|
import kotlin.contracts.*
|
||||||
@@ -39,13 +40,14 @@ suspend fun <T> TelegramBot.withAction(
|
|||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
action: BotAction,
|
action: BotAction,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
block: TelegramBotActionCallback<T>
|
block: TelegramBotActionCallback<T>
|
||||||
): T {
|
): T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(
|
return withAction(
|
||||||
SendAction(chatId, action, threadId),
|
SendAction(chatId, action, threadId, businessConnectionId),
|
||||||
block
|
block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -55,6 +57,7 @@ suspend fun <T> TelegramBot.withAction(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
action: BotAction,
|
action: BotAction,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
block: TelegramBotActionCallback<T>
|
block: TelegramBotActionCallback<T>
|
||||||
): T {
|
): T {
|
||||||
contract {
|
contract {
|
||||||
@@ -64,163 +67,164 @@ suspend fun <T> TelegramBot.withAction(
|
|||||||
chat.id,
|
chat.id,
|
||||||
action,
|
action,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
block
|
block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, TypingAction, threadId, block)
|
return withAction(chatId, TypingAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, UploadPhotoAction, threadId, block)
|
return withAction(chatId, UploadPhotoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, RecordVideoAction, threadId, block)
|
return withAction(chatId, RecordVideoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, UploadVideoAction, threadId, block)
|
return withAction(chatId, UploadVideoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, RecordVoiceAction, threadId, block)
|
return withAction(chatId, RecordVoiceAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, UploadVoiceAction, threadId, block)
|
return withAction(chatId, UploadVoiceAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, UploadDocumentAction, threadId, block)
|
return withAction(chatId, UploadDocumentAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, FindLocationAction, threadId, block)
|
return withAction(chatId, FindLocationAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, RecordVideoNoteAction, threadId, block)
|
return withAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, UploadVideoNoteAction, threadId, block)
|
return withAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chatId, ChooseStickerAction, threadId, block)
|
return withAction(chatId, ChooseStickerAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, TypingAction, threadId, block)
|
return withAction(chat, TypingAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, UploadPhotoAction, threadId, block)
|
return withAction(chat, UploadPhotoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, RecordVideoAction, threadId, block)
|
return withAction(chat, RecordVideoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, UploadVideoAction, threadId, block)
|
return withAction(chat, UploadVideoAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, RecordVoiceAction, threadId, block)
|
return withAction(chat, RecordVoiceAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, UploadVoiceAction, threadId, block)
|
return withAction(chat, UploadVoiceAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, UploadDocumentAction, threadId, block)
|
return withAction(chat, UploadDocumentAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, FindLocationAction, threadId, block)
|
return withAction(chat, FindLocationAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, RecordVideoNoteAction, threadId, block)
|
return withAction(chat, RecordVideoNoteAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, UploadVideoNoteAction, threadId, block)
|
return withAction(chat, UploadVideoNoteAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
@OptIn(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||||
contract {
|
contract {
|
||||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
}
|
}
|
||||||
return withAction(chat, ChooseStickerAction, threadId, block)
|
return withAction(chat, ChooseStickerAction, threadId, businessConnectionId, block)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendContact
|
import dev.inmo.tgbotapi.requests.send.SendContact
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
@@ -16,13 +17,15 @@ suspend fun TelegramBot.sendContact(
|
|||||||
firstName: String,
|
firstName: String,
|
||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,13 +37,15 @@ suspend fun TelegramBot.sendContact(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -54,12 +59,14 @@ suspend fun TelegramBot.sendContact(
|
|||||||
firstName: String,
|
firstName: String,
|
||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,10 +77,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
chat.id, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendDice
|
import dev.inmo.tgbotapi.requests.send.SendDice
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||||
@@ -15,12 +16,14 @@ suspend fun TelegramBot.sendDice(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,8 +34,10 @@ suspend fun TelegramBot.sendDice(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
@@ -20,8 +21,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -34,8 +37,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -53,8 +58,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -66,8 +73,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -85,8 +94,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -98,8 +109,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading,
|
heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -116,23 +129,27 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chatId = chat.id,
|
||||||
location.latitude,
|
latitude = location.latitude,
|
||||||
location.longitude,
|
longitude = location.longitude,
|
||||||
livePeriod,
|
livePeriod = livePeriod,
|
||||||
horizontalAccuracy,
|
horizontalAccuracy = horizontalAccuracy,
|
||||||
heading,
|
heading = heading,
|
||||||
proximityAlertRadius,
|
proximityAlertRadius = proximityAlertRadius,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
disableNotification,
|
businessConnectionId = businessConnectionId,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,11 +165,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -166,11 +185,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -185,11 +206,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -203,8 +226,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -21,8 +22,10 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -32,8 +35,10 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
parseMode,
|
parseMode,
|
||||||
linkPreviewOptions,
|
linkPreviewOptions,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -49,12 +54,14 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,11 +74,13 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,11 +93,13 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -99,16 +110,18 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -116,16 +129,18 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -133,12 +148,14 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -149,16 +166,18 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -166,16 +185,18 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -183,12 +204,14 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -199,14 +222,16 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -214,16 +239,18 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
@@ -231,12 +258,14 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -248,14 +277,16 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -263,16 +294,18 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
@@ -280,9 +313,11 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
@@ -16,8 +17,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -26,8 +29,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -41,8 +46,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: Location,
|
location: Location,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -50,8 +57,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
location.latitude,
|
location.latitude,
|
||||||
location.longitude,
|
location.longitude,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -65,8 +74,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -74,8 +85,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -88,8 +101,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: Location,
|
location: Location,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
@@ -97,8 +112,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
location.latitude,
|
location.latitude,
|
||||||
location.longitude,
|
location.longitude,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -112,11 +129,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -126,11 +145,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: Location,
|
location: Location,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -141,11 +162,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -155,8 +178,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: Location,
|
location: Location,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendVenue
|
import dev.inmo.tgbotapi.requests.send.SendVenue
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||||
@@ -23,8 +24,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -39,8 +42,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -61,8 +66,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -76,8 +83,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -96,8 +105,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -111,8 +122,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -131,8 +144,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -146,8 +161,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -160,8 +177,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
venue: Venue,
|
venue: Venue,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -169,8 +188,10 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
@@ -184,16 +205,20 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
venue: Venue,
|
venue: Venue,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
replyParameters = replyParameters,
|
replyParameters = replyParameters,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,6 @@ import dev.inmo.tgbotapi.types.chat.Chat
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.reactions.Reaction
|
import dev.inmo.tgbotapi.types.reactions.Reaction
|
||||||
import kotlin.js.JsName
|
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
suspend fun TelegramBot.setMessageReactions(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send.games
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.games.SendGame
|
import dev.inmo.tgbotapi.requests.send.games.SendGame
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.games.Game
|
import dev.inmo.tgbotapi.types.games.Game
|
||||||
@@ -15,13 +16,15 @@ suspend fun TelegramBot.sendGame(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendGame(
|
SendGame(
|
||||||
chatId, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,12 +36,14 @@ suspend fun TelegramBot.sendGame(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,12 +54,14 @@ suspend fun TelegramBot.sendGame(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
game: Game,
|
game: Game,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chatId, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,10 +72,12 @@ suspend fun TelegramBot.sendGame(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
game: Game,
|
game: Game,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -20,31 +21,37 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -57,17 +64,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId = chatId,
|
||||||
|
animation = animation.fileId,
|
||||||
|
thumb = animation.thumbnail ?.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,16 +106,37 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
thumb = thumb,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -100,16 +147,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,30 +188,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: InputFile,
|
animation: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
animation,
|
animation = animation,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
threadId,
|
height = height,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -156,17 +229,35 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId = chatId,
|
||||||
|
animation = animation.fileId,
|
||||||
|
thumb = animation.thumbnail ?.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -178,16 +269,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
animation: InputFile,
|
animation: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
thumb = thumb,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -197,13 +308,32 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
animation: AnimationFile,
|
animation: AnimationFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(
|
||||||
|
chatId = chat.id,
|
||||||
|
animation = animation,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -24,8 +25,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -39,8 +42,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -60,11 +65,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -77,11 +84,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -94,11 +103,13 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,8 +125,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -128,8 +141,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -148,11 +163,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -164,11 +181,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -180,8 +199,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
title: String? = audio.title,
|
title: String? = audio.title,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -21,8 +22,10 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -34,8 +37,10 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
@@ -53,12 +58,14 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -70,13 +77,15 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,12 +98,14 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -106,8 +117,10 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
@@ -118,8 +131,10 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
thumb,
|
thumb,
|
||||||
entities,
|
entities,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
@@ -136,12 +151,14 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -152,13 +169,15 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,9 +189,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.media.*
|
import dev.inmo.tgbotapi.requests.send.media.*
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
import dev.inmo.tgbotapi.types.media.*
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||||
@@ -20,12 +21,14 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendMediaGroup<MediaGroupPartContent>(
|
SendMediaGroup<MediaGroupPartContent>(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,11 +40,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<MediaGroupMemberTelegramMedia>,
|
media: List<MediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,11 +58,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<MediaGroupPartContent>,
|
media: List<MediaGroupPartContent>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,11 +76,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<MediaGroupPartContent>,
|
media: List<MediaGroupPartContent>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,12 +92,14 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPlaylist(
|
SendPlaylist(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -99,11 +110,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,11 +127,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,11 +144,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<AudioContent>,
|
media: List<AudioContent>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -143,12 +160,14 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDocumentsGroup(
|
SendDocumentsGroup(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -159,11 +178,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -174,11 +195,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,11 +212,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<DocumentContent>,
|
media: List<DocumentContent>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -203,12 +228,14 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVisualMediaGroup(
|
SendVisualMediaGroup(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -219,11 +246,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -234,11 +263,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
media: List<VisualMediaGroupPartContent>,
|
media: List<VisualMediaGroupPartContent>,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -249,9 +280,11 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
media: List<VisualMediaGroupPartContent>,
|
media: List<VisualMediaGroupPartContent>,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null
|
replyParameters: ReplyParameters? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.media
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.media.SendPaidMedia
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
import dev.inmo.tgbotapi.types.media.TelegramPaidMedia
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendPaidMedia(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
starCount: Int,
|
||||||
|
media: List<TelegramPaidMedia>,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendPaidMedia(
|
||||||
|
chatId = chatId,
|
||||||
|
starCount = starCount,
|
||||||
|
media = media,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendPaidMedia(
|
||||||
|
chat: Chat,
|
||||||
|
starCount: Int,
|
||||||
|
media: List<TelegramPaidMedia>,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendPaidMedia(
|
||||||
|
chatId = chat.id,
|
||||||
|
starCount = starCount,
|
||||||
|
media = media,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.sendPaidMedia(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
starCount: Int,
|
||||||
|
media: List<TelegramPaidMedia>,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendPaidMedia(
|
||||||
|
chatId = chatId,
|
||||||
|
starCount = starCount,
|
||||||
|
media = media,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.sendPaidMedia(
|
||||||
|
chat: Chat,
|
||||||
|
starCount: Int,
|
||||||
|
media: List<TelegramPaidMedia>,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendPaidMedia(
|
||||||
|
chatId = chat.id,
|
||||||
|
starCount = starCount,
|
||||||
|
media = media,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -19,24 +20,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
fileId,
|
photo = fileId,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -49,13 +56,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
fileId = fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -63,16 +87,33 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendPhoto(
|
suspend fun TelegramBot.sendPhoto(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: Photo,
|
photo: PhotoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -80,16 +121,33 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.sendPhoto(
|
suspend fun TelegramBot.sendPhoto(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
photo: Photo,
|
photo: PhotoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photo = photo,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -100,13 +158,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photoSize.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -117,13 +192,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photoSize = photoSize,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -134,23 +226,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
fileId,
|
photo = fileId,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
threadId,
|
spoilered = spoilered,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -162,13 +260,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
fileId = fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -176,15 +290,31 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.sendPhoto(
|
suspend inline fun TelegramBot.sendPhoto(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: Photo,
|
photo: PhotoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -192,15 +322,31 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.sendPhoto(
|
suspend inline fun TelegramBot.sendPhoto(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
photo: Photo,
|
photo: PhotoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photo = photo,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -210,13 +356,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chatId,
|
||||||
|
fileId = photoSize.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -226,10 +388,26 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
photoSize: PhotoSize,
|
photoSize: PhotoSize,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(
|
||||||
|
chatId = chat.id,
|
||||||
|
photoSize = photoSize,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
import dev.inmo.tgbotapi.types.files.Sticker
|
||||||
@@ -16,13 +17,15 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,12 +36,14 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -48,12 +53,14 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -63,9 +70,11 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -20,32 +21,38 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
text,
|
text = text,
|
||||||
parseMode,
|
parseMode = parseMode,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
null,
|
height = height,
|
||||||
threadId,
|
supportStreaming = null,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -58,13 +65,34 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chatId,
|
||||||
|
video = video.fileId,
|
||||||
|
thumb = video.thumbnail ?.fileId,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = video.duration,
|
||||||
|
width = video.width,
|
||||||
|
height = video.height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -76,16 +104,37 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
thumb = thumb,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,13 +146,30 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
text = text,
|
||||||
|
parseMode = parseMode,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -114,31 +180,37 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
video: InputFile,
|
video: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
video,
|
video = video,
|
||||||
thumb,
|
thumbnail = thumb,
|
||||||
entities,
|
entities = entities,
|
||||||
spoilered,
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
duration,
|
spoilered = spoilered,
|
||||||
width,
|
duration = duration,
|
||||||
height,
|
width = width,
|
||||||
null,
|
height = height,
|
||||||
threadId,
|
supportStreaming = null,
|
||||||
disableNotification,
|
threadId = threadId,
|
||||||
protectContent,
|
businessConnectionId = businessConnectionId,
|
||||||
replyParameters,
|
disableNotification = disableNotification,
|
||||||
replyMarkup
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -150,13 +222,33 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chatId,
|
||||||
|
video = video.fileId,
|
||||||
|
thumb = video.thumbnail ?.fileId,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = video.duration,
|
||||||
|
width = video.width,
|
||||||
|
height = video.height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -167,16 +259,36 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
video: InputFile,
|
video: InputFile,
|
||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
thumb = thumb,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
duration = duration,
|
||||||
|
width = width,
|
||||||
|
height = height,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,10 +299,26 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
spoilered: Boolean = false,
|
spoilered: Boolean = false,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(
|
||||||
|
chatId = chat.id,
|
||||||
|
video = video,
|
||||||
|
entities = entities,
|
||||||
|
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||||
|
spoilered = spoilered,
|
||||||
|
threadId = threadId,
|
||||||
|
businessConnectionId = businessConnectionId,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
||||||
@@ -19,8 +20,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -31,8 +34,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
duration,
|
duration,
|
||||||
size,
|
size,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -46,12 +51,14 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(
|
) = sendVideoNote(
|
||||||
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,11 +72,13 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -79,8 +88,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
@@ -21,8 +22,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -33,8 +36,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
parseMode,
|
parseMode,
|
||||||
duration,
|
duration,
|
||||||
threadId,
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -51,11 +56,13 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -67,12 +74,14 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,11 +94,13 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,21 +113,25 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVoice(
|
SendVoice(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
voice,
|
voice = voice,
|
||||||
entities,
|
entities = entities,
|
||||||
duration,
|
threadId = threadId,
|
||||||
threadId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
duration = duration,
|
||||||
protectContent,
|
disableNotification = disableNotification,
|
||||||
replyParameters,
|
protectContent = protectContent,
|
||||||
replyMarkup
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -130,11 +145,13 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -145,12 +162,14 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(
|
) = sendVoice(
|
||||||
chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -161,8 +180,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
|
|
||||||
suspend fun TelegramBot.createInvoiceLink(
|
suspend fun TelegramBot.createInvoiceLink(
|
||||||
title: String,
|
title: String,
|
||||||
@@ -29,3 +30,25 @@ suspend fun TelegramBot.createInvoiceLink(
|
|||||||
) = execute(
|
) = execute(
|
||||||
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For links witn XTR currency and using of Telegram Stars
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.createInvoiceLink(
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
prices: List<LabeledPrice>,
|
||||||
|
maxTipAmount: Int? = null,
|
||||||
|
suggestedTipAmounts: List<Int>? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
requireName: Boolean = false,
|
||||||
|
requirePhoneNumber: Boolean = false,
|
||||||
|
requireEmail: Boolean = false,
|
||||||
|
requireShippingAddress: Boolean = false,
|
||||||
|
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||||
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
|
priceDependOnShipAddress: Boolean = false
|
||||||
|
) = execute(
|
||||||
|
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||||
|
)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.payments
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.payments.RefundStarPayment
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.payments.SuccessfulPayment
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
|
||||||
|
|
||||||
|
suspend fun TelegramBot.refundStarPayment(
|
||||||
|
userId: UserId,
|
||||||
|
telegramPaymentChargeId: TelegramPaymentChargeId
|
||||||
|
) = execute(RefundStarPayment(userId, telegramPaymentChargeId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.refundStarPayment(
|
||||||
|
userId: UserId,
|
||||||
|
successfulPayment: SuccessfulPayment
|
||||||
|
) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId)
|
||||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -34,10 +35,11 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
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)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,6 +67,63 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = 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)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendInvoice(
|
||||||
|
chatId: IdChatIdentifier,
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
price: LabeledPrice,
|
||||||
|
startParameter: StartParameter? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendInvoice(chatId, title, description, payload, price, startParameter, providerData, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.sendInvoice(
|
||||||
|
user: CommonUser,
|
||||||
|
title: String,
|
||||||
|
description: String,
|
||||||
|
payload: String,
|
||||||
|
price: LabeledPrice,
|
||||||
|
startParameter: StartParameter? = null,
|
||||||
|
providerData: String? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
|
) = sendInvoice(
|
||||||
|
chatId = user.id,
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
payload = payload,
|
||||||
|
price = price,
|
||||||
|
startParameter = startParameter,
|
||||||
|
providerData = providerData,
|
||||||
|
threadId = null,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
effectId = effectId,
|
||||||
|
replyParameters = replyParameters,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,286 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send.polls
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
allowMultipleAnswers: Boolean = false,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
SendRegularPoll(
|
|
||||||
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
poll: RegularPoll,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
question: String = poll.question,
|
|
||||||
options: List<String> = poll.options.map { it.text },
|
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
allowMultipleAnswers: Boolean = false,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendRegularPoll(
|
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendRegularPoll(
|
|
||||||
chat: Chat,
|
|
||||||
poll: RegularPoll,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
question: String = poll.question,
|
|
||||||
options: List<String> = poll.options.map { it.text },
|
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendRegularPoll(
|
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
SendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
explanation: String? = null,
|
|
||||||
parseMode: ParseMode? = null,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = execute(
|
|
||||||
SendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
question: String,
|
|
||||||
options: List<String>,
|
|
||||||
correctOptionId: Int,
|
|
||||||
isAnonymous: Boolean = true,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, 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
|
|
||||||
*/
|
|
||||||
suspend inline fun TelegramBot.sendQuizPoll(
|
|
||||||
chat: Chat,
|
|
||||||
isClosed: Boolean = false,
|
|
||||||
quizPoll: QuizPoll,
|
|
||||||
question: String = quizPoll.question,
|
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
|
||||||
entities: TextSourcesList,
|
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
replyParameters: ReplyParameters? = null,
|
|
||||||
replyMarkup: KeyboardMarkup? = null
|
|
||||||
) = sendQuizPoll(
|
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,325 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanation,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanation: String?,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanation,
|
||||||
|
explanationParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendQuizPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendQuizPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
correctOptionId,
|
||||||
|
closeInfo,
|
||||||
|
explanationTextSources,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
|
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
questionParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
openPeriod: LongSeconds? = null,
|
||||||
|
closeDate: LongSeconds? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
openPeriod,
|
||||||
|
closeDate,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
question,
|
||||||
|
options,
|
||||||
|
closeInfo,
|
||||||
|
questionParseMode,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendRegularPoll(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionEntities: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = execute(
|
||||||
|
SendRegularPoll(
|
||||||
|
chatId,
|
||||||
|
questionEntities,
|
||||||
|
options,
|
||||||
|
closeInfo,
|
||||||
|
isAnonymous,
|
||||||
|
isClosed,
|
||||||
|
allowMultipleAnswers,
|
||||||
|
threadId,
|
||||||
|
businessConnectionId,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
effectId,
|
||||||
|
replyParameters,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||||
|
import dev.inmo.tgbotapi.types.StickerFormat
|
||||||
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.StickerType
|
import dev.inmo.tgbotapi.types.StickerType
|
||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
@@ -12,12 +14,18 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
|||||||
|
|
||||||
suspend fun TelegramBot.addStickerToSet(
|
suspend fun TelegramBot.addStickerToSet(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: String,
|
stickerSetName: StickerSetName,
|
||||||
inputSticker: InputSticker
|
inputSticker: InputSticker
|
||||||
) = execute(
|
) = execute(
|
||||||
AddStickerToSet(userId, stickerSetName, inputSticker)
|
AddStickerToSet(userId, stickerSetName, inputSticker)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.addStickerToSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSetName: String,
|
||||||
|
inputSticker: InputSticker
|
||||||
|
) = addStickerToSet(userId, StickerSetName(stickerSetName), inputSticker)
|
||||||
|
|
||||||
suspend fun TelegramBot.addStickerToSet(
|
suspend fun TelegramBot.addStickerToSet(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
@@ -32,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
keywords: List<String> = emptyList()
|
keywords: List<String> = emptyList()
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
@@ -40,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
when (stickerSet.stickerType) {
|
when (stickerSet.stickerType) {
|
||||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
keywords
|
keywords
|
||||||
)
|
)
|
||||||
StickerType.Mask -> InputSticker.Mask(
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis
|
emojis
|
||||||
)
|
)
|
||||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
keywords
|
keywords
|
||||||
)
|
)
|
||||||
@@ -60,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
maskPosition: MaskPosition? = null
|
maskPosition: MaskPosition? = null
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
@@ -68,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
when (stickerSet.stickerType) {
|
when (stickerSet.stickerType) {
|
||||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
StickerType.Mask -> InputSticker.Mask(
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
maskPosition
|
maskPosition
|
||||||
)
|
)
|
||||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
@@ -99,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
keywords: List<String> = emptyList()
|
keywords: List<String> = emptyList()
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
user.id, stickerSet, sticker, emojis, keywords
|
user.id, stickerSet, sticker, format, emojis, keywords
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.addStickerToSet(
|
suspend fun TelegramBot.addStickerToSet(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
maskPosition: MaskPosition? = null
|
maskPosition: MaskPosition? = null
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
user.id, stickerSet, sticker, emojis, maskPosition
|
user.id, stickerSet, sticker, format, emojis, maskPosition
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
name: String,
|
name: String,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean = false
|
needsRepainting: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting)
|
CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
name: String,
|
name: String,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean = false,
|
needsRepainting: Boolean = false,
|
||||||
) = createNewStickerSet(
|
) = createNewStickerSet(
|
||||||
user.id, name, title, stickersFormat, stickers, needsRepainting
|
user.id, name, title, stickers, needsRepainting
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||||
|
import dev.inmo.tgbotapi.requests.stickers.ReplaceStickerInSet
|
||||||
|
import dev.inmo.tgbotapi.types.StickerFormat
|
||||||
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
|
import dev.inmo.tgbotapi.types.StickerType
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
|
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSetName: StickerSetName,
|
||||||
|
oldSticker: FileId,
|
||||||
|
newSticker: InputSticker
|
||||||
|
) = execute(
|
||||||
|
ReplaceStickerInSet(userId, stickerSetName, oldSticker, newSticker)
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSetName: String,
|
||||||
|
oldSticker: FileId,
|
||||||
|
newSticker: InputSticker
|
||||||
|
) = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
newSticker: InputSticker
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
userId,
|
||||||
|
stickerSet.name,
|
||||||
|
oldSticker,
|
||||||
|
newSticker
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
|
emojis: List<String>,
|
||||||
|
keywords: List<String> = emptyList()
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
userId,
|
||||||
|
stickerSet,
|
||||||
|
oldSticker,
|
||||||
|
when (stickerSet.stickerType) {
|
||||||
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis,
|
||||||
|
keywords
|
||||||
|
)
|
||||||
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis
|
||||||
|
)
|
||||||
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis,
|
||||||
|
keywords
|
||||||
|
)
|
||||||
|
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
userId: UserId,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
|
emojis: List<String>,
|
||||||
|
maskPosition: MaskPosition? = null
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
userId,
|
||||||
|
stickerSet.name,
|
||||||
|
oldSticker,
|
||||||
|
when (stickerSet.stickerType) {
|
||||||
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis,
|
||||||
|
emptyList()
|
||||||
|
)
|
||||||
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis,
|
||||||
|
maskPosition
|
||||||
|
)
|
||||||
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
|
sticker,
|
||||||
|
format,
|
||||||
|
emojis,
|
||||||
|
emptyList()
|
||||||
|
)
|
||||||
|
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
user: CommonUser,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
newSticker: InputSticker
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
user.id,
|
||||||
|
stickerSet.name,
|
||||||
|
oldSticker,
|
||||||
|
newSticker
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
user: CommonUser,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
|
emojis: List<String>,
|
||||||
|
keywords: List<String> = emptyList()
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
user.id, stickerSet, oldSticker, sticker, format, emojis, keywords
|
||||||
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.replaceStickerInSet(
|
||||||
|
user: CommonUser,
|
||||||
|
stickerSet: StickerSet,
|
||||||
|
oldSticker: FileId,
|
||||||
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
|
emojis: List<String>,
|
||||||
|
maskPosition: MaskPosition? = null
|
||||||
|
) = replaceStickerInSet(
|
||||||
|
user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition
|
||||||
|
)
|
||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
||||||
|
import dev.inmo.tgbotapi.types.StickerFormat
|
||||||
import dev.inmo.tgbotapi.types.StickerSetName
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
@@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
|||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = execute(
|
) = execute(
|
||||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = execute(
|
) = execute(
|
||||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSetName, thumbnail
|
user.id, stickerSetName, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSetName, thumbnail
|
user.id, stickerSetName, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
userId, stickerSet.name, thumbnail
|
userId, stickerSet.name, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
userId, stickerSet.name, thumbnail
|
userId, stickerSet.name, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSet.name, thumbnail
|
user.id, stickerSet, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSet.name, thumbnail
|
user.id, stickerSet, format, thumbnail
|
||||||
)
|
)
|
||||||
1446
tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api
Normal file
1446
tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
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.ContextSafelyExceptionHandler
|
||||||
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.extensions.DefaultKTgBotAPIPrivacyCommand
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||||
import dev.inmo.tgbotapi.types.Seconds
|
import dev.inmo.tgbotapi.types.Seconds
|
||||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||||
|
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,6 +73,9 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
|||||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
|
if (!behaviourContext.triggersHolder.handleableCommandsHolder.isHandled(DefaultKTgBotAPIPrivacyCommand)) {
|
||||||
|
DefaultKTgBotAPIKSLog.e { "Currently, there are no any handling of \"$DefaultKTgBotAPIPrivacyCommand\" command. According to https://telegram.org/tos/bot-developers#4-privacy it may lead to bot deactivation or removing" }
|
||||||
|
}
|
||||||
return longPolling(
|
return longPolling(
|
||||||
behaviourContext,
|
behaviourContext,
|
||||||
scope = behaviourContext,
|
scope = behaviourContext,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder
|
|||||||
import dev.inmo.micro_utils.coroutines.*
|
import dev.inmo.micro_utils.coroutines.*
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||||
import dev.inmo.tgbotapi.types.UpdateIdentifier
|
import dev.inmo.tgbotapi.types.UpdateId
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import dev.inmo.tgbotapi.updateshandlers.*
|
import dev.inmo.tgbotapi.updateshandlers.*
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
@@ -72,7 +72,7 @@ class DefaultBehaviourContext(
|
|||||||
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
||||||
override val allUpdatesFlow: Flow<Update> = (additionalUpdatesSharedFlow.asSharedFlow()).let {
|
override val allUpdatesFlow: Flow<Update> = (additionalUpdatesSharedFlow.asSharedFlow()).let {
|
||||||
if (upstreamUpdatesFlow != null) {
|
if (upstreamUpdatesFlow != null) {
|
||||||
val handledUpdates = mutableSetOf<UpdateIdentifier>()
|
val handledUpdates = mutableSetOf<UpdateId>()
|
||||||
(it + upstreamUpdatesFlow).filter {
|
(it + upstreamUpdatesFlow).filter {
|
||||||
val passed = handledUpdates.add(it.updateId)
|
val passed = handledUpdates.add(it.updateId)
|
||||||
(passed).also { passed ->
|
(passed).also { passed ->
|
||||||
@@ -87,7 +87,7 @@ class DefaultBehaviourContext(
|
|||||||
} else {
|
} else {
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
}.accumulatorFlow(scope)
|
}.accumulatorFlow(WeakScope(scope))
|
||||||
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
||||||
|
|
||||||
override fun copy(
|
override fun copy(
|
||||||
@@ -133,38 +133,32 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
|||||||
/**
|
/**
|
||||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||||
*
|
*
|
||||||
* @param stopOnCompletion ___FALSE BY DEFAULT___. Will stop [this] in case if passed true
|
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||||
*/
|
*/
|
||||||
suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
||||||
stopOnCompletion: Boolean = false,
|
|
||||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||||
): T {
|
): T {
|
||||||
return withContext(coroutineContext) {
|
return withContext(coroutineContext) {
|
||||||
behaviourContextReceiver().also { if (stopOnCompletion) stop() }
|
behaviourContextReceiver()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
|
* Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context
|
||||||
* using [doInContext]
|
* using [doInContext]
|
||||||
*
|
|
||||||
* @param stopOnCompletion ___TRUE BY DEFAULT___
|
|
||||||
*/
|
*/
|
||||||
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter(
|
suspend fun <T, BC : BehaviourContext> BC.createSubContextAndDoWithUpdatesFilter(
|
||||||
scope: CoroutineScope = LinkedSupervisorScope(),
|
|
||||||
triggersHolder: TriggersHolder = this.triggersHolder,
|
triggersHolder: TriggersHolder = this.triggersHolder,
|
||||||
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
updatesUpstreamFlow: Flow<Update> = allUpdatesFlow,
|
||||||
stopOnCompletion: Boolean = true,
|
|
||||||
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
behaviourContextReceiver: CustomBehaviourContextReceiver<BC, T>
|
||||||
): T {
|
): T {
|
||||||
return createSubContext(
|
return supervisorScope {
|
||||||
scope,
|
createSubContext(
|
||||||
triggersHolder,
|
scope = this@supervisorScope,
|
||||||
updatesUpstreamFlow
|
triggersHolder = triggersHolder,
|
||||||
).doInContext(
|
updatesUpstreamFlow = updatesUpstreamFlow
|
||||||
stopOnCompletion,
|
).behaviourContextReceiver()
|
||||||
behaviourContextReceiver
|
}
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
|
|||||||
filter: suspend (Update) -> List<T>
|
filter: suspend (Update) -> List<T>
|
||||||
): Flow<T> {
|
): Flow<T> {
|
||||||
val flow = allUpdatesFlow.map {
|
val flow = allUpdatesFlow.map {
|
||||||
val result = safelyWithResult { filter(it) }
|
val result = runCatching {
|
||||||
|
filter(it)
|
||||||
|
}
|
||||||
if (result.isFailure || result.getOrThrow().isEmpty()) {
|
if (result.isFailure || result.getOrThrow().isEmpty()) {
|
||||||
if (cancelTrigger(it)) {
|
if (cancelTrigger(it)) {
|
||||||
cancelRequestFactory(it) ?.also {
|
cancelRequestFactory(it) ?.also {
|
||||||
@@ -47,14 +49,20 @@ suspend fun <T> FlowsUpdatesFilter.expectFlow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
errorFactory(it) ?.also { errorRequest ->
|
errorFactory(it) ?.also { errorRequest ->
|
||||||
safelyWithoutExceptions { bot.execute(errorRequest) }
|
runCatching {
|
||||||
|
bot.execute(errorRequest)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
emptyList()
|
emptyList()
|
||||||
} else {
|
} else {
|
||||||
result.getOrThrow()
|
result.getOrThrow()
|
||||||
}
|
}
|
||||||
}.flatten()
|
}.flatten()
|
||||||
initRequest ?.also { safelyWithoutExceptions { bot.execute(initRequest) } }
|
initRequest ?.also {
|
||||||
|
runCatching {
|
||||||
|
bot.execute(initRequest)
|
||||||
|
}
|
||||||
|
}
|
||||||
return flow
|
return flow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.businessConnectionUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.disabledOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.enabledOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||||
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitBusinessConnection(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
): Flow<BusinessConnection> = expectFlow(
|
||||||
|
initRequest,
|
||||||
|
errorFactory
|
||||||
|
) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitBusinessConnectionEnabled(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
): Flow<BusinessConnection> = expectFlow(
|
||||||
|
initRequest,
|
||||||
|
errorFactory
|
||||||
|
) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()).let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitBusinessConnectionDisabled(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
): Flow<BusinessConnection> = expectFlow(
|
||||||
|
initRequest,
|
||||||
|
errorFactory
|
||||||
|
) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()).let(::listOfNotNull)
|
||||||
|
}
|
||||||
@@ -148,3 +148,8 @@ suspend fun BehaviourContext.waitGiveawayPublicResultsContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<GiveawayPublicResultsContent>()
|
) = waitContent(initRequest, errorFactory).mapContent<GiveawayPublicResultsContent>()
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitPaidMediaInfoContent(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitContent(initRequest, errorFactory).mapContent<PaidMediaInfoContent>()
|
||||||
|
|||||||
@@ -159,3 +159,8 @@ suspend fun BehaviourContext.waitGiveawayPublicResultsContentMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<GiveawayPublicResultsContent>()
|
) = waitContentMessage(initRequest, errorFactory).mapWithContent<GiveawayPublicResultsContent>()
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitPaidMediaInfoContentMessage(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitContentMessage(initRequest, errorFactory).mapWithContent<PaidMediaInfoContent>()
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessMessagesDeleted
|
||||||
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitDeletedBusinessMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
): Flow<BusinessMessagesDeleted> = expectFlow(
|
||||||
|
initRequest,
|
||||||
|
errorFactory
|
||||||
|
) {
|
||||||
|
(it.deletedBusinessMessageUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||||
|
}
|
||||||
@@ -13,131 +13,118 @@ import kotlinx.coroutines.flow.map
|
|||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContent(
|
suspend inline fun <reified O : MessageContent> BehaviourContext.waitEditedContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
includeMediaGroups: Boolean = true,
|
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
): Flow<O> = waitEditedContentMessage<O>(initRequest, errorFactory).map { it.content }
|
): Flow<O> = waitEditedContentMessage<O>(initRequest, errorFactory).map { it.content }
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedMessageContent(
|
suspend fun BehaviourContext.waitEditedMessageContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<MessageContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<MessageContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedContentMessage(
|
suspend fun BehaviourContext.waitEditedContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<MessageContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<MessageContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedContact(
|
suspend fun BehaviourContext.waitEditedContact(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<ContactContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<ContactContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedDice(
|
suspend fun BehaviourContext.waitEditedDice(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<DiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<DiceContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedGame(
|
suspend fun BehaviourContext.waitEditedGame(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<GameContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<GameContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedLocation(
|
suspend fun BehaviourContext.waitEditedLocation(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<LocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<LocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedLiveLocation(
|
suspend fun BehaviourContext.waitEditedLiveLocation(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<LiveLocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<LiveLocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedStaticLocation(
|
suspend fun BehaviourContext.waitEditedStaticLocation(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<StaticLocationContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<StaticLocationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedText(
|
suspend fun BehaviourContext.waitEditedText(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<TextContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<TextContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVenue(
|
suspend fun BehaviourContext.waitEditedVenue(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<VenueContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<VenueContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAudioMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedAudioMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<AudioMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedDocumentMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<DocumentMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedMedia(
|
suspend fun BehaviourContext.waitEditedMedia(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
) = waitEditedContent<MediaContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<MediaContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedAnyMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedAnyMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<MediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<MediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedVisualMediaGroupContent(
|
suspend fun BehaviourContext.waitEditedVisualMediaGroupContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<VisualMediaGroupPartContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedTextedMediaContent(
|
suspend fun BehaviourContext.waitEditedTextedMediaContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = true
|
) = waitEditedContent<TextedMediaContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<TextedMediaContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedAnimation(
|
suspend fun BehaviourContext.waitEditedAnimation(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<AnimationContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<AnimationContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAudio(
|
suspend fun BehaviourContext.waitEditedAudio(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
) = waitEditedContent<AudioContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<AudioContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedDocument(
|
suspend fun BehaviourContext.waitEditedDocument(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
) = waitEditedContent<DocumentContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<DocumentContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedPhoto(
|
suspend fun BehaviourContext.waitEditedPhoto(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
) = waitEditedContent<PhotoContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<PhotoContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedSticker(
|
suspend fun BehaviourContext.waitEditedSticker(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<StickerContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<StickerContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVideo(
|
suspend fun BehaviourContext.waitEditedVideo(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
) = waitEditedContent<VideoContent>(initRequest, errorFactory)
|
||||||
) = waitEditedContent<VideoContent>(initRequest, includeMediaGroups, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitEditedVideoNote(
|
suspend fun BehaviourContext.waitEditedVideoNote(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<VideoNoteContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<VideoNoteContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVoice(
|
suspend fun BehaviourContext.waitEditedVoice(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<VoiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<VoiceContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedInvoice(
|
suspend fun BehaviourContext.waitEditedInvoice(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<InvoiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<InvoiceContent>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayContent(
|
suspend fun BehaviourContext.waitEditedGiveawayContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<GiveawayContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<GiveawayContent>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayPublicResultsContent(
|
suspend fun BehaviourContext.waitEditedGiveawayPublicResultsContent(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<GiveawayPublicResultsContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<GiveawayPublicResultsContent>(initRequest, errorFactory)
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ suspend fun BehaviourContext.waitEditedDocumentMediaGroupContentMessage(
|
|||||||
suspend fun BehaviourContext.waitEditedMediaMessage(
|
suspend fun BehaviourContext.waitEditedMediaMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
|
||||||
) = waitEditedContentMessage<MediaContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<MediaContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedAnyMediaGroupContentMessage(
|
suspend fun BehaviourContext.waitEditedAnyMediaGroupContentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
@@ -102,17 +101,14 @@ suspend fun BehaviourContext.waitEditedAnimationMessage(
|
|||||||
suspend fun BehaviourContext.waitEditedAudioMessage(
|
suspend fun BehaviourContext.waitEditedAudioMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
|
||||||
) = waitEditedContentMessage<AudioContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<AudioContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedDocumentMessage(
|
suspend fun BehaviourContext.waitEditedDocumentMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
|
||||||
) = waitEditedContentMessage<DocumentContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<DocumentContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedPhotoMessage(
|
suspend fun BehaviourContext.waitEditedPhotoMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
|
||||||
) = waitEditedContentMessage<PhotoContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<PhotoContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedStickerMessage(
|
suspend fun BehaviourContext.waitEditedStickerMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
@@ -121,7 +117,6 @@ suspend fun BehaviourContext.waitEditedStickerMessage(
|
|||||||
suspend fun BehaviourContext.waitEditedVideoMessage(
|
suspend fun BehaviourContext.waitEditedVideoMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
includeMediaGroups: Boolean = false
|
|
||||||
) = waitEditedContentMessage<VideoContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<VideoContent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitEditedVideoNoteMessage(
|
suspend fun BehaviourContext.waitEditedVideoNoteMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
@@ -16,6 +17,7 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidde
|
|||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||||
import dev.inmo.tgbotapi.types.request.ChatShared
|
import dev.inmo.tgbotapi.types.request.ChatShared
|
||||||
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||||
@@ -139,6 +141,10 @@ suspend fun BehaviourContext.waitSuccessfulPaymentEvents(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<SuccessfulPaymentEvent>(initRequest, errorFactory)
|
) = waitEvents<SuccessfulPaymentEvent>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitRefundedPaymentEvents(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<RefundedPaymentEvent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitUserLoggedInEvents(
|
suspend fun BehaviourContext.waitUserLoggedInEvents(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
@@ -219,3 +225,8 @@ suspend fun BehaviourContext.waitChatBoostAdded(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
|
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitChatBackgroundSet(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEvents<ChatBackground>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
|
||||||
@@ -16,6 +17,7 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidde
|
|||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||||
import dev.inmo.tgbotapi.types.request.ChatShared
|
import dev.inmo.tgbotapi.types.request.ChatShared
|
||||||
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||||
@@ -136,6 +138,10 @@ suspend fun BehaviourContext.waitSuccessfulPaymentEventsMessages(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<SuccessfulPaymentEvent>(initRequest, errorFactory)
|
) = waitEventsMessages<SuccessfulPaymentEvent>(initRequest, errorFactory)
|
||||||
|
suspend fun BehaviourContext.waitRefundedPaymentEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<RefundedPaymentEvent>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitUserLoggedInEventsMessages(
|
suspend fun BehaviourContext.waitUserLoggedInEventsMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
@@ -213,3 +219,8 @@ suspend fun BehaviourContext.waitChatBoostAddedEventsMessages(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
|
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
|
||||||
|
|
||||||
|
suspend fun BehaviourContext.waitChatBackgroundSetEventsMessages(
|
||||||
|
initRequest: Request<*>? = null,
|
||||||
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
|
) = waitEventsMessages<ChatBackground>(initRequest, errorFactory)
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBusinessConnectionUpdatedMarkerFactory
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.businessConnectionUpdateOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.disabledOrNull
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.enabledOrNull
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||||
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onBusinessConnection(
|
||||||
|
initialFilter: SimpleFilter<BusinessConnection>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in BusinessConnection, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection>
|
||||||
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionEnabled(
|
||||||
|
initialFilter: SimpleFilter<BusinessConnection.Enabled>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Enabled, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in BusinessConnection.Enabled, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Enabled>
|
||||||
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()) ?.let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
|
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
|
* to combinate several filters
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
|
* data
|
||||||
|
*/
|
||||||
|
suspend fun <BC : BehaviourContext> BC.onBusinessConnectionDisabled(
|
||||||
|
initialFilter: SimpleFilter<BusinessConnection.Disabled>? = null,
|
||||||
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BusinessConnection.Disabled, Update>? = null,
|
||||||
|
markerFactory: MarkerFactory<in BusinessConnection.Disabled, Any>? = ByUserBusinessConnectionUpdatedMarkerFactory,
|
||||||
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BusinessConnection.Disabled>
|
||||||
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
|
(it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()) ?.let(::listOfNotNull)
|
||||||
|
}
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import kotlinx.coroutines.Job
|
|||||||
internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery(
|
internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> BC.onCallbackQuery(
|
||||||
initialFilter: SimpleFilter<T>? = null,
|
initialFilter: SimpleFilter<T>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
(it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
@@ -31,15 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : CallbackQuery> B
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted(
|
internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuery> BC.onDataCallbackQueryCounted(
|
||||||
initialFilter: SimpleFilter<T>? = null,
|
initialFilter: SimpleFilter<T>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in T, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
): Job {
|
): Job {
|
||||||
val newInitialFilter = SimpleFilter<DataCallbackQuery> {
|
val newInitialFilter = SimpleFilter<DataCallbackQuery> {
|
||||||
@@ -73,15 +74,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : DataCallbackQuer
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
||||||
) = onDataCallbackQueryCounted(
|
) = onDataCallbackQueryCounted(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -99,8 +101,9 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -108,7 +111,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
dataRegex: Regex,
|
dataRegex: Regex,
|
||||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
||||||
) = onDataCallbackQuery(
|
) = onDataCallbackQuery(
|
||||||
initialFilter = initialFilter * {
|
initialFilter = initialFilter * {
|
||||||
@@ -127,8 +130,9 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -136,7 +140,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
data: String,
|
data: String,
|
||||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
||||||
) = onDataCallbackQuery(
|
) = onDataCallbackQuery(
|
||||||
Regex(data),
|
Regex(data),
|
||||||
@@ -153,15 +157,16 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery(
|
||||||
initialFilter: SimpleFilter<GameShortNameCallbackQuery>? = null,
|
initialFilter: SimpleFilter<GameShortNameCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in GameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in GameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameShortNameCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameShortNameCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -177,15 +182,16 @@ suspend fun <BC : BehaviourContext> BC.onGameShortNameCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
|
||||||
initialFilter: SimpleFilter<InlineMessageIdCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -201,15 +207,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onDataCallbackQueryCounted(
|
) = onDataCallbackQueryCounted(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -227,8 +234,9 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -236,7 +244,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
dataRegex: Regex,
|
dataRegex: Regex,
|
||||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onInlineMessageIdDataCallbackQuery(
|
) = onInlineMessageIdDataCallbackQuery(
|
||||||
initialFilter = initialFilter * {
|
initialFilter = initialFilter * {
|
||||||
@@ -255,8 +263,9 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +273,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
data: String,
|
data: String,
|
||||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onInlineMessageIdDataCallbackQuery(
|
) = onInlineMessageIdDataCallbackQuery(
|
||||||
Regex(data),
|
Regex(data),
|
||||||
@@ -281,15 +290,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQuery(
|
||||||
initialFilter: SimpleFilter<InlineMessageIdGameShortNameCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdGameShortNameCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdGameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdGameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdGameShortNameCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdGameShortNameCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -305,15 +315,16 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdGameShortNameCallbackQue
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
|
||||||
initialFilter: SimpleFilter<MessageCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -329,15 +340,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
||||||
) = onDataCallbackQueryCounted(
|
) = onDataCallbackQueryCounted(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -355,8 +367,9 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -364,7 +377,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
dataRegex: Regex,
|
dataRegex: Regex,
|
||||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
||||||
) = onMessageDataCallbackQuery(
|
) = onMessageDataCallbackQuery(
|
||||||
initialFilter = initialFilter * {
|
initialFilter = initialFilter * {
|
||||||
@@ -383,8 +396,9 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -392,7 +406,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
data: String,
|
data: String,
|
||||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
||||||
) = onMessageDataCallbackQuery(
|
) = onMessageDataCallbackQuery(
|
||||||
Regex(data),
|
Regex(data),
|
||||||
@@ -409,15 +423,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
|
||||||
initialFilter: SimpleFilter<MessageGameShortNameCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageGameShortNameCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageGameShortNameCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageGameShortNameCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageGameShortNameCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageGameShortNameCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageGameShortNameCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -433,15 +448,16 @@ suspend fun <BC : BehaviourContext> BC.onMessageGameShortNameCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType(
|
suspend fun <BC : BehaviourContext> BC.onUnknownCallbackQueryType(
|
||||||
initialFilter: SimpleFilter<UnknownCallbackQueryType>? = null,
|
initialFilter: SimpleFilter<UnknownCallbackQueryType>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, UnknownCallbackQueryType, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, UnknownCallbackQueryType, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in UnknownCallbackQueryType, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in UnknownCallbackQueryType, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, UnknownCallbackQueryType>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, UnknownCallbackQueryType>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -27,7 +28,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature
|
|||||||
suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<DataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in DataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
|
||||||
) = onCallbackQuery (
|
) = onCallbackQuery (
|
||||||
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
||||||
@@ -43,8 +44,9 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -52,7 +54,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledDataCallbackQuery(
|
|||||||
suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<InlineMessageIdDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InlineMessageIdDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onCallbackQuery (
|
) = onCallbackQuery (
|
||||||
initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
||||||
@@ -68,8 +70,9 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
@@ -77,7 +80,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
|
|||||||
suspend fun <BC : BehaviourContext> BC.onUnhandledMessageDataCallbackQuery(
|
suspend fun <BC : BehaviourContext> BC.onUnhandledMessageDataCallbackQuery(
|
||||||
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
initialFilter: SimpleFilter<MessageDataCallbackQuery>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageDataCallbackQuery, Update>? = CallbackQueryFilterByUser,
|
||||||
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any>? = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
|
||||||
) = onCallbackQuery(
|
) = onCallbackQuery(
|
||||||
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
||||||
|
|||||||
@@ -19,15 +19,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatBoostRemoved(
|
suspend fun <BC : BehaviourContext> BC.onChatBoostRemoved(
|
||||||
initialFilter: SimpleFilter<ChatBoostRemoved>? = null,
|
initialFilter: SimpleFilter<ChatBoostRemoved>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostRemoved, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostRemoved, Update>? = null,
|
||||||
markerFactory: MarkerFactory<ChatBoostRemoved, Any> = ByIdChatBoostRemovedMarkerFactory,
|
markerFactory: MarkerFactory<ChatBoostRemoved, Any>? = ByIdChatBoostRemovedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostRemoved>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostRemoved>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
(it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
|
|||||||
@@ -19,15 +19,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatBoostUpdated(
|
suspend fun <BC : BehaviourContext> BC.onChatBoostUpdated(
|
||||||
initialFilter: SimpleFilter<ChatBoostUpdated>? = null,
|
initialFilter: SimpleFilter<ChatBoostUpdated>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostUpdated, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostUpdated, Update>? = null,
|
||||||
markerFactory: MarkerFactory<ChatBoostUpdated, Any> = ByIdChatBoostUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatBoostUpdated, Any>? = ByIdChatBoostUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostUpdated>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostUpdated>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
(it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
|
|||||||
@@ -17,15 +17,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatJoinRequest(
|
suspend fun <BC : BehaviourContext> BC.onChatJoinRequest(
|
||||||
initialFilter: SimpleFilter<ChatJoinRequest>? = null,
|
initialFilter: SimpleFilter<ChatJoinRequest>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatJoinRequest, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatJoinRequest, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in ChatJoinRequest, Any> = ByChatChatJoinRequestMarkerFactory,
|
markerFactory: MarkerFactory<in ChatJoinRequest, Any>? = ByChatChatJoinRequestMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatJoinRequest>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
(it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatMemberUpdatedFilterByChat
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatMemberUpdatedFilterByChat
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatMemberUpdatedMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatMemberUpdatedMarkerFactory
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBusinessConnectionUpdatedMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||||
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
||||||
@@ -16,7 +17,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdatedUpdate> BC.onChatMemberUpdatedInternal(
|
internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdatedUpdate> BC.onChatMemberUpdatedInternal(
|
||||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
((it as? U) ?.data) ?.let(::listOfNotNull)
|
((it as? U) ?.data) ?.let(::listOfNotNull)
|
||||||
@@ -30,15 +31,16 @@ internal suspend inline fun <BC : BehaviourContext, reified U : ChatMemberUpdate
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated(
|
suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated(
|
||||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
||||||
) = onChatMemberUpdatedInternal<BC, ChatMemberUpdatedUpdate>(
|
) = onChatMemberUpdatedInternal<BC, ChatMemberUpdatedUpdate>(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -54,15 +56,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMemberUpdated(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated(
|
suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated(
|
||||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
||||||
) = onChatMemberUpdatedInternal<BC, CommonChatMemberUpdatedUpdate>(
|
) = onChatMemberUpdatedInternal<BC, CommonChatMemberUpdatedUpdate>(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -78,15 +81,16 @@ suspend fun <BC : BehaviourContext> BC.onCommonChatMemberUpdated(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMyChatMemberUpdated(
|
suspend fun <BC : BehaviourContext> BC.onMyChatMemberUpdated(
|
||||||
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
initialFilter: SimpleFilter<ChatMemberUpdated>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMemberUpdated, Update>? = ChatMemberUpdatedFilterByChat,
|
||||||
markerFactory: MarkerFactory<ChatMemberUpdated, Any> = ByChatChatMemberUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatMemberUpdated, Any>? = ByChatChatMemberUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMemberUpdated>
|
||||||
) = onChatMemberUpdatedInternal<BC, MyChatMemberUpdatedUpdate>(
|
) = onChatMemberUpdatedInternal<BC, MyChatMemberUpdatedUpdate>(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
|
|||||||
@@ -23,15 +23,16 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionsCountUpdated(
|
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionsCountUpdated(
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionsCountUpdated>? = null,
|
initialFilter: SimpleFilter<ChatMessageReactionsCountUpdated>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionsCountUpdated, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionsCountUpdated, Update>? = null,
|
||||||
markerFactory: MarkerFactory<ChatMessageReactionsCountUpdated, Any> = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<ChatMessageReactionsCountUpdated, Any>? = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionsCountUpdated>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionsCountUpdated>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
(it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReactionUpdated> BC.onChatMessageReactionUpdated(
|
internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReactionUpdated> BC.onChatMessageReactionUpdated(
|
||||||
initialFilter: SimpleFilter<T>? = null,
|
initialFilter: SimpleFilter<T>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in T, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
@@ -28,15 +28,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReact
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser(
|
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser(
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByUser>? = null,
|
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByUser>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByUser, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByUser, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByUser, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByUser, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByUser>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByUser>
|
||||||
) = onChatMessageReactionUpdated(
|
) = onChatMessageReactionUpdated(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -52,15 +53,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByUser(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
|
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByChat>? = null,
|
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByChat>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByChat, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByChat, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByChat, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByChat, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByChat>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByChat>
|
||||||
) = onChatMessageReactionUpdated(
|
) = onChatMessageReactionUpdated(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -76,15 +78,16 @@ suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedUnknown(
|
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedUnknown(
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.Unknown>? = null,
|
initialFilter: SimpleFilter<ChatMessageReactionUpdated.Unknown>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.Unknown, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.Unknown, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.Unknown, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.Unknown, Any>? = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.Unknown>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.Unknown>
|
||||||
) = onChatMessageReactionUpdated(
|
) = onChatMessageReactionUpdated(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResult> BC.onChosenInlineResultBase(
|
internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResult> BC.onChosenInlineResultBase(
|
||||||
initialFilter: SimpleFilter<T>? = null,
|
initialFilter: SimpleFilter<T>? = null,
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in T, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
markerFactory: MarkerFactory<in T, Any>? = ByUserIdChosenInlineResultMarkerFactory,
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||||
(it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
(it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull)
|
||||||
@@ -26,15 +26,16 @@ internal suspend inline fun <BC : BehaviourContext, reified T : ChosenInlineResu
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onChosenInlineResult(
|
suspend fun <BC : BehaviourContext> BC.onChosenInlineResult(
|
||||||
initialFilter: SimpleFilter<ChosenInlineResult>? = null,
|
initialFilter: SimpleFilter<ChosenInlineResult>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChosenInlineResult, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChosenInlineResult, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in ChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
markerFactory: MarkerFactory<in ChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChosenInlineResult>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChosenInlineResult>
|
||||||
) = onChosenInlineResultBase(
|
) = onChosenInlineResultBase(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -50,15 +51,16 @@ suspend fun <BC : BehaviourContext> BC.onChosenInlineResult(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult(
|
suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult(
|
||||||
initialFilter: SimpleFilter<LocationChosenInlineResult>? = null,
|
initialFilter: SimpleFilter<LocationChosenInlineResult>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationChosenInlineResult, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationChosenInlineResult, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in LocationChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
markerFactory: MarkerFactory<in LocationChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationChosenInlineResult>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationChosenInlineResult>
|
||||||
) = onChosenInlineResultBase(
|
) = onChosenInlineResultBase(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
@@ -74,15 +76,16 @@ suspend fun <BC : BehaviourContext> BC.onLocationChosenInlineResult(
|
|||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||||
* to combinate several filters
|
* to combinate several filters
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onBaseChosenInlineResult(
|
suspend fun <BC : BehaviourContext> BC.onBaseChosenInlineResult(
|
||||||
initialFilter: SimpleFilter<BaseChosenInlineResult>? = null,
|
initialFilter: SimpleFilter<BaseChosenInlineResult>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseChosenInlineResult, Update>? = null,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BaseChosenInlineResult, Update>? = null,
|
||||||
markerFactory: MarkerFactory<in BaseChosenInlineResult, Any> = ByUserIdChosenInlineResultMarkerFactory,
|
markerFactory: MarkerFactory<in BaseChosenInlineResult, Any>? = ByUserIdChosenInlineResultMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseChosenInlineResult>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BaseChosenInlineResult>
|
||||||
) = onChosenInlineResultBase(
|
) = onChosenInlineResultBase(
|
||||||
initialFilter,
|
initialFilter,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ internal suspend fun <BC : BehaviourContext> BC.commandUncounted(
|
|||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onText(
|
): Job = onText(
|
||||||
CommonMessageFilter<TextContent> { message ->
|
CommonMessageFilter<TextContent> { message ->
|
||||||
@@ -52,7 +52,7 @@ suspend fun <BC : BehaviourContext> BC.command(
|
|||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = runCatchingSafely {
|
): Job = runCatchingSafely {
|
||||||
commandUncounted(
|
commandUncounted(
|
||||||
@@ -76,56 +76,86 @@ suspend fun <BC : BehaviourContext> BC.command(
|
|||||||
}
|
}
|
||||||
}.getOrThrow()
|
}.getOrThrow()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.command(
|
suspend fun <BC : BehaviourContext> BC.command(
|
||||||
command: String,
|
command: String,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.command(
|
suspend fun <BC : BehaviourContext> BC.command(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||||
command: String,
|
command: String,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommand(
|
suspend fun <BC : BehaviourContext> BC.onCommand(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = command(
|
) = command(
|
||||||
@@ -142,11 +172,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
scenarioReceiver(it, args)
|
scenarioReceiver(it, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||||
command: String,
|
command: String,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
@@ -158,11 +193,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
@@ -174,11 +214,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
@@ -196,11 +241,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
scenarioReceiver(it, args)
|
scenarioReceiver(it, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||||
command: String,
|
command: String,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
@@ -214,11 +264,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
@@ -232,11 +287,16 @@ suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = commandWithArgs(
|
): Job = commandWithArgs(
|
||||||
@@ -248,11 +308,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
command: String,
|
command: String,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(
|
||||||
@@ -264,11 +329,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(
|
||||||
@@ -280,11 +350,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
@@ -298,11 +373,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
scenarioReceiver = scenarioReceiver,
|
scenarioReceiver = scenarioReceiver,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||||
command: String,
|
command: String,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
@@ -316,11 +396,16 @@ suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
|
|||||||
@@ -16,12 +16,17 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun <BC : BehaviourContext> BC.unhandledCommand(
|
suspend fun <BC : BehaviourContext> BC.unhandledCommand(
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onText(
|
): Job = onText(
|
||||||
CommonMessageFilter<TextContent> { message ->
|
CommonMessageFilter<TextContent> { message ->
|
||||||
@@ -44,20 +49,30 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommand(
|
|||||||
scenarioReceiver
|
scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun <BC : BehaviourContext> BC.onUnhandledCommand(
|
suspend fun <BC : BehaviourContext> BC.onUnhandledCommand(
|
||||||
requireOnlyCommandInMessage: Boolean = true,
|
requireOnlyCommandInMessage: Boolean = true,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
|
||||||
) = onUnhandledCommand(
|
) = onUnhandledCommand(
|
||||||
requireOnlyCommandInMessage = false,
|
requireOnlyCommandInMessage = false,
|
||||||
@@ -71,10 +86,15 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
|
|||||||
scenarioReceiver(it, args)
|
scenarioReceiver(it, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
|
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||||
|
* "stream"
|
||||||
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun <BC : BehaviourContext> BC.onUnhandledCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onUnhandledCommandWithArgs(
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Map<String, Array<String>>>
|
||||||
): Job = unhandledCommandWithArgs(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = unhandledCommandWithArgs(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user