mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-20 06:15:49 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71001b772a | |||
| 449f7f836f |
3
.github/workflows/greetings.yml
vendored
3
.github/workflows/greetings.yml
vendored
@@ -5,9 +5,6 @@ on: [pull_request, issues]
|
|||||||
jobs:
|
jobs:
|
||||||
greeting:
|
greeting:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/kdocs.yml
vendored
2
.github/workflows/kdocs.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 11
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew dokkaHtmlMultiModule
|
run: ./gradlew dokkaHtmlMultiModule
|
||||||
- name: Publish KDocs
|
- name: Publish KDocs
|
||||||
|
|||||||
11
.github/workflows/packages_publishing.yml
vendored
11
.github/workflows/packages_publishing.yml
vendored
@@ -7,9 +7,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 11
|
||||||
- name: Setup LibCurl
|
- name: Setup LibCurl
|
||||||
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
|
run: sudo apt install -y libcurl4-openssl-dev
|
||||||
- name: Rewrite version
|
- name: Rewrite version
|
||||||
run: |
|
run: |
|
||||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||||
@@ -20,14 +20,11 @@ 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 Gitea
|
- name: Publish to Gitea
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
run: ./gradlew publishAllPublicationsToGiteaRepository
|
||||||
env:
|
env:
|
||||||
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
|
||||||
- name: Publish to GithubPackages
|
- name: Publish to GithubPackages
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
|
|||||||
160
CHANGELOG.md
160
CHANGELOG.md
@@ -1,167 +1,9 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
## 10.1.2
|
## 8.1.1
|
||||||
|
|
||||||
* `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
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Serialization`: `1.6.2` -> `1.6.3`
|
|
||||||
* `MicroUtils`: `0.20.34` -> `0.20.37`
|
|
||||||
* `Korlibs`: `5.3.1` -> `5.3.2`
|
|
||||||
|
|
||||||
## 10.1.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.1](https://core.telegram.org/bots/api-changelog#february-16-2024)**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.7.3` -> `1.8.0`
|
|
||||||
* `MicroUtils`: `0.20.32` -> `0.20.34`
|
|
||||||
|
|
||||||
## 10.0.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Ktor`: `2.3.7` -> `2.3.8`
|
|
||||||
* `MicroUtils`: `0.20.26` -> `0.20.32`
|
|
||||||
* `Korlibs`: `5.3.0` -> `5.3.1`
|
|
||||||
* `KSLog`: `1.3.1` -> `1.3.2`
|
|
||||||
|
|
||||||
## 10.0.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.0](https://core.telegram.org/bots/api-changelog#december-29-2023)**
|
|
||||||
|
|
||||||
**IN THIS UPDATE KLOCK DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-time` UP TO 5.3.0 VERSION**
|
|
||||||
|
|
||||||
**IN THIS UPDATE KRYPTO DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-crypto` UP TO 5.3.0 VERSION**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `MicroUtils`: `0.20.23` -> `0.20.26`
|
|
||||||
* `Korlibs`: `4.0.10` -> `5.3.0`
|
|
||||||
* `Core`:
|
|
||||||
* `Message` now inherited by two variants: `AccessibleMessage` and `InaccessibleMessage`
|
|
||||||
* `Common`:
|
|
||||||
* In most places `disableWebPagePreview` has been replaced by new `LinkPreviewOptions`
|
|
||||||
* In most places arguments `replyToMessageId` and `allowSendingWithoutReply` has been replaced with
|
|
||||||
`ReplyParameters`
|
|
||||||
* In `reply` extension two parameters have been added: `replyInChatId` and `replyInThreadId`
|
|
||||||
|
|
||||||
## 9.4.3
|
|
||||||
|
|
||||||
**IetfLanguageCode has been renamed to IetfLang in MicroUtils**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.21` -> `1.9.22`
|
|
||||||
* `MicroUtils`: `0.20.19` -> `0.20.23`
|
|
||||||
|
|
||||||
## 9.4.2
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Serialization`: `1.6.1` -> `1.6.2`
|
|
||||||
* `Ktor`: `2.3.6` -> `2.3.7`
|
|
||||||
* `MicroUtils`: `0.20.15` -> `0.20.19`
|
|
||||||
* `UUID`: `0.8.1` -> `0.8.2`
|
|
||||||
|
|
||||||
## 9.4.1
|
|
||||||
|
|
||||||
* Replace warning about two bots from `LongPolling` to `DefaultKtorRequestsExecutor`
|
|
||||||
|
|
||||||
## 9.4.0
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.20` -> `1.9.21`
|
|
||||||
* `Serialization`: `1.6.0` -> `1.6.1`
|
|
||||||
* `Ktor`: `2.3.5` -> `2.3.6`
|
|
||||||
* `MicroUtils`: `0.20.12` -> `0.20.15`
|
|
||||||
|
|
||||||
## 9.3.0
|
|
||||||
|
|
||||||
This release become possible thanks to [Anton Lakotka](https://youtrack.jetbrains.com/users/anton.lakotka)
|
|
||||||
|
|
||||||
**THIS RELEASE CONTAINS UPDATES UP TO RELEASE CANDIDATES VERSIONS**
|
|
||||||
|
|
||||||
**UPDATE MAY HAVE BREAKING CHANGES**
|
|
||||||
|
|
||||||
**SINCE THIS UPDATE IT WILL BE REQUIRED TO USE JDK 17+ FOR DEVELOPMENT**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.8.22` -> `1.9.20`
|
|
||||||
* `Serialization`: `1.5.1` -> `1.6.0`
|
|
||||||
* `KorLibs`: `4.0.3` -> `4.0.10`
|
|
||||||
* `UUID`: `0.7.1` -> `0.8.1`
|
|
||||||
* `Ktor`: `2.3.4` -> `2.3.5`
|
|
||||||
* `MicroUtils`: `0.19.9` -> `0.20.12`
|
|
||||||
|
|
||||||
## 9.2.4
|
|
||||||
|
|
||||||
* `Utils`:
|
|
||||||
* New extensions `*.parseCommandsWithNamedArgs`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* In expectaters and triggers of `commands` add `*WithNamedArgs` variants
|
|
||||||
* In expectaters and triggers of `commands` add opportunity to use custom separator
|
|
||||||
|
|
||||||
## 9.2.3
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix in `VoiceContent#createResend`
|
|
||||||
|
|
||||||
## 9.2.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix of [#793](https://github.com/InsanusMokrassar/ktgbotapi/issues/793): Add `PreviewChat`
|
|
||||||
|
|
||||||
## 9.2.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Ktor`: `2.3.3` -> `2.3.4`
|
|
||||||
* `Core`:
|
|
||||||
* All `ChatMember` inheritors have fixes `status` field
|
|
||||||
|
|
||||||
## 9.2.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 6.9](https://core.telegram.org/bots/api-changelog#september-22-2023)**
|
|
||||||
|
|
||||||
* Rename `ChatAdministratorRightsImpl` -> `ChatCommonAdministratorRights`
|
|
||||||
* All the request chat keyboards has changed their parameters `ChatAdministratorRights` to `ChatCommonAdministratorRights`
|
|
||||||
|
|
||||||
## 9.1.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix of `MessageContent` serialization
|
|
||||||
|
|
||||||
## 9.1.1
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Potential fix of incorrect parsing in `RawMessageEntity`
|
|
||||||
|
|
||||||
## 9.1.0
|
|
||||||
|
|
||||||
**This update contains adding of [Telegram Bot API 6.8](https://core.telegram.org/bots/api-changelog#august-18-2023) support**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.7.2` -> `1.7.3`
|
|
||||||
* `Ktor`: `2.3.2` -> `2.3.3`
|
|
||||||
* `MicroUtils`: `0.19.7` -> `0.19.9`
|
|
||||||
|
|
||||||
## 9.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES: USERNAMES OF BOTS NOW BECAME NULLABLE**
|
**THIS UPDATE CONTAINS BREAKING CHANGES: USERNAMES OF BOTS NOW BECAME NULLABLE**
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.6.4` -> `1.7.1`
|
|
||||||
* `Ktor`: `2.3.1` -> `2.3.2`
|
|
||||||
* `MicroUtils`: `0.19.4` -> `0.19.7`
|
|
||||||
* `Core`:
|
|
||||||
* **All bots now have nullable usernames just like common users ([#772](https://github.com/InsanusMokrassar/ktgbotapi/issues/772))**
|
|
||||||
* Decrease possible errors in updates handling by additional handling of update deserialization wrapping ([#773](https://github.com/InsanusMokrassar/ktgbotapi/issues/773))
|
|
||||||
* New interface `GetUpdatesRequest`. You may implement it to show default telegram bot ktor executor that this
|
|
||||||
request is an updates request and should be handled in a different way
|
|
||||||
* Now it is possible to get raw updates with `GetUpdatesRaw` request
|
|
||||||
* `Utils`:
|
* `Utils`:
|
||||||
* Improve extension `Update.sourceChat` to add opportunity to select some chats by logic different with the default
|
* Improve extension `Update.sourceChat` to add opportunity to select some chats by logic different with the default
|
||||||
|
|
||||||
|
|||||||
@@ -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#april-21-2023)
|
||||||
|
|
||||||
| 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) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
@@ -118,5 +118,5 @@ suspend fun main() {
|
|||||||
### More examples
|
### More examples
|
||||||
|
|
||||||
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
||||||
always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and
|
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
|
||||||
[chat](https://t.me/InMoTelegramBotAPIChat).
|
[chat](https://t.me/InMoTelegramBotAPIChat).
|
||||||
|
|||||||
16
build.gradle
16
build.gradle
@@ -16,8 +16,6 @@ buildscript {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin.dokka)
|
alias(libs.plugins.kotlin.dokka)
|
||||||
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
|
||||||
@@ -26,7 +24,7 @@ allprojects {
|
|||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
maven { url "https://git.inmo.dev/api/packages/InsanusMokrassar/maven" }
|
||||||
}
|
}
|
||||||
if (it != rootProject.findProject("docs")) {
|
if (it != rootProject.findProject("docs")) {
|
||||||
tasks.whenTaskAdded { task ->
|
tasks.whenTaskAdded { task ->
|
||||||
@@ -55,13 +53,13 @@ if (new File(projectDir, "secret.gradle").exists()) {
|
|||||||
githubRelease {
|
githubRelease {
|
||||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||||
|
|
||||||
owner = "InsanusMokrassar"
|
owner "InsanusMokrassar"
|
||||||
repo = "TelegramBotAPI"
|
repo "TelegramBotAPI"
|
||||||
|
|
||||||
tagName = "v$library_version"
|
tagName "v$library_version"
|
||||||
releaseName = "$library_version"
|
releaseName "$library_version"
|
||||||
targetCommitish = "$library_version"
|
targetCommitish "$library_version"
|
||||||
|
|
||||||
body = getCurrentVersionChangelog()
|
body getCurrentVersionChangelog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ Object callback = {
|
|||||||
skipDeprecated.set(true)
|
skipDeprecated.set(true)
|
||||||
|
|
||||||
sourceLink {
|
sourceLink {
|
||||||
localDirectory.set(file("../"))
|
localDirectory.set(file("./"))
|
||||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi/tree/master"))
|
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"))
|
||||||
remoteLineSuffix.set("#L")
|
remoteLineSuffix.set("#L")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.2
|
library_version=8.1.1
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.9.23"
|
kotlin = "1.8.22"
|
||||||
kotlin-serialization = "1.6.3"
|
kotlin-serialization = "1.5.1"
|
||||||
kotlin-coroutines = "1.8.0"
|
kotlin-coroutines = "1.7.2"
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.4.0"
|
korlibs = "4.0.3"
|
||||||
uuid = "0.8.2"
|
uuid = "0.7.1"
|
||||||
ktor = "2.3.9"
|
ktor = "2.3.2"
|
||||||
|
|
||||||
ksp = "1.9.23-1.0.19"
|
ksp = "1.8.22-1.0.11"
|
||||||
kotlin-poet = "1.16.0"
|
kotlin-poet = "1.14.2"
|
||||||
|
|
||||||
microutils = "0.20.39"
|
microutils = "0.19.7"
|
||||||
kslog = "1.3.3"
|
|
||||||
|
|
||||||
versions = "0.51.0"
|
github-release-plugin = "2.4.1"
|
||||||
|
dokka = "1.8.20"
|
||||||
github-release-plugin = "2.5.2"
|
|
||||||
dokka = "1.9.20"
|
|
||||||
|
|
||||||
validator = "0.14.0"
|
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -43,12 +38,11 @@ ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.
|
|||||||
|
|
||||||
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
|
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
|
||||||
|
|
||||||
korlibs-klock = { module = "com.soywiz.korge:korlibs-time", version.ref = "korlibs" }
|
korlibs-klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "korlibs" }
|
||||||
korlibs-krypto = { module = "com.soywiz.korge:korlibs-crypto", version.ref = "korlibs" }
|
korlibs-krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "korlibs" }
|
||||||
|
|
||||||
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
|
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
|
||||||
|
|
||||||
microutils-colors-common = { module = "dev.inmo:micro_utils.colors.common", version.ref = "microutils" }
|
|
||||||
microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" }
|
microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" }
|
||||||
microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" }
|
microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" }
|
||||||
microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" }
|
microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" }
|
||||||
@@ -58,8 +52,6 @@ microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", ver
|
|||||||
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
||||||
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
||||||
|
|
||||||
kslog = { module = "dev.inmo:kslog", version.ref = "kslog" }
|
|
||||||
|
|
||||||
# ksp dependencies
|
# ksp dependencies
|
||||||
|
|
||||||
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
||||||
@@ -79,5 +71,3 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
|||||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||||
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" }
|
|
||||||
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-7.6.1-bin.zip
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ kotlin {
|
|||||||
jvm {
|
jvm {
|
||||||
compilations.main {
|
compilations.main {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "17"
|
jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@ kotlin {
|
|||||||
}
|
}
|
||||||
linuxX64()
|
linuxX64()
|
||||||
mingwX64()
|
mingwX64()
|
||||||
linuxArm64()
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
||||||
@@ -41,18 +40,10 @@ kotlin {
|
|||||||
implementation libs.kotlin.test.junit
|
implementation libs.kotlin.test.junit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
all {
|
|
||||||
languageSettings {
|
|
||||||
optIn('dev.inmo.tgbotapi.utils.RiskFeature')
|
|
||||||
optIn('dev.inmo.tgbotapi.utils.PreviewFeature')
|
|
||||||
optIn('dev.inmo.micro_utils.common.Warning')
|
|
||||||
optIn('dev.inmo.micro_utils.common.PreviewFeature')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
task javadocsJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
archiveClassifier = 'javadoc'
|
archiveClassifier.convention("javadoc")
|
||||||
|
archiveClassifier.set("javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@@ -19,22 +20,22 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
|
|
||||||
developer {
|
developer {
|
||||||
id = "InsanusMokrassar"
|
id = "InsanusMokrassar"
|
||||||
name = "Ovsiannikov Aleksei"
|
name = "Ovsiannikov Aleksei"
|
||||||
email = "ovsyannikov.alexey95@gmail.com"
|
email = "ovsyannikov.alexey95@gmail.com"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
|
|
||||||
license {
|
license {
|
||||||
name = "Apache Software License 2.0"
|
name = "Apache Software License 2.0"
|
||||||
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
@@ -42,77 +43,58 @@ publishing {
|
|||||||
maven {
|
maven {
|
||||||
name = "GithubPackages"
|
name = "GithubPackages"
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
||||||
|
|
||||||
credentials {
|
credentials {
|
||||||
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
||||||
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
if (project.hasProperty('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
|
||||||
maven {
|
maven {
|
||||||
name = "InmoNexus"
|
name = "Gitea"
|
||||||
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
|
||||||
|
|
||||||
credentials {
|
credentials(HttpHeaderCredentials) {
|
||||||
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
name = "Authorization"
|
||||||
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authentication {
|
||||||
|
header(HttpHeaderAuthentication)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
maven {
|
maven {
|
||||||
name = "sonatype"
|
name = "sonatype"
|
||||||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
|
||||||
credentials {
|
credentials {
|
||||||
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
useGpgCmd()
|
useGpgCmd()
|
||||||
|
|
||||||
sign publishing.publications
|
sign publishing.publications
|
||||||
}
|
}
|
||||||
|
|
||||||
task signAll {
|
task signAll {
|
||||||
tasks.withType(Sign).forEach {
|
tasks.withType(Sign).forEach {
|
||||||
dependsOn(it)
|
dependsOn(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround to make android sign operations depend on signing tasks
|
|
||||||
project.getTasks().withType(AbstractPublishToMaven.class).configureEach {
|
|
||||||
def signingTasks = project.getTasks().withType(Sign.class)
|
|
||||||
mustRunAfter(signingTasks)
|
|
||||||
}
|
|
||||||
// Workaround to make test tasks use sign
|
|
||||||
project.getTasks().withType(Sign.class).configureEach { signTask ->
|
|
||||||
def withoutSign = (signTask.name.startsWith("sign") ? signTask.name.minus("sign") : signTask.name)
|
|
||||||
def pubName = withoutSign.endsWith("Publication") ? withoutSign.substring(0, withoutSign.length() - "Publication".length()) : withoutSign
|
|
||||||
// These tasks only exist for native targets, hence findByName() to avoid trying to find them for other targets
|
|
||||||
|
|
||||||
// Task ':linkDebugTest<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
|
||||||
def debugTestTask = tasks.findByName("linkDebugTest$pubName")
|
|
||||||
if (debugTestTask != null) {
|
|
||||||
signTask.mustRunAfter(debugTestTask)
|
|
||||||
}
|
|
||||||
// Task ':compileTestKotlin<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
|
||||||
def testTask = tasks.findByName("compileTestKotlin$pubName")
|
|
||||||
if (testTask != null) {
|
|
||||||
signTask.mustRunAfter(testTask)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/TelegramBotAPI"},{"name":"Gitea","url":"https://git.inmo.dev/api/packages/InsanusMokrassar/maven","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.HttpHeaderCredentials","headerName":"Authorization","headerValueProperty":"GITEA_TOKEN"}},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -16,9 +16,6 @@ kotlin {
|
|||||||
api project(":tgbotapi.core")
|
api project(":tgbotapi.core")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
configureEach {
|
|
||||||
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -22,7 +23,7 @@ suspend fun TelegramBot.deleteMessage(
|
|||||||
) = deleteMessage(chat.id, messageId)
|
) = deleteMessage(chat.id, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
message: AccessibleMessage
|
message: Message
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
||||||
if (mediaGroupContent == null) {
|
if (mediaGroupContent == null) {
|
||||||
@@ -45,9 +46,9 @@ suspend fun TelegramBot.delete(
|
|||||||
) = deleteMessage(chat, messageId)
|
) = deleteMessage(chat, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
message: AccessibleMessage
|
message: Message
|
||||||
) = deleteMessage(message)
|
) = deleteMessage(message)
|
||||||
|
|
||||||
suspend fun AccessibleMessage.delete(
|
suspend fun Message.delete(
|
||||||
requestsExecutor: TelegramBot
|
requestsExecutor: TelegramBot
|
||||||
) = requestsExecutor.deleteMessage(this)
|
) = requestsExecutor.deleteMessage(this)
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.DeleteMessages
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>
|
|
||||||
) = messageIds.chunked(deleteMessagesLimit.last).map {
|
|
||||||
execute(
|
|
||||||
DeleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = it
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}.all { it }
|
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>
|
|
||||||
) = deleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
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(
|
|
||||||
messagesMetas: List<Message.MetaInfo>
|
|
||||||
) = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
|
||||||
deleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = messages.map { it.messageId }
|
|
||||||
)
|
|
||||||
}.all { it }
|
|
||||||
|
|
||||||
@JvmName("deleteMessagesWithMessages")
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
|
||||||
messages: List<AccessibleMessage>
|
|
||||||
) = deleteMessages(messages.map { it.metaInfo })
|
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>
|
|
||||||
) = deleteMessages(chatId = chatId, messageIds = messageIds)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>
|
|
||||||
) = 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(
|
|
||||||
messagesMetas: List<Message.MetaInfo>
|
|
||||||
) = deleteMessages(messagesMetas)
|
|
||||||
|
|
||||||
@JvmName("deleteWithMessages")
|
|
||||||
suspend fun TelegramBot.delete(
|
|
||||||
messages: List<AccessibleMessage>
|
|
||||||
) = deleteMessages(messages)
|
|
||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
@@ -49,7 +49,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
@@ -57,7 +57,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
|
|||||||
@@ -1,193 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.copyMessages
|
|
||||||
import dev.inmo.tgbotapi.requests.ForwardMessages
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = messageIds.chunked(forwardMessagesLimit.last).flatMap {
|
|
||||||
execute(
|
|
||||||
ForwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = it,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds.toList(),
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
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(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) ->
|
|
||||||
forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = chatId,
|
|
||||||
messageIds = messages.map { it.messageId },
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@JvmName("forwardMessagesWithMessages")
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messages.map { it.metaInfo },
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
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(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messagesMetas,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
@JvmName("forwardWithMessages")
|
|
||||||
suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messages = messages,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.GetUpdates
|
|
||||||
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
|
|
||||||
suspend fun TelegramBot.getRawUpdates(
|
|
||||||
offset: UpdateIdentifier? = null,
|
|
||||||
limit: Int = getUpdatesLimit.last,
|
|
||||||
timeout: Seconds? = null,
|
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
|
||||||
) = execute(
|
|
||||||
GetUpdatesRaw(
|
|
||||||
offset, limit, timeout, allowed_updates
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.getRawUpdates(
|
|
||||||
lastUpdate: Update,
|
|
||||||
limit: Int = getUpdatesLimit.last,
|
|
||||||
timeout: Seconds? = null,
|
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
|
||||||
) = getRawUpdates(
|
|
||||||
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
|
||||||
)
|
|
||||||
@@ -44,7 +44,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
@@ -70,7 +71,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
sentMessageFlow ?.emit(it)
|
sentMessageFlow ?.emit(it)
|
||||||
@@ -104,7 +106,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
@@ -123,7 +126,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
sentMessageFlow
|
sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -141,7 +145,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
@@ -156,7 +161,8 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
sentMessageFlow
|
sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,24 +2,38 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
|
|
||||||
import korlibs.time.DateTime
|
import korlibs.time.DateTime
|
||||||
import korlibs.time.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
||||||
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.edit.edit
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||||
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.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||||
import io.ktor.utils.io.core.Closeable
|
import io.ktor.utils.io.core.Closeable
|
||||||
import korlibs.time.millisecondsLong
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.CoroutineStart
|
||||||
|
import kotlinx.coroutines.currentCoroutineContext
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.map
|
||||||
|
import kotlinx.coroutines.isActive
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlin.js.JsName
|
||||||
|
import kotlin.jvm.JvmName
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
||||||
@@ -96,7 +110,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
||||||
@@ -112,7 +127,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -141,7 +157,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -155,7 +172,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -174,7 +192,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -188,7 +207,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -207,7 +227,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -221,7 +242,8 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -230,7 +252,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
@@ -255,7 +277,8 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
to.messageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -264,7 +287,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
@@ -287,6 +310,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
to.messageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.StopPoll
|
|||||||
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.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
) = stopPoll(chatId, message.messageId, replyMarkup)
|
||||||
|
|
||||||
@@ -45,6 +45,6 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
@@ -8,10 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.deleteMyCommands(
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
) = execute(DeleteMyCommands(scope, languageCode))
|
) = execute(DeleteMyCommands(scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMyCommands(
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
) = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
|
) = deleteMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
@@ -8,10 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(GetMyCommands(scope, languageCode))
|
) = execute(GetMyCommands(scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyCommands(scope, languageCode ?.let(::IetfLang))
|
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
||||||
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDescription(
|
suspend fun TelegramBot.getMyDescription(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(GetMyDescription(languageCode))
|
) = execute(GetMyDescription(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDescription(
|
suspend fun TelegramBot.getMyDescription(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyDescription(languageCode ?.let(::IetfLang))
|
) = getMyDescription(languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
||||||
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyName(
|
suspend fun TelegramBot.getMyName(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(GetMyName(languageCode))
|
) = execute(GetMyName(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyName(
|
suspend fun TelegramBot.getMyName(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyName(languageCode ?.let(::IetfLang))
|
) = getMyName(languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyShortDescription
|
import dev.inmo.tgbotapi.requests.bot.GetMyShortDescription
|
||||||
@@ -8,9 +8,9 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
|||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyShortDescription(
|
suspend fun TelegramBot.getMyShortDescription(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(GetMyShortDescription(languageCode))
|
) = execute(GetMyShortDescription(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyShortDescription(
|
suspend fun TelegramBot.getMyShortDescription(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyShortDescription(languageCode ?.let(::IetfLang))
|
) = getMyShortDescription(languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
@@ -10,20 +10,20 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
) = execute(SetMyCommands(commands, scope, languageCode))
|
) = execute(SetMyCommands(commands, scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
) = setMyCommands(commands.toList(), scope, languageCode)
|
) = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
|
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
||||||
rights: ChatCommonAdministratorRights,
|
rights: ChatAdministratorRightsImpl,
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatAdministratorRightsImpl
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatAdministratorRightsImpl
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
||||||
@@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.setMyDescription(
|
suspend fun TelegramBot.setMyDescription(
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(SetMyDescription(description, languageCode))
|
) = execute(SetMyDescription(description, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDescription(
|
suspend fun TelegramBot.setMyDescription(
|
||||||
description: String?,
|
description: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyDescription(description, languageCode ?.let(::IetfLang))
|
) = setMyDescription(description, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
||||||
@@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.setMyName(
|
suspend fun TelegramBot.setMyName(
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(SetMyName(name, languageCode))
|
) = execute(SetMyName(name, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyName(
|
suspend fun TelegramBot.setMyName(
|
||||||
name: String?,
|
name: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyName(name, languageCode ?.let(::IetfLang))
|
) = setMyName(name, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyShortDescription(
|
suspend fun TelegramBot.setMyShortDescription(
|
||||||
shortDescription: String? = null,
|
shortDescription: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(SetMyShortDescription(shortDescription, languageCode))
|
) = execute(SetMyShortDescription(shortDescription, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyShortDescription(
|
suspend fun TelegramBot.setMyShortDescription(
|
||||||
shortDescription: String?,
|
shortDescription: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
|
) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllForumTopicMessages
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllGeneralForumTopicMessages
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
) = execute(
|
|
||||||
UnpinAllGeneralForumTopicMessages(
|
|
||||||
chatId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
|
||||||
chat: Chat
|
|
||||||
) = unpinAllGeneralForumTopicMessages(chat.id)
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChannelAdministrator
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canPostMessages: Boolean? = null,
|
|
||||||
canEditMessages: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = execute(
|
|
||||||
PromoteChannelAdministrator(
|
|
||||||
chatId = chatId,
|
|
||||||
userId = userId,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canPostMessages = canPostMessages,
|
|
||||||
canEditMessages = canEditMessages,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canPostMessages: Boolean? = null,
|
|
||||||
canEditMessages: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChannelAdministrator(
|
|
||||||
chat.id,
|
|
||||||
userId,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canPostMessages = canPostMessages,
|
|
||||||
canEditMessages = canEditMessages,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
|
||||||
chatId: IdChatIdentifier,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canPostMessages: Boolean? = null,
|
|
||||||
canEditMessages: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChannelAdministrator(
|
|
||||||
chatId,
|
|
||||||
user.id,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canPostMessages = canPostMessages,
|
|
||||||
canEditMessages = canEditMessages,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canPostMessages: Boolean? = null,
|
|
||||||
canEditMessages: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChannelAdministrator(
|
|
||||||
chat.id,
|
|
||||||
user.id,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canPostMessages = canPostMessages,
|
|
||||||
canEditMessages = canEditMessages,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
) = execute(
|
|
||||||
PromoteChatMember(
|
|
||||||
chatId,
|
|
||||||
userId,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
) = promoteChatAdministrator(
|
|
||||||
chat.id,
|
|
||||||
userId,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
|
||||||
chatId: IdChatIdentifier,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
) = promoteChatAdministrator(
|
|
||||||
chatId,
|
|
||||||
user.id,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
) = promoteChatAdministrator(
|
|
||||||
chat.id,
|
|
||||||
user.id,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
import dev.inmo.micro_utils.common.Warning
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
@@ -23,34 +24,27 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = execute(
|
) = execute(
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId = chatId,
|
chatId,
|
||||||
userId = userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
@@ -66,32 +60,25 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
@@ -107,32 +94,25 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
@@ -148,27 +128,21 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteSupergroupAdministrator
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPinMessages: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canManageTopics: Boolean? = null,
|
|
||||||
) = execute(
|
|
||||||
PromoteSupergroupAdministrator(
|
|
||||||
chatId = chatId,
|
|
||||||
userId = userId,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPinMessages = canPinMessages,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canManageTopics = canManageTopics
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
userId: UserId,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPinMessages: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canManageTopics: Boolean? = null,
|
|
||||||
) = promoteSupergroupAdministrator(
|
|
||||||
chat.id,
|
|
||||||
userId,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPinMessages = canPinMessages,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canManageTopics = canManageTopics
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|
||||||
chatId: IdChatIdentifier,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPinMessages: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canManageTopics: Boolean? = null,
|
|
||||||
) = promoteSupergroupAdministrator(
|
|
||||||
chatId,
|
|
||||||
user.id,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPinMessages = canPinMessages,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canManageTopics = canManageTopics
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|
||||||
chat: PublicChat,
|
|
||||||
user: User,
|
|
||||||
untilDate: TelegramDate? = null,
|
|
||||||
isAnonymous: Boolean? = null,
|
|
||||||
canChangeInfo: Boolean? = null,
|
|
||||||
canDeleteMessages: Boolean? = null,
|
|
||||||
canInviteUsers: Boolean? = null,
|
|
||||||
canRestrictMembers: Boolean? = null,
|
|
||||||
canPinMessages: Boolean? = null,
|
|
||||||
canPromoteMembers: Boolean? = null,
|
|
||||||
canManageVideoChats: Boolean? = null,
|
|
||||||
canManageChat: Boolean? = null,
|
|
||||||
canManageTopics: Boolean? = null,
|
|
||||||
) = promoteSupergroupAdministrator(
|
|
||||||
chat.id,
|
|
||||||
user.id,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPinMessages = canPinMessages,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canManageTopics = canManageTopics
|
|
||||||
)
|
|
||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -20,6 +20,6 @@ suspend fun TelegramBot.pinChatMessage(
|
|||||||
) = pinChatMessage(chat.id, messageId, disableNotification)
|
) = pinChatMessage(chat.id, messageId, disableNotification)
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = pinChatMessage(message.chat.id, message.messageId, disableNotification)
|
) = pinChatMessage(message.chat.id, message.messageId, disableNotification)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -18,5 +18,5 @@ suspend fun TelegramBot.unpinChatMessage(
|
|||||||
) = unpinChatMessage(chat.id, messageId)
|
) = unpinChatMessage(chat.id, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
message: AccessibleMessage
|
message: Message
|
||||||
) = unpinChatMessage(message.chat.id, message.messageId)
|
) = unpinChatMessage(message.chat.id, message.messageId)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.location.LiveLocation
|
|||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
||||||
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.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
@@ -181,7 +181,7 @@ suspend fun TelegramBot.edit(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message, replyMarkup)
|
) = editMessageReplyMarkup(message, replyMarkup)
|
||||||
|
|
||||||
@@ -194,9 +194,9 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -206,9 +206,9 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -218,10 +218,10 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -231,10 +231,10 @@ suspend fun TelegramBot.edit(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -244,9 +244,9 @@ suspend fun TelegramBot.edit(
|
|||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -255,9 +255,9 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = edit(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -266,10 +266,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -278,10 +278,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -290,10 +290,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -302,7 +302,7 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ suspend fun TelegramBot.edit(
|
|||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -85,9 +85,9 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -96,10 +96,10 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageIdentifier,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -108,7 +108,7 @@ suspend fun TelegramBot.edit(
|
|||||||
suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageIdentifier,
|
messageId: InlineMessageIdentifier,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
|||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaContent
|
import dev.inmo.tgbotapi.types.message.content.MediaContent
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ 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: Message,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -35,7 +35,7 @@ suspend fun TelegramBot.editMessageReplyMarkup(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup)
|
) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup)
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,13 @@ 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.EditChatMessageText
|
import dev.inmo.tgbotapi.requests.edit.text.EditChatMessageText
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.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.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.utils.*
|
import dev.inmo.tgbotapi.utils.*
|
||||||
@@ -24,10 +23,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,9 +38,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -51,9 +50,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -63,10 +62,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
EditChatMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,10 +76,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -90,10 +89,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -103,9 +102,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -115,10 +114,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -128,10 +127,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -140,9 +139,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -151,10 +150,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -163,10 +162,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -174,11 +173,11 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -186,12 +185,12 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -199,9 +198,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
*/
|
*/
|
||||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not text message this method will throw an exception")
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = 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), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ 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.InlineMessageIdentifier
|
||||||
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
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
@@ -19,9 +18,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, disableWebPagePreview, replyMarkup))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -30,9 +29,9 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, entities, linkPreviewOptions, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, entities, disableWebPagePreview, replyMarkup))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -41,10 +40,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -53,7 +52,7 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.get
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.get.GetUserChatBoosts
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
suspend fun TelegramBot.getUserChatBoosts(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
userId: UserId
|
|
||||||
) = execute(
|
|
||||||
GetUserChatBoosts(chatId = chatId, userId = userId)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.getUserChatBoosts(
|
|
||||||
chat: Chat,
|
|
||||||
userId: UserId
|
|
||||||
) = getUserChatBoosts(chatId = chat.id, userId = userId)
|
|
||||||
@@ -2,12 +2,15 @@ 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.CopyMessage
|
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -22,7 +25,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(
|
CopyMessage(
|
||||||
@@ -34,7 +38,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -52,9 +57,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -69,9 +75,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -86,9 +93,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +111,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(
|
CopyMessage(
|
||||||
@@ -114,7 +123,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -131,9 +141,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -147,9 +158,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -163,9 +175,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -173,15 +186,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -189,15 +203,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -205,14 +220,15 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -220,14 +236,15 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -242,7 +259,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(
|
CopyMessage(
|
||||||
@@ -254,7 +272,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -272,7 +291,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChatId,
|
toChatId,
|
||||||
@@ -283,7 +303,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -300,7 +321,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChat.id,
|
toChat.id,
|
||||||
@@ -311,7 +333,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -328,7 +351,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChat.id,
|
toChat.id,
|
||||||
@@ -339,7 +363,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -356,7 +381,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(
|
CopyMessage(
|
||||||
@@ -367,7 +393,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -384,7 +411,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChatId,
|
toChatId,
|
||||||
@@ -394,7 +422,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -410,7 +439,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChat.id,
|
toChat.id,
|
||||||
@@ -420,7 +450,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -436,7 +467,8 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(
|
) = copyMessage(
|
||||||
toChat.id,
|
toChat.id,
|
||||||
@@ -446,6 +478,7 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,192 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.send.CopyMessages
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = messageIds.chunked(copyMessagesLimit.last).flatMap {
|
|
||||||
execute(
|
|
||||||
CopyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = it,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds.toList(),
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
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(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) ->
|
|
||||||
copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = chatId,
|
|
||||||
messageIds = messages.map { it.messageId },
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@JvmName("copyMessagesWithMessages")
|
|
||||||
suspend fun TelegramBot.copyMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messages.map { it.metaInfo },
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copy(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.copy(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
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(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messagesMetas,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
@JvmName("copyWithMessages")
|
|
||||||
suspend fun TelegramBot.copy(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
) = copyMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messages = messages,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,14 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will send [content] to the [chatId] as is
|
* This method will send [content] to the [chatId] as is
|
||||||
@@ -16,7 +19,8 @@ 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,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
content.createResend(
|
content.createResend(
|
||||||
@@ -24,7 +28,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
) as ContentMessage<T>
|
) as ContentMessage<T>
|
||||||
@@ -38,7 +43,8 @@ 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,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
@@ -46,7 +52,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -61,7 +68,8 @@ 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,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
@@ -69,7 +77,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -84,7 +93,8 @@ 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,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = resend(
|
) = resend(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
@@ -92,6 +102,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||||||
messageThreadId = messageThreadId,
|
messageThreadId = messageThreadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -36,11 +37,12 @@ suspend fun TelegramBot.sendContact(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendContact(
|
SendContact(
|
||||||
chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -56,10 +58,11 @@ suspend fun TelegramBot.sendContact(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,8 +75,9 @@ suspend fun TelegramBot.sendContact(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
chat.id, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ 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.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -17,10 +20,11 @@ suspend fun TelegramBot.sendDice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,6 +37,7 @@ suspend fun TelegramBot.sendDice(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendLiveLocation(
|
SendLiveLocation(
|
||||||
@@ -36,7 +37,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -55,7 +57,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chatId,
|
chatId,
|
||||||
@@ -68,7 +71,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -87,7 +91,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -100,7 +105,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -118,7 +124,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -131,7 +138,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -150,9 +158,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -168,9 +177,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -187,9 +197,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -205,6 +216,7 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -19,22 +19,24 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendTextMessage(
|
SendTextMessage(
|
||||||
chatId,
|
chatId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
linkPreviewOptions,
|
disableWebPagePreview,
|
||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -47,14 +49,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,13 +68,14 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,13 +86,14 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -97,14 +102,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendTextMessage(chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,14 +120,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,14 +138,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -147,14 +155,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(
|
) = sendMessage(
|
||||||
chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,14 +173,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -181,14 +191,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -197,13 +208,14 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendMessage(chat.id, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -212,14 +224,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,14 +242,15 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendMessage(
|
suspend fun TelegramBot.sendMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,13 +260,14 @@ suspend fun TelegramBot.sendMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendTextMessage(chat.id, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
@@ -261,14 +276,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -278,11 +294,12 @@ suspend fun TelegramBot.sendTextMessage(
|
|||||||
suspend fun TelegramBot.sendTextMessage(
|
suspend fun TelegramBot.sendTextMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
separator: String,
|
separator: String,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ 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.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -18,7 +21,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendStaticLocation(
|
SendStaticLocation(
|
||||||
@@ -28,7 +32,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyToMessageId = replyToMessageId,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -43,7 +48,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chatId,
|
chatId,
|
||||||
@@ -52,7 +58,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -67,7 +74,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -76,7 +84,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -90,7 +99,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
chat.id,
|
chat.id,
|
||||||
@@ -99,7 +109,8 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -114,9 +125,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -128,9 +140,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = 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, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -143,9 +156,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -157,6 +171,7 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyToMessageId: MessageId? = 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, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVenue(
|
SendVenue(
|
||||||
@@ -41,7 +42,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -63,7 +65,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
@@ -78,7 +81,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -98,7 +102,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
@@ -113,7 +118,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -133,7 +139,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
@@ -148,7 +155,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -162,7 +170,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVenue(
|
SendVenue(
|
||||||
@@ -171,7 +180,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -186,7 +196,8 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chatId = chat.id,
|
chatId = chat.id,
|
||||||
@@ -194,6 +205,7 @@ suspend fun TelegramBot.sendVenue(
|
|||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent = protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters = replyParameters,
|
replyToMessageId = replyToMessageId,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,122 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.send.SetMessageReactions
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import dev.inmo.tgbotapi.types.reactions.Reaction
|
|
||||||
import kotlin.js.JsName
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageId: MessageId,
|
|
||||||
reactions: List<Reaction> = emptyList(),
|
|
||||||
big: Boolean = false
|
|
||||||
) = execute(
|
|
||||||
SetMessageReactions(chatId, messageId, reactions, big)
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageId: MessageId,
|
|
||||||
reaction: Reaction? = null,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(chatId, messageId, listOfNotNull(reaction), big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
chat: Chat,
|
|
||||||
messageId: MessageId,
|
|
||||||
reactions: List<Reaction> = emptyList(),
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(chat.id, messageId, reactions, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
chat: Chat,
|
|
||||||
messageId: MessageId,
|
|
||||||
reaction: Reaction? = null,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(chat.id, messageId, reaction, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
meta: Message.MetaInfo,
|
|
||||||
reactions: List<Reaction> = emptyList(),
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(meta.chatId, meta.messageId, reactions, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
meta: Message.MetaInfo,
|
|
||||||
reaction: Reaction? = null,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(meta.chatId, meta.messageId, reaction, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
message: AccessibleMessage,
|
|
||||||
reactions: List<Reaction> = emptyList(),
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(message.metaInfo, reactions, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
message: AccessibleMessage,
|
|
||||||
reaction: Reaction? = null,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(message.metaInfo, reaction, big)
|
|
||||||
|
|
||||||
@JvmName("setMessageReactionsStrings")
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageId: MessageId,
|
|
||||||
emojis: List<String>,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(chatId, messageId, emojis.map { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageId: MessageId,
|
|
||||||
emoji: String?,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(chatId, messageId, emoji ?.let { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
@JvmName("setMessageReactionsStrings")
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
chat: Chat,
|
|
||||||
messageId: MessageId,
|
|
||||||
emojis: List<String>,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(chat, messageId, emojis.map { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
chat: Chat,
|
|
||||||
messageId: MessageId,
|
|
||||||
emoji: String?,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(chat, messageId, emoji ?.let { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
@JvmName("setMessageReactionsStrings")
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
meta: Message.MetaInfo,
|
|
||||||
emojis: List<String>,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(meta, emojis.map { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
meta: Message.MetaInfo,
|
|
||||||
emoji: String?,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(meta, emoji ?.let { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
@JvmName("setMessageReactionsStrings")
|
|
||||||
suspend fun TelegramBot.setMessageReactions(
|
|
||||||
message: AccessibleMessage,
|
|
||||||
emojis: List<String>,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReactions(message, emojis.map { Reaction.Emoji(it) }, big)
|
|
||||||
|
|
||||||
suspend fun TelegramBot.setMessageReaction(
|
|
||||||
message: AccessibleMessage,
|
|
||||||
emoji: String?,
|
|
||||||
big: Boolean = false
|
|
||||||
) = setMessageReaction(message, emoji ?.let { Reaction.Emoji(it) }, big)
|
|
||||||
@@ -2,10 +2,13 @@ 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.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.games.Game
|
import dev.inmo.tgbotapi.types.games.Game
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -17,11 +20,12 @@ suspend fun TelegramBot.sendGame(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendGame(
|
SendGame(
|
||||||
chatId, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,10 +39,11 @@ suspend fun TelegramBot.sendGame(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,10 +56,11 @@ suspend fun TelegramBot.sendGame(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chatId, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,8 +73,9 @@ suspend fun TelegramBot.sendGame(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
chat.id, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -27,7 +30,8 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
@@ -43,7 +47,8 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -64,10 +69,11 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,9 +93,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -107,9 +114,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,7 +136,8 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAnimation(
|
SendAnimation(
|
||||||
@@ -143,7 +152,8 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -163,10 +173,11 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -185,9 +196,10 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -204,6 +216,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -26,7 +29,8 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAudio(
|
SendAudio(
|
||||||
@@ -41,7 +45,8 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -62,9 +67,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -79,9 +85,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -96,9 +103,10 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,7 +124,8 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendAudio(
|
SendAudio(
|
||||||
@@ -130,7 +139,8 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -150,9 +160,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -166,9 +177,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -182,6 +194,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.DocumentFile
|
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -23,7 +26,8 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -36,7 +40,8 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
)
|
)
|
||||||
@@ -55,10 +60,11 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -72,11 +78,12 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,10 +98,11 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -108,7 +116,8 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
@@ -120,7 +129,8 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup,
|
replyMarkup,
|
||||||
disableContentTypeDetection
|
disableContentTypeDetection
|
||||||
)
|
)
|
||||||
@@ -138,10 +148,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -154,11 +165,12 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,7 +184,8 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ 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.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.media.*
|
import dev.inmo.tgbotapi.types.media.*
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent
|
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.AudioContent
|
import dev.inmo.tgbotapi.types.message.content.AudioContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.DocumentContent
|
import dev.inmo.tgbotapi.types.message.content.DocumentContent
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
@@ -22,10 +25,11 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendMediaGroup<MediaGroupPartContent>(
|
SendMediaGroup<MediaGroupPartContent>(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,9 +43,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,9 +60,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,9 +77,10 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(
|
) = sendMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,10 +92,11 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPlaylist(
|
SendPlaylist(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -101,9 +109,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,9 +125,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,9 +141,10 @@ suspend fun TelegramBot.sendPlaylist(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(
|
) = sendPlaylist(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -145,10 +156,11 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDocumentsGroup(
|
SendDocumentsGroup(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -161,9 +173,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -176,9 +189,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,9 +205,10 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(
|
) = sendDocumentsGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,10 +220,11 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVisualMediaGroup(
|
SendVisualMediaGroup(
|
||||||
chatId, media, threadId, disableNotification, protectContent, replyParameters
|
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -221,9 +237,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,9 +253,10 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters
|
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,7 +269,8 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(
|
) = sendVisualMediaGroup(
|
||||||
chat.id, media, threadId, disableNotification, protectContent, replyParameters
|
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.*
|
import dev.inmo.tgbotapi.types.files.*
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -23,7 +26,8 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
@@ -35,7 +39,8 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -53,9 +58,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -70,9 +76,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -87,9 +94,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -104,9 +112,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -121,9 +130,10 @@ suspend fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,7 +148,8 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendPhoto(
|
SendPhoto(
|
||||||
@@ -149,7 +160,8 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -166,9 +178,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -182,9 +195,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -198,9 +212,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -214,9 +229,10 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -230,6 +246,7 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ 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.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.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
import dev.inmo.tgbotapi.types.files.Sticker
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -19,10 +22,11 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,9 +40,10 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -51,9 +56,10 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -66,6 +72,7 @@ suspend fun TelegramBot.sendSticker(
|
|||||||
emoji: String? = null,
|
emoji: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.VideoFile
|
import dev.inmo.tgbotapi.types.files.VideoFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -27,7 +30,8 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
@@ -44,7 +48,8 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -62,9 +67,10 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -83,9 +89,10 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,9 +108,10 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -121,7 +129,8 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideo(
|
SendVideo(
|
||||||
@@ -137,7 +146,8 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -154,9 +164,10 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -174,9 +185,10 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,6 +203,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ 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.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.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -21,7 +24,8 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVideoNote(
|
SendVideoNote(
|
||||||
@@ -33,7 +37,8 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -48,10 +53,11 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,9 +73,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -81,6 +88,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ 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.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.ChatIdentifier
|
||||||
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.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -23,7 +26,8 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVoice(
|
SendVoice(
|
||||||
@@ -35,7 +39,8 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -53,9 +58,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -69,10 +75,11 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,9 +94,10 @@ suspend fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +112,8 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendVoice(
|
SendVoice(
|
||||||
@@ -115,7 +124,8 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
threadId,
|
threadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
replyParameters,
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -132,9 +142,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -147,10 +158,11 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = 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, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -163,6 +175,7 @@ suspend inline fun TelegramBot.sendVoice(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -34,10 +34,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,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, 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, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,6 +66,7 @@ suspend fun TelegramBot.sendInvoice(
|
|||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, 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, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ package dev.inmo.tgbotapi.extensions.api.send.polls
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
||||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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
|
||||||
@@ -25,11 +28,12 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendRegularPoll(
|
SendRegularPoll(
|
||||||
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
@@ -48,9 +52,10 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@@ -67,10 +72,11 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,10 +95,11 @@ suspend fun TelegramBot.sendRegularPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -113,11 +120,12 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -138,10 +146,11 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,10 +171,11 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,10 +196,11 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -209,11 +220,12 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -233,10 +245,11 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -256,10 +269,11 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,8 +293,9 @@ suspend inline fun TelegramBot.sendQuizPoll(
|
|||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ kotlin {
|
|||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(":tgbotapi.core")
|
|
||||||
api project(":tgbotapi.utils")
|
|
||||||
api project(":tgbotapi.behaviour_builder")
|
api project(":tgbotapi.behaviour_builder")
|
||||||
api libs.microutils.fsm.common
|
api libs.microutils.fsm.common
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -13,8 +13,7 @@ kotlin {
|
|||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(path: ':tgbotapi.core')
|
api project(":tgbotapi.utils")
|
||||||
api project(path: ':tgbotapi.utils')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatBoostRemovedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
||||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostRemoved
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatBoostRemoved(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
): Flow<ChatBoostRemoved> = expectFlow(
|
|
||||||
initRequest,
|
|
||||||
errorFactory
|
|
||||||
) {
|
|
||||||
it.chatBoostRemovedUpdateOrNull() ?.data.let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatBoostUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
||||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostUpdated
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatBoostUpdated(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
): Flow<ChatBoostUpdated> = expectFlow(
|
|
||||||
initRequest,
|
|
||||||
errorFactory
|
|
||||||
) {
|
|
||||||
it.chatBoostUpdatedUpdateOrNull() ?.data.let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
|
||||||
suspend inline fun <reified O : ChatMessageReactionUpdated> BehaviourContext.waitChatMessageReactionUpdated(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
): Flow<O> = expectFlow(
|
|
||||||
initRequest,
|
|
||||||
errorFactory
|
|
||||||
) {
|
|
||||||
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? O).let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatMessageReactionUpdatedByUser(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitChatMessageReactionUpdated<ChatMessageReactionUpdated.ByUser>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatMessageReactionUpdatedByChat(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitChatMessageReactionUpdated<ChatMessageReactionUpdated.ByChat>(initRequest, errorFactory)
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionsCountUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionsCountUpdated
|
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
|
||||||
|
|
||||||
suspend inline fun BehaviourContext.waitChatMessageReactionsCountUpdated(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
noinline errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
): Flow<ChatMessageReactionsCountUpdated> = expectFlow(
|
|
||||||
initRequest,
|
|
||||||
errorFactory
|
|
||||||
) {
|
|
||||||
(it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data).let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -3,10 +3,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgs
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgsSources
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
@@ -83,54 +79,35 @@ fun Flow<CommonMessage<TextContent>>.requireCommandsWithoutParams() = filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses [parseCommandsWithArgsSources] on incoming text sources and map them with [CommonMessage]
|
* Map the commands with their arguments and source messages
|
||||||
*/
|
*/
|
||||||
fun Flow<CommonMessage<TextContent>>.commandsWithParams(): Flow<Pair<CommonMessage<TextContent>, List<Pair<BotCommandTextSource, Array<TextSource>>>>> = mapNotNull {
|
fun Flow<CommonMessage<TextContent>>.commandsWithParams(): Flow<Pair<CommonMessage<TextContent>, List<Pair<BotCommandTextSource, Array<TextSource>>>>> = mapNotNull {
|
||||||
it to it.content.textSources.parseCommandsWithArgsSources().toList()
|
var currentCommandTextSource: BotCommandTextSource? = null
|
||||||
}
|
val currentArgs = mutableListOf<TextSource>()
|
||||||
|
val result = mutableListOf<Pair<BotCommandTextSource, Array<TextSource>>>()
|
||||||
|
|
||||||
/**
|
fun addCurrentCommandToResult() {
|
||||||
* Uses [parseCommandsWithArgs] on incoming text sources and map them with [CommonMessage]
|
currentCommandTextSource ?.let {
|
||||||
*/
|
result.add(it to currentArgs.toTypedArray())
|
||||||
fun Flow<CommonMessage<TextContent>>.commandsWithArgs(
|
currentArgs.clear()
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex
|
}
|
||||||
): Flow<Pair<CommonMessage<TextContent>, List<Pair<String, Array<String>>>>> = mapNotNull {
|
|
||||||
val commandsWithArgs = it.content.textSources.parseCommandsWithArgs(argsSeparator).toList().ifEmpty {
|
|
||||||
return@mapNotNull null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it to commandsWithArgs
|
it.content.textSources.forEach {
|
||||||
}
|
it.ifBotCommandTextSource {
|
||||||
|
addCurrentCommandToResult()
|
||||||
/**
|
currentCommandTextSource = it
|
||||||
* Uses [parseCommandsWithArgs] on incoming text sources and map them with [CommonMessage]
|
return@forEach
|
||||||
*/
|
}
|
||||||
fun Flow<CommonMessage<TextContent>>.commandsWithArgs(
|
currentArgs.add(it)
|
||||||
argsSeparator: String
|
|
||||||
): Flow<Pair<CommonMessage<TextContent>, List<Pair<String, Array<String>>>>> = commandsWithArgs(Regex(argsSeparator))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Uses [parseCommandsWithNamedArgs] on incoming text sources and map them with [CommonMessage]
|
|
||||||
*/
|
|
||||||
fun Flow<CommonMessage<TextContent>>.commandsWithNamedArgs(
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
): Flow<Pair<CommonMessage<TextContent>, List<Pair<String, List<Pair<String, String>>>>>> = mapNotNull {
|
|
||||||
val commandsWithArgs = it.content.textSources.parseCommandsWithNamedArgs(argsSeparator, nameArgSeparator).toList().ifEmpty {
|
|
||||||
return@mapNotNull null
|
|
||||||
}
|
}
|
||||||
|
addCurrentCommandToResult()
|
||||||
|
|
||||||
it to commandsWithArgs
|
result.toList().takeIf { it.isNotEmpty() } ?.let { result ->
|
||||||
|
it to result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Uses [parseCommandsWithNamedArgs] on incoming text sources and map them with [CommonMessage]
|
|
||||||
*/
|
|
||||||
fun Flow<CommonMessage<TextContent>>.commandsWithNamedArgs(
|
|
||||||
argsSeparator: String,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
): Flow<Pair<CommonMessage<TextContent>, List<Pair<String, List<Pair<String, String>>>>>> = commandsWithNamedArgs(Regex(argsSeparator), nameArgSeparator)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flat [commandsWithParams]. Each [Pair] of [BotCommandTextSource] and its [Array] of arg text sources will
|
* Flat [commandsWithParams]. Each [Pair] of [BotCommandTextSource] and its [Array] of arg text sources will
|
||||||
* be associated with its source message
|
* be associated with its source message
|
||||||
|
|||||||
@@ -62,10 +62,6 @@ suspend fun BehaviourContext.waitText(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<TextContent>()
|
) = waitContent(initRequest, errorFactory).mapContent<TextContent>()
|
||||||
suspend fun BehaviourContext.waitStory(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<StoryContent>()
|
|
||||||
suspend fun BehaviourContext.waitVenue(
|
suspend fun BehaviourContext.waitVenue(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
@@ -138,13 +134,3 @@ suspend fun BehaviourContext.waitMediaContent(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<MediaContent>()
|
) = waitContent(initRequest, errorFactory).mapContent<MediaContent>()
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitGiveawayContent(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<GiveawayContent>()
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitGiveawayPublicResultsContent(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContent(initRequest, errorFactory).mapContent<GiveawayPublicResultsContent>()
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
import dev.inmo.tgbotapi.extensions.utils.withContentOrNull
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
@@ -11,6 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate
|
|||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.filter
|
||||||
import kotlinx.coroutines.flow.mapNotNull
|
import kotlinx.coroutines.flow.mapNotNull
|
||||||
|
|
||||||
typealias CommonMessageToCommonMessageMapper<T> = suspend CommonMessage<T>.() -> CommonMessage<T>?
|
typealias CommonMessageToCommonMessageMapper<T> = suspend CommonMessage<T>.() -> CommonMessage<T>?
|
||||||
@@ -71,10 +74,6 @@ suspend fun BehaviourContext.waitTextMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<TextContent>()
|
) = waitContentMessage(initRequest, errorFactory).mapWithContent<TextContent>()
|
||||||
suspend fun BehaviourContext.waitStoryMessage(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<StoryContent>()
|
|
||||||
suspend fun BehaviourContext.waitVenueMessage(
|
suspend fun BehaviourContext.waitVenueMessage(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
@@ -149,13 +148,3 @@ suspend fun BehaviourContext.waitMediaContentMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<MediaContent>()
|
) = waitContentMessage(initRequest, errorFactory).mapWithContent<MediaContent>()
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitGiveawayContentMessage(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<GiveawayContent>()
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitGiveawayPublicResultsContentMessage(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitContentMessage(initRequest, errorFactory).mapWithContent<GiveawayPublicResultsContent>()
|
|
||||||
|
|||||||
@@ -130,14 +130,3 @@ suspend fun BehaviourContext.waitEditedInvoice(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContent<InvoiceContent>(initRequest, false, errorFactory)
|
) = waitEditedContent<InvoiceContent>(initRequest, false, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayContent(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEditedContent<GiveawayContent>(initRequest, false, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayPublicResultsContent(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEditedContent<GiveawayPublicResultsContent>(initRequest, false, errorFactory)
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.baseEditMessageUpdateOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.withContent
|
import dev.inmo.tgbotapi.extensions.utils.withContent
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||||
@@ -135,14 +136,3 @@ suspend fun BehaviourContext.waitEditedInvoiceMessage(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEditedContentMessage<InvoiceContent>(initRequest, errorFactory)
|
) = waitEditedContentMessage<InvoiceContent>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayContentMessage(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEditedContentMessage<GiveawayContent>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitEditedGiveawayPublicResultsContentMessage(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEditedContentMessage<GiveawayPublicResultsContent>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
|||||||
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
|
||||||
import dev.inmo.tgbotapi.types.request.UsersShared
|
import dev.inmo.tgbotapi.types.request.UserShared
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.filter
|
|
||||||
|
|
||||||
typealias EventMessageToEventMapper<T> = suspend ChatEventMessage<T>.() -> T?
|
typealias EventMessageToEventMapper<T> = suspend ChatEventMessage<T>.() -> T?
|
||||||
|
|
||||||
@@ -175,47 +174,18 @@ suspend fun BehaviourContext.waitWriteAccessAllowed(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<WriteAccessAllowed>(initRequest, errorFactory)
|
) = waitEvents<WriteAccessAllowed>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromRequest(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<WriteAccessAllowed.FromRequest>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromAttachmentMenu(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<WriteAccessAllowed.FromAttachmentMenu>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromWebAppLink(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<WriteAccessAllowed.FromWebAppLink>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedOther(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<WriteAccessAllowed.Other>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatSharedRequest(
|
suspend fun BehaviourContext.waitChatSharedRequest(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<ChatSharedRequest>(initRequest, errorFactory)
|
) = waitEvents<ChatSharedRequest>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitUsersShared(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<UsersShared>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitUserShared(
|
suspend fun BehaviourContext.waitUserShared(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitUsersShared(initRequest, errorFactory).filter { it.userIds.size == 1 }
|
) = waitEvents<UserShared>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatShared(
|
suspend fun BehaviourContext.waitChatShared(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEvents<ChatShared>(initRequest, errorFactory)
|
) = waitEvents<ChatShared>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatBoostAdded(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEvents<ChatBoostAdded>(initRequest, errorFactory)
|
|
||||||
|
|||||||
@@ -19,11 +19,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
|||||||
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
|
||||||
import dev.inmo.tgbotapi.types.request.UsersShared
|
import dev.inmo.tgbotapi.types.request.UserShared
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.filter
|
|
||||||
|
|
||||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||||
suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEventsMessages(
|
suspend inline fun <reified O : ChatEvent> BehaviourContext.waitEventsMessages(
|
||||||
@@ -172,44 +171,18 @@ suspend fun BehaviourContext.waitWriteAccessAllowedEventsMessages(
|
|||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<WriteAccessAllowed>(initRequest, errorFactory)
|
) = waitEventsMessages<WriteAccessAllowed>(initRequest, errorFactory)
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromRequestEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<WriteAccessAllowed.FromRequest>(initRequest, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromAttachmentMenuEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<WriteAccessAllowed.FromAttachmentMenu>(initRequest, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedFromWebAppLinkEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<WriteAccessAllowed.FromWebAppLink>(initRequest, errorFactory)
|
|
||||||
suspend fun BehaviourContext.waitWriteAccessAllowedOtherEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<WriteAccessAllowed.Other>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatSharedRequestEventsMessages(
|
suspend fun BehaviourContext.waitChatSharedRequestEventsMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<ChatSharedRequest>(initRequest, errorFactory)
|
) = waitEventsMessages<ChatSharedRequest>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitUsersSharedEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<UsersShared>(initRequest, errorFactory)
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitUserSharedEventsMessages(
|
suspend fun BehaviourContext.waitUserSharedEventsMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitUsersSharedEventsMessages(initRequest, errorFactory).filter { it.chatEvent.userIds.size == 1 }
|
) = waitEventsMessages<UserShared>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatSharedEventsMessages(
|
suspend fun BehaviourContext.waitChatSharedEventsMessages(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitEventsMessages<ChatShared>(initRequest, errorFactory)
|
) = waitEventsMessages<ChatShared>(initRequest, errorFactory)
|
||||||
|
|
||||||
suspend fun BehaviourContext.waitChatBoostAddedEventsMessages(
|
|
||||||
initRequest: Request<*>? = null,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
|
||||||
) = waitEventsMessages<ChatBoostAdded>(initRequest, errorFactory)
|
|
||||||
|
|||||||
@@ -2,28 +2,25 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceUser
|
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow only events from the same chat as base [AccessibleMessage]
|
* Allow only events from the same chat as base [Message]
|
||||||
*/
|
*/
|
||||||
val MessageFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, AccessibleMessage, Update> = { message, update ->
|
val MessageFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, Message, Update> = { message, update ->
|
||||||
update.sourceChat() ?.let {
|
update.sourceChat() ?.id == message.chat.id
|
||||||
it.id == message.chat.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only events from the same chat as base [List] of [AccessibleMessage]
|
* Allow only events from the same chat as base [List] of [Message]
|
||||||
*/
|
*/
|
||||||
val MessagesFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, List<AccessibleMessage>, Update> = { messages, update ->
|
val MessagesFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, List<Message>, Update> = { messages, update ->
|
||||||
val sourceChatId = update.sourceChat() ?.id
|
val sourceChatId = update.sourceChat() ?.id
|
||||||
sourceChatId != null && messages.all { sourceChatId == it.chat.id }
|
sourceChatId != null && messages.all { sourceChatId == it.chat.id }
|
||||||
}
|
}
|
||||||
@@ -32,41 +29,31 @@ val MessagesFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, List<Acce
|
|||||||
* Allow only updates from the same user as base [CallbackQuery.user]
|
* Allow only updates from the same user as base [CallbackQuery.user]
|
||||||
*/
|
*/
|
||||||
val CallbackQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, CallbackQuery, Update> = { query, update ->
|
val CallbackQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, CallbackQuery, Update> = { query, update ->
|
||||||
update.sourceUser() ?.let {
|
update.sourceChat() ?.id == query.user.id
|
||||||
it.id == query.user.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only updates from the same user as base [ShippingQuery.user]
|
* Allow only updates from the same user as base [ShippingQuery.user]
|
||||||
*/
|
*/
|
||||||
val ShippingQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, ShippingQuery, Update> = { query, update ->
|
val ShippingQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, ShippingQuery, Update> = { query, update ->
|
||||||
update.sourceUser() ?.let {
|
update.sourceChat() ?.id == query.user.id
|
||||||
it.id == query.user.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only updates from the same user as base [ShippingQuery.user]
|
* Allow only updates from the same user as base [ShippingQuery.user]
|
||||||
*/
|
*/
|
||||||
val PreCheckoutQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, PreCheckoutQuery, Update> = { query, update ->
|
val PreCheckoutQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, PreCheckoutQuery, Update> = { query, update ->
|
||||||
update.sourceUser() ?.let {
|
update.sourceChat() ?.id == query.user.id
|
||||||
it.id == query.user.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only updates from the same user as base [InlineQuery.from]
|
* Allow only updates from the same user as base [InlineQuery.from]
|
||||||
*/
|
*/
|
||||||
val InlineQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, InlineQuery, Update> = { query, update ->
|
val InlineQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, InlineQuery, Update> = { query, update ->
|
||||||
update.sourceUser() ?.let {
|
update.sourceChat() ?.id == query.from.id
|
||||||
it.id == query.user.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only events from the same chat as base [ChatMemberUpdated]
|
* Allow only events from the same chat as base [ChatMemberUpdated]
|
||||||
*/
|
*/
|
||||||
val ChatMemberUpdatedFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, ChatMemberUpdated, Update> = { updated, update ->
|
val ChatMemberUpdatedFilterByChat: BehaviourContextAndTwoTypesReceiver<Boolean, ChatMemberUpdated, Update> = { updated, update ->
|
||||||
update.sourceChat() ?.let {
|
update.sourceChat() ?.id == updated.chat.id
|
||||||
it.id == updated.chat.id
|
|
||||||
} != false
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Allow only events from the same chat as base [ChatMemberUpdated]
|
* Allow only events from the same chat as base [ChatMemberUpdated]
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.*
|
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupMessage
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupMessage
|
||||||
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow only messages which are not [MediaGroupMessage]
|
* Allow only messages which are not [MediaGroupMessage]
|
||||||
*/
|
*/
|
||||||
val CommonMessageFilterExcludeMediaGroups = SimpleFilter<AccessibleMessage> {
|
val CommonMessageFilterExcludeMediaGroups = SimpleFilter<Message> {
|
||||||
it !is CommonMessage<*> || it.content !is MediaGroupContent<*>
|
it !is CommonMessage<*> || it.content !is MediaGroupContent<*>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
|||||||
/**
|
/**
|
||||||
* Allow only messages which are not in some forum
|
* Allow only messages which are not in some forum
|
||||||
*/
|
*/
|
||||||
val MessageFilterForums = SimpleFilter<AccessibleMessage> {
|
val MessageFilterForums = SimpleFilter<Message> {
|
||||||
it.threadIdOrNull == null
|
it.threadIdOrNull == null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
|
|||||||
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<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
||||||
subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
markerFactory,
|
markerFactory,
|
||||||
scenarioReceiver
|
scenarioReceiver
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
@file:Suppress("unused")
|
|
||||||
|
|
||||||
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.ByIdChatBoostRemovedMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatBoostRemovedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostRemoved
|
|
||||||
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] 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.onChatBoostRemoved(
|
|
||||||
initialFilter: SimpleFilter<ChatBoostRemoved>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostRemoved, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<ChatBoostRemoved, Any> = ByIdChatBoostRemovedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostRemoved>
|
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
|
||||||
(it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
@file:Suppress("unused")
|
|
||||||
|
|
||||||
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.ByIdChatBoostUpdatedMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatBoostUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.boosts.ChatBoostUpdated
|
|
||||||
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] 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.onChatBoostUpdated(
|
|
||||||
initialFilter: SimpleFilter<ChatBoostUpdated>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatBoostUpdated, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<ChatBoostUpdated, Any> = ByIdChatBoostUpdatedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatBoostUpdated>
|
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
|
||||||
(it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatJoinRequestFilterByChat
|
||||||
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.ByChatChatJoinRequestMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatJoinRequestMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
@@ -24,7 +25,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
*/
|
*/
|
||||||
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>? = ChatJoinRequestFilterByChat,
|
||||||
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) {
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
@file:Suppress("unused")
|
|
||||||
|
|
||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatIdChatMessageReactionUpdatedMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatIdChatMessageReactionsCountUpdatedMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionsCountUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionsCountUpdated
|
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
|
||||||
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] 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.onChatMessageReactionsCountUpdated(
|
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionsCountUpdated>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionsCountUpdated, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<ChatMessageReactionsCountUpdated, Any> = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionsCountUpdated>
|
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
|
||||||
(it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
@file:Suppress("unused")
|
|
||||||
|
|
||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatIdChatMessageReactionUpdatedMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollMarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.chatMessageReactionUpdatedUpdateOrNull
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
|
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
|
|
||||||
internal suspend inline fun <BC : BehaviourContext, reified T : ChatMessageReactionUpdated> BC.onChatMessageReactionUpdated(
|
|
||||||
initialFilter: SimpleFilter<T>? = null,
|
|
||||||
noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, T, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<in T, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
|
||||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, T>
|
|
||||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
|
||||||
(it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.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] 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.onChatMessageReactionUpdatedByUser(
|
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByUser>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByUser, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByUser, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByUser>
|
|
||||||
) = onChatMessageReactionUpdated(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
|
||||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
|
||||||
* to combinate several filters
|
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
|
||||||
* data
|
|
||||||
*/
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedByChat(
|
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.ByChat>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.ByChat, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.ByChat, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.ByChat>
|
|
||||||
) = onChatMessageReactionUpdated(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
|
||||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
|
||||||
* to combinate several filters
|
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
|
||||||
* data
|
|
||||||
*/
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onChatMessageReactionUpdatedUnknown(
|
|
||||||
initialFilter: SimpleFilter<ChatMessageReactionUpdated.Unknown>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatMessageReactionUpdated.Unknown, Update>? = null,
|
|
||||||
markerFactory: MarkerFactory<in ChatMessageReactionUpdated.Unknown, Any> = ByChatIdChatMessageReactionUpdatedMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatMessageReactionUpdated.Unknown>
|
|
||||||
) = onChatMessageReactionUpdated(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
@@ -11,9 +11,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByC
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgs
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
|
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
@@ -24,7 +22,7 @@ internal suspend fun <BC : BehaviourContext> BC.commandUncounted(
|
|||||||
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 = onText(
|
): Job = onText(
|
||||||
@@ -51,7 +49,7 @@ suspend fun <BC : BehaviourContext> BC.command(
|
|||||||
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 = runCatchingSafely {
|
): Job = runCatchingSafely {
|
||||||
@@ -80,7 +78,7 @@ 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)
|
||||||
@@ -89,7 +87,7 @@ 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)
|
||||||
@@ -98,7 +96,7 @@ 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)
|
||||||
@@ -107,7 +105,7 @@ 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)
|
||||||
@@ -116,7 +114,7 @@ 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)
|
||||||
@@ -124,9 +122,8 @@ suspend fun <BC : BehaviourContext> BC.onCommand(
|
|||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = command(
|
) = command(
|
||||||
commandRegex,
|
commandRegex,
|
||||||
@@ -135,7 +132,7 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory
|
markerFactory = markerFactory
|
||||||
) {
|
) {
|
||||||
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
|
val args = it.parseCommandsWithParams().let { commandsWithArgs ->
|
||||||
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
||||||
commandsWithArgs[key]
|
commandsWithArgs[key]
|
||||||
} ?: emptyArray()
|
} ?: emptyArray()
|
||||||
@@ -145,191 +142,51 @@ suspend fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
command.toRegex(),
|
command.toRegex(),
|
||||||
initialFilter = initialFilter,
|
initialFilter = initialFilter,
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
botCommand.command,
|
botCommand.command,
|
||||||
initialFilter = initialFilter,
|
initialFilter = initialFilter,
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|
||||||
commandRegex: Regex,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = command(
|
|
||||||
commandRegex,
|
|
||||||
requireOnlyCommandInMessage = false,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory
|
|
||||||
) {
|
|
||||||
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
|
|
||||||
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
|
||||||
commandsWithArgs[key]
|
|
||||||
} ?: emptyList()
|
|
||||||
scenarioReceiver(it, args)
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|
||||||
command: String,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = commandWithNamedArgs(
|
|
||||||
command.toRegex(),
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
nameArgSeparator = nameArgSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|
||||||
botCommand: BotCommand,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = commandWithNamedArgs(
|
|
||||||
botCommand.command,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
nameArgSeparator = nameArgSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
suspend fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = commandWithArgs(
|
): Job = commandWithArgs(commandRegex, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
commandRegex = commandRegex,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(command.toRegex(), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
commandRegex = command.toRegex(),
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
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,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(botCommand.command, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
command = botCommand.command,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|
||||||
commandRegex: Regex,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = commandWithNamedArgs(
|
|
||||||
commandRegex,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
nameArgSeparator = nameArgSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver,
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|
||||||
command: String,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = onCommandWithNamedArgs(
|
|
||||||
command.toRegex(),
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
nameArgSeparator = nameArgSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|
||||||
botCommand: BotCommand,
|
|
||||||
initialFilter: CommonMessageFilter<TextContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
|
||||||
) = onCommandWithNamedArgs(
|
|
||||||
botCommand.command,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
argsSeparator = argsSeparator,
|
|
||||||
nameArgSeparator = nameArgSeparator,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByC
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithArgs
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
@@ -20,7 +20,7 @@ import kotlinx.coroutines.Job
|
|||||||
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(
|
||||||
@@ -48,7 +48,7 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommand(
|
|||||||
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)
|
||||||
@@ -56,7 +56,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledCommand(
|
|||||||
@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(
|
||||||
@@ -65,7 +65,7 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory
|
markerFactory = markerFactory
|
||||||
) {
|
) {
|
||||||
val args = it.parseCommandsWithArgs().let { commandsWithArgs ->
|
val args = it.parseCommandsWithParams().let { commandsWithArgs ->
|
||||||
commandsWithArgs
|
commandsWithArgs
|
||||||
}
|
}
|
||||||
scenarioReceiver(it, args)
|
scenarioReceiver(it, args)
|
||||||
@@ -74,7 +74,7 @@ suspend fun <BC : BehaviourContext> BC.unhandledCommandWithArgs(
|
|||||||
@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)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onContentMessage(
|
suspend fun <BC : BehaviourContext> BC.onContentMessage(
|
||||||
initialFilter: CommonMessageFilter<MessageContent>? = null,
|
initialFilter: CommonMessageFilter<MessageContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -70,7 +70,7 @@ suspend fun <BC : BehaviourContext> BC.onContentMessage(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onContact(
|
suspend fun <BC : BehaviourContext> BC.onContact(
|
||||||
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -94,7 +94,7 @@ suspend fun <BC : BehaviourContext> BC.onContact(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDice(
|
suspend fun <BC : BehaviourContext> BC.onDice(
|
||||||
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -118,7 +118,7 @@ suspend fun <BC : BehaviourContext> BC.onDice(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onGame(
|
suspend fun <BC : BehaviourContext> BC.onGame(
|
||||||
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -142,7 +142,7 @@ suspend fun <BC : BehaviourContext> BC.onGame(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onLocation(
|
suspend fun <BC : BehaviourContext> BC.onLocation(
|
||||||
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -166,7 +166,7 @@ suspend fun <BC : BehaviourContext> BC.onLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onLiveLocation(
|
suspend fun <BC : BehaviourContext> BC.onLiveLocation(
|
||||||
initialFilter: CommonMessageFilter<LiveLocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<LiveLocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LiveLocationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LiveLocationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in LiveLocationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in LiveLocationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LiveLocationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LiveLocationMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -190,7 +190,7 @@ suspend fun <BC : BehaviourContext> BC.onLiveLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onStaticLocation(
|
suspend fun <BC : BehaviourContext> BC.onStaticLocation(
|
||||||
initialFilter: CommonMessageFilter<StaticLocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<StaticLocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StaticLocationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StaticLocationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in StaticLocationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in StaticLocationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StaticLocationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StaticLocationMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -214,7 +214,7 @@ suspend fun <BC : BehaviourContext> BC.onStaticLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onPoll(
|
suspend fun <BC : BehaviourContext> BC.onPoll(
|
||||||
initialFilter: CommonMessageFilter<PollContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<PollContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PollMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in PollMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in PollMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PollMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -238,7 +238,7 @@ suspend fun <BC : BehaviourContext> BC.onPoll(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onText(
|
suspend fun <BC : BehaviourContext> BC.onText(
|
||||||
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>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -248,30 +248,6 @@ suspend fun <BC : BehaviourContext> BC.onText(
|
|||||||
scenarioReceiver
|
scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
|
||||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
|
||||||
* to combinate several filters
|
|
||||||
* @param [markerFactory] 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.onStory(
|
|
||||||
initialFilter: CommonMessageFilter<StoryContent>? = CommonMessageFilterExcludeMediaGroups,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StoryMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in StoryMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StoryMessage>
|
|
||||||
) = onContentMessageWithType(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||||
@@ -286,7 +262,7 @@ suspend fun <BC : BehaviourContext> BC.onStory(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onTextedContent(
|
suspend fun <BC : BehaviourContext> BC.onTextedContent(
|
||||||
initialFilter: CommonMessageFilter<TextedContent>? = null,
|
initialFilter: CommonMessageFilter<TextedContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextedMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextedMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -310,7 +286,7 @@ suspend fun <BC : BehaviourContext> BC.onTextedContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVenue(
|
suspend fun <BC : BehaviourContext> BC.onVenue(
|
||||||
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -334,7 +310,7 @@ suspend fun <BC : BehaviourContext> BC.onVenue(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
||||||
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -358,7 +334,7 @@ suspend fun <BC : BehaviourContext> BC.onAudioMediaGroup(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
||||||
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -382,7 +358,7 @@ suspend fun <BC : BehaviourContext> BC.onDocumentMediaGroupContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
||||||
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -406,7 +382,7 @@ suspend fun <BC : BehaviourContext> BC.onTextedMediaContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMediaCollection(
|
suspend fun <BC : BehaviourContext> BC.onMediaCollection(
|
||||||
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -430,7 +406,7 @@ suspend fun <BC : BehaviourContext> BC.onMediaCollection(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMedia(
|
suspend fun <BC : BehaviourContext> BC.onMedia(
|
||||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -454,7 +430,7 @@ suspend fun <BC : BehaviourContext> BC.onMedia(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onAnimation(
|
suspend fun <BC : BehaviourContext> BC.onAnimation(
|
||||||
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -478,7 +454,7 @@ suspend fun <BC : BehaviourContext> BC.onAnimation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onAudio(
|
suspend fun <BC : BehaviourContext> BC.onAudio(
|
||||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -502,7 +478,7 @@ suspend fun <BC : BehaviourContext> BC.onAudio(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onDocument(
|
suspend fun <BC : BehaviourContext> BC.onDocument(
|
||||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -526,7 +502,7 @@ suspend fun <BC : BehaviourContext> BC.onDocument(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onPhoto(
|
suspend fun <BC : BehaviourContext> BC.onPhoto(
|
||||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -550,7 +526,7 @@ suspend fun <BC : BehaviourContext> BC.onPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onSticker(
|
suspend fun <BC : BehaviourContext> BC.onSticker(
|
||||||
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -574,7 +550,7 @@ suspend fun <BC : BehaviourContext> BC.onSticker(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVideo(
|
suspend fun <BC : BehaviourContext> BC.onVideo(
|
||||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -598,7 +574,7 @@ suspend fun <BC : BehaviourContext> BC.onVideo(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVideoNote(
|
suspend fun <BC : BehaviourContext> BC.onVideoNote(
|
||||||
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -622,7 +598,7 @@ suspend fun <BC : BehaviourContext> BC.onVideoNote(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVoice(
|
suspend fun <BC : BehaviourContext> BC.onVoice(
|
||||||
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -646,7 +622,7 @@ suspend fun <BC : BehaviourContext> BC.onVoice(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onInvoice(
|
suspend fun <BC : BehaviourContext> BC.onInvoice(
|
||||||
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -670,7 +646,7 @@ suspend fun <BC : BehaviourContext> BC.onInvoice(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onVisualContent(
|
suspend fun <BC : BehaviourContext> BC.onVisualContent(
|
||||||
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
initialFilter: CommonMessageFilter<VisualMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VisualMediaGroupMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VisualMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VisualMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VisualMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VisualMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VisualMediaGroupMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -694,7 +670,7 @@ suspend fun <BC : BehaviourContext> BC.onVisualContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onMediaContent(
|
suspend fun <BC : BehaviourContext> BC.onMediaContent(
|
||||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
||||||
) = onContentMessageWithType(
|
) = onContentMessageWithType(
|
||||||
@@ -703,52 +679,3 @@ suspend fun <BC : BehaviourContext> BC.onMediaContent(
|
|||||||
markerFactory,
|
markerFactory,
|
||||||
scenarioReceiver
|
scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
|
||||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
|
||||||
* to combinate several filters
|
|
||||||
* @param [markerFactory] 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.onGiveawayContent(
|
|
||||||
initialFilter: CommonMessageFilter<GiveawayContent>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ScheduledGiveawayContentMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in ScheduledGiveawayContentMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ScheduledGiveawayContentMessage>
|
|
||||||
) = onContentMessageWithType(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
|
||||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
|
||||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
|
||||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
|
||||||
* to combinate several filters
|
|
||||||
* @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously
|
|
||||||
* in one "stream". Output of [markerFactory] will be used as a key for "stream"
|
|
||||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
|
||||||
* data
|
|
||||||
*/
|
|
||||||
suspend fun <BC : BehaviourContext> BC.onGiveawayPublicResultsContent(
|
|
||||||
initialFilter: CommonMessageFilter<GiveawayPublicResultsContent>? = null,
|
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GiveawayPublicResultsContentMessage, Update>? = MessageFilterByChat,
|
|
||||||
markerFactory: MarkerFactory<in GiveawayPublicResultsContentMessage, Any> = ByChatMessageMarkerFactory,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GiveawayPublicResultsContentMessage>
|
|
||||||
) = onContentMessageWithType(
|
|
||||||
initialFilter,
|
|
||||||
subcontextUpdatesFilter,
|
|
||||||
markerFactory,
|
|
||||||
scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -4,23 +4,27 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
|||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.*
|
import dev.inmo.micro_utils.coroutines.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitDeepLinks
|
||||||
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
||||||
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.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource
|
import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import io.ktor.http.decodeURLQueryComponent
|
import io.ktor.http.decodeURLQueryComponent
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.flow.filter
|
||||||
|
|
||||||
private val startRegex = Regex("start")
|
private val startRegex = Regex("start")
|
||||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update> = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||||
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
||||||
): Job = on(
|
): Job = on(
|
||||||
@@ -46,7 +50,7 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
|||||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||||
regex: Regex,
|
regex: Regex,
|
||||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update> = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||||
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
||||||
): Job {
|
): Job {
|
||||||
@@ -59,7 +63,7 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
|||||||
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
suspend fun <BC : BehaviourContext> BC.onDeepLink(
|
||||||
deepLink: String,
|
deepLink: String,
|
||||||
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
initialFilter: SimpleFilter<Pair<TextMessage, String>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, Pair<TextMessage, String>, Update> = { (message, _), update -> MessageFilterByChat(this, message, update) },
|
||||||
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
markerFactory: MarkerFactory<Pair<TextMessage, String>, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) },
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, Pair<TextMessage, String>>
|
||||||
): Job = onDeepLink(Regex("^$deepLink$"), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
): Job = onDeepLink(Regex("^$deepLink$"), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MessageContent>
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedContentMessage(
|
suspend fun <BC : BehaviourContext> BC.onEditedContentMessage(
|
||||||
initialFilter: CommonMessageFilter<MessageContent>? = null,
|
initialFilter: CommonMessageFilter<MessageContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, CommonMessage<MessageContent>, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in CommonMessage<MessageContent>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, CommonMessage<MessageContent>>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -64,7 +64,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedContentMessage(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedContact(
|
suspend fun <BC : BehaviourContext> BC.onEditedContact(
|
||||||
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<ContactContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ContactMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in ContactMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ContactMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -88,7 +88,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedContact(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedDice(
|
suspend fun <BC : BehaviourContext> BC.onEditedDice(
|
||||||
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<DiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DiceMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -112,7 +112,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedDice(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedGame(
|
suspend fun <BC : BehaviourContext> BC.onEditedGame(
|
||||||
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<GameContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, GameMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in GameMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, GameMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -136,7 +136,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedGame(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedLocation(
|
suspend fun <BC : BehaviourContext> BC.onEditedLocation(
|
||||||
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<LocationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, LocationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in LocationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, LocationMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -160,7 +160,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedLocation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedText(
|
suspend fun <BC : BehaviourContext> BC.onEditedText(
|
||||||
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>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -184,7 +184,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedText(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedVenue(
|
suspend fun <BC : BehaviourContext> BC.onEditedVenue(
|
||||||
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VenueContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VenueMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VenueMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VenueMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -208,7 +208,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVenue(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
||||||
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
initialFilter: CommonMessageFilter<AudioMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMediaGroupMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -232,7 +232,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudioMediaGroup(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
||||||
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentMediaGroupPartContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMediaGroupMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMediaGroupMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMediaGroupMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -256,7 +256,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedDocumentMediaGroupContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
||||||
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
initialFilter: CommonMessageFilter<TextedMediaContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextedMediaMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextedMediaMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextedMediaMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -280,7 +280,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedTextedMediaContent(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
||||||
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
initialFilter: CommonMessageFilter<MediaCollectionContent<TelegramMediaFile>>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaCollectionMessage<TelegramMediaFile>, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in MediaCollectionMessage<TelegramMediaFile>, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaCollectionMessage<TelegramMediaFile>>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -304,7 +304,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedMediaCollection(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedMedia(
|
suspend fun <BC : BehaviourContext> BC.onEditedMedia(
|
||||||
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
initialFilter: CommonMessageFilter<MediaContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MediaMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in MediaMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MediaMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -328,7 +328,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedMedia(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
|
suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
|
||||||
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<AnimationContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AnimationMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AnimationMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AnimationMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -352,7 +352,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAnimation(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedAudio(
|
suspend fun <BC : BehaviourContext> BC.onEditedAudio(
|
||||||
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
initialFilter: CommonMessageFilter<AudioContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, AudioMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in AudioMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, AudioMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -376,7 +376,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedAudio(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedDocument(
|
suspend fun <BC : BehaviourContext> BC.onEditedDocument(
|
||||||
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
initialFilter: CommonMessageFilter<DocumentContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, DocumentMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in DocumentMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DocumentMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -400,7 +400,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedDocument(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
|
suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
|
||||||
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
initialFilter: CommonMessageFilter<PhotoContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, PhotoMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in PhotoMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, PhotoMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -424,7 +424,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedPhoto(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedSticker(
|
suspend fun <BC : BehaviourContext> BC.onEditedSticker(
|
||||||
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<StickerContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, StickerMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in StickerMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, StickerMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -448,7 +448,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedSticker(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedVideo(
|
suspend fun <BC : BehaviourContext> BC.onEditedVideo(
|
||||||
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
initialFilter: CommonMessageFilter<VideoContent>? = null,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VideoMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -472,7 +472,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideo(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
||||||
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VideoNoteContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VideoNoteMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VideoNoteMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VideoNoteMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -496,7 +496,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVideoNote(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedVoice(
|
suspend fun <BC : BehaviourContext> BC.onEditedVoice(
|
||||||
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<VoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, VoiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in VoiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, VoiceMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
@@ -520,7 +520,7 @@ suspend fun <BC : BehaviourContext> BC.onEditedVoice(
|
|||||||
*/
|
*/
|
||||||
suspend fun <BC : BehaviourContext> BC.onEditedInvoice(
|
suspend fun <BC : BehaviourContext> BC.onEditedInvoice(
|
||||||
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
initialFilter: CommonMessageFilter<InvoiceContent>? = CommonMessageFilterExcludeMediaGroups,
|
||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, InvoiceMessage, Update> = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in InvoiceMessage, Any> = ByChatMessageMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InvoiceMessage>
|
||||||
)= onEditedContent(
|
)= onEditedContent(
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user