mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-02 07:55:25 +00:00
Compare commits
288 Commits
Author | SHA1 | Date | |
---|---|---|---|
ff34017a03 | |||
96a7a2acab | |||
71c830fc2e | |||
271e7d2157 | |||
cf5e5a1d1e | |||
186d6931ac | |||
6ec686040c | |||
211cef298c | |||
8de41bdd99 | |||
7a5c9c7ef8 | |||
4dec85ee60 | |||
4622509356 | |||
30e44d6bf2 | |||
e403bbca0b | |||
93e06a5765 | |||
718f6ab366 | |||
6f776576ab | |||
fcdaeb2e8f | |||
1e679ce50b | |||
fe4be69051 | |||
06ba14e8be | |||
ca1b196942 | |||
dc5d8afe32 | |||
b843fd9188 | |||
d56173eceb | |||
97621bca67 | |||
7e986b2088 | |||
cfc2fd1b47 | |||
905486fff9 | |||
6acf4bc927 | |||
64a1aeef2c | |||
6db88eb8bd | |||
4e416aaf44 | |||
71b9f15e40 | |||
4dc2bfc8bf | |||
31c1055f3d | |||
3da2229a9c | |||
624289cc8e | |||
9edc8a0d5a | |||
3bf914471a | |||
7d3c8a2d27 | |||
f12628bec3 | |||
c1734e6d12 | |||
4bff860c01 | |||
6a8b83f750 | |||
ab9718b7c6 | |||
0a9235bcd9 | |||
eff2f2ba41 | |||
db644c93ff | |||
28e031265c | |||
84abd006ad | |||
5f4a327c2e | |||
c5102590cc | |||
072264faad | |||
6b74bc155e | |||
9d506b11a3 | |||
f47b3673a7 | |||
dbb8be502a | |||
170747741f | |||
e4a3acdd68 | |||
953bdef657 | |||
64ef0fa160 | |||
c1f40c1030 | |||
8de584b292 | |||
cb7bb01671 | |||
a7b2bb820b | |||
be9c0cff61 | |||
6ac6ad0c0a | |||
dbc69def0b | |||
b8061966be | |||
0e0af73633 | |||
2a2aeed045 | |||
fdc007f609 | |||
dec55cfb2d | |||
3997af171e | |||
d963cdae35 | |||
8ec209422a | |||
8ca86b1e14 | |||
ffba4e9cef | |||
544192ad5f | |||
08b0564dba | |||
009c49247d | |||
dd7a3ced4d | |||
ceff85fcfd | |||
bb62f9fbd6 | |||
7bbbf54775 | |||
1b506cb820 | |||
3f988d1529 | |||
2da28cea01 | |||
42e6013d95 | |||
3c8dbe70dc | |||
4a1989fb79 | |||
b559dbbe66 | |||
d72fb6e3e8 | |||
092722fad8 | |||
63633e8891 | |||
61cdfa264e | |||
6262b0581a | |||
8694b31066 | |||
5a541271b8 | |||
|
9b14e9079b | ||
fd26d14380 | |||
3ebaef0789 | |||
51bb0a021f | |||
b7c1692efa | |||
bce5fb658c | |||
b9bc40187f | |||
3da4ee4808 | |||
6571e8f592 | |||
5c13047a0b | |||
4908bb2cfe | |||
a01ca43837 | |||
a9a01e3154 | |||
468c54a30f | |||
9177e01910 | |||
417f72af4a | |||
df6d70b20d | |||
0b12df14db | |||
1590e1eef2 | |||
6896bc0772 | |||
ce1abb0ae2 | |||
ac63d52b14 | |||
e902f85b36 | |||
225fedde3a | |||
66e31e5d0c | |||
852065ad38 | |||
d88fc2c9c0 | |||
4d92588390 | |||
89524290c5 | |||
86c86dfb8a | |||
bdae774c62 | |||
d70c7fdbdf | |||
f14885a541 | |||
0013e91f6e | |||
aa315f6fec | |||
9425380002 | |||
0f5bce592b | |||
294f80032c | |||
a4064a15ec | |||
7e5064ba3c | |||
eac45b86a6 | |||
f0448485c8 | |||
f2308f0312 | |||
76a2cfd1a0 | |||
|
edca5494d4 | ||
d480c9efd6 | |||
a106068af4 | |||
d55253a81b | |||
adede330fb | |||
f2f370e40e | |||
86bb87bb37 | |||
bb80eb43fd | |||
a692ed65f3 | |||
60e50f9492 | |||
e28f3492ef | |||
f637b480b1 | |||
955e9ca871 | |||
8df72edd52 | |||
f3b05bbffd | |||
95011e2b3e | |||
cad0bf8a95 | |||
f760e60089 | |||
6c76e1c47a | |||
b5f4219635 | |||
5190f7b856 | |||
14756fd6e8 | |||
e66537ee32 | |||
825ecc1d73 | |||
05bfbfe381 | |||
430240a6ad | |||
860e35258c | |||
d9c39d7a26 | |||
52fd55eea5 | |||
cb11532b58 | |||
dce63713f9 | |||
fb9ff653ef | |||
57f53813c8 | |||
fc183bfd2f | |||
c025a027c6 | |||
db2101d85c | |||
a01a9910b5 | |||
4e1ecc0e34 | |||
90225a9380 | |||
3026c8708d | |||
63975cc88e | |||
a622c4d6fa | |||
e124bb18df | |||
152728afca | |||
38d672b665 | |||
d2c299301a | |||
25fb6b2b46 | |||
5b5de5253c | |||
9a7dd6ec9a | |||
4085f721be | |||
ffc915cae1 | |||
a6c90b3df5 | |||
a6d9fa6ce3 | |||
7fd2442f8b | |||
8b37ecea9e | |||
35fc9f60df | |||
68e89dc1ad | |||
129fb31b74 | |||
a2c353ca41 | |||
cb74abfce5 | |||
ca7314923e | |||
74f625a53a | |||
3a5fed3dd9 | |||
6158143220 | |||
f8182ddb85 | |||
b7c3f9f607 | |||
8763ea23fa | |||
b412e7b3b7 | |||
98e5d182bb | |||
ffc0f5abb7 | |||
816cf00dac | |||
e34bc7453e | |||
3b2ccbf33b | |||
6ecfbdf56d | |||
b49e1c50f5 | |||
d7389dfcfe | |||
cf5cee3e53 | |||
8593263506 | |||
4422a4d09b | |||
9ecb50e377 | |||
8a4b40c6ec | |||
bba667db30 | |||
ca0d256bbb | |||
dc2fd07632 | |||
32fe008eef | |||
2b938903b6 | |||
080db09d2c | |||
0efa52fe00 | |||
c4214798e3 | |||
fdf510153d | |||
edb16d7107 | |||
c49f400201 | |||
db7de6edf8 | |||
a0b14233e0 | |||
1a479706e2 | |||
2719e166a8 | |||
051684db23 | |||
805cec76ce | |||
899c195fd5 | |||
f5937fc4d6 | |||
8cf7b349df | |||
bf8f8b9e6f | |||
edc0b1c492 | |||
a85d58aac1 | |||
10860e1bb2 | |||
46e6eeca9d | |||
80be86454d | |||
d5f5a0e30b | |||
826c27874d | |||
4e917e8cf8 | |||
051210caf5 | |||
284fe58848 | |||
38c9732da5 | |||
dee13c03ae | |||
6103b70a47 | |||
96ffae2062 | |||
4180721aed | |||
4ab0845333 | |||
3f9a4e95a3 | |||
834d60ff16 | |||
650d96974f | |||
7f5cd0567b | |||
af159b89b6 | |||
efe286c181 | |||
821bb5b45c | |||
c92ed92f7c | |||
88f6b349ea | |||
6c4afac8f8 | |||
6273990b00 | |||
1a1fd926dd | |||
affa2a3a57 | |||
73a748d8b3 | |||
fa4d264df4 | |||
1b1da33882 | |||
ccfb774f33 | |||
5215e8a315 | |||
97a3901cb9 | |||
034e87a8ef | |||
156fbd72d4 | |||
8ec3e01737 | |||
1655bedabe | |||
ac6b580a7e | |||
c6692c2509 | |||
12846a68b9 |
3
.github/workflows/greetings.yml
vendored
3
.github/workflows/greetings.yml
vendored
|
@ -5,6 +5,9 @@ on: [pull_request, issues]
|
|||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
|
|
2
.github/workflows/kdocs.yml
vendored
2
.github/workflows/kdocs.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
java-version: 17
|
||||
- name: Build
|
||||
run: ./gradlew dokkaHtmlMultiModule
|
||||
- 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/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
java-version: 17
|
||||
- name: Setup LibCurl
|
||||
run: sudo apt install -y libcurl4-openssl-dev
|
||||
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
|
||||
- name: Rewrite version
|
||||
run: |
|
||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||
|
@ -20,11 +20,14 @@ jobs:
|
|||
run: ./gradlew ksp
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
- name: API compatibility check
|
||||
run: ./gradlew apiCheck
|
||||
- name: Publish to Gitea
|
||||
continue-on-error: true
|
||||
run: ./gradlew publishAllPublicationsToGiteaRepository
|
||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
||||
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
||||
- name: Publish to GithubPackages
|
||||
continue-on-error: true
|
||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||
|
|
193
CHANGELOG.md
193
CHANGELOG.md
|
@ -1,5 +1,198 @@
|
|||
# TelegramBotAPI changelog
|
||||
|
||||
## 14.0.0
|
||||
|
||||
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
* `Core`:
|
||||
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
|
||||
* All the methods/classes related to sending of messages got `effectId` parameter
|
||||
* All the methods/classes related to sending of photos/animations/videos got `showCaptionAboveMedia` parameter
|
||||
|
||||
## 13.0.0
|
||||
|
||||
**Add support of [Telegram Bots API 7.3](https://core.telegram.org/bots/api-changelog#may-6-2024)**
|
||||
|
||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||
|
||||
* `Core`:
|
||||
* For polls, `textSources` now means `question` text sources. For `QuizPoll` there are `explanation` and `explanationTextSources`
|
||||
for hinting
|
||||
* `API`:
|
||||
* A lot of API related to `Poll`s has been changed to include opportunity to pass `ParseMode` and `TextSource`s list
|
||||
|
||||
## 12.0.1
|
||||
|
||||
* `Version`:
|
||||
* `Ktor`: `2.3.9` -> `2.3.10`
|
||||
* `MicroUtils`: `0.20.39` -> `0.20.45`
|
||||
* `UUID`: `0.8.2` -> `0.8.4`
|
||||
|
||||
## 12.0.0
|
||||
|
||||
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
||||
|
||||
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
||||
|
||||
## 11.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
|
||||
|
||||
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
||||
|
||||
* `Core`:
|
||||
* `MessageId` now is `value class`. `MessageIdentifier` become deprecated
|
||||
* `MessageThreadId` now is `value class`
|
||||
* `InlineQueryIdentifier` now is `value class`
|
||||
* `MediaGroupIdentifier` has been renamed to `MediaGroupId` and now is `value class`
|
||||
* `CallbackQueryIdentifier` has been renamed to `CallbackQueryId` and now is `value class`
|
||||
* `WebAppQueryId` now is `value class`
|
||||
* `PreCheckoutQueryId` now is `value class`
|
||||
* `FileUniqueId` has been renamed to `TgFileUniqueId` and now is `value class`
|
||||
* `UpdateIdentifier` has been renamed to `UpdateId` and now is `value class`
|
||||
* `InlineMessageIdentifier` has been renamed to `InlineMessageId` and now is `value class`
|
||||
* `ShippingQueryIdentifier` has been renamed to `ShippingQueryId` and now is `value class`
|
||||
* `Identifier` has been renamed to `RawChatId` and now is `value class`
|
||||
* `ShippingOptionIdentifier` has been renamed to `ShippingOptionId` and now is `value class`
|
||||
* `PollIdentifier` has been renamed to `PollId` and now is `value class`
|
||||
* `StickerSetName` now is `value class`
|
||||
|
||||
## 10.1.2
|
||||
|
||||
* `Version`:
|
||||
* `Kotlin`: `1.9.22` -> `1.9.23`
|
||||
* `Korlibs`: `5.3.2` -> `5.4.0`
|
||||
* `Ktor`: `2.3.8` -> `2.3.9`
|
||||
* `MicroUtils`: `0.20.37` -> `0.20.39`
|
||||
* `KSLog`: `1.3.2` -> `1.3.3`
|
||||
|
||||
## 10.1.1
|
||||
|
||||
* `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`:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.8-blue)](https://core.telegram.org/bots/api-changelog#august-18-2023)
|
||||
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.4-blue)](https://core.telegram.org/bots/api-changelog#may-28-2024)
|
||||
|
||||
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||
|
@ -118,5 +118,5 @@ suspend fun main() {
|
|||
### More examples
|
||||
|
||||
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
||||
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
|
||||
always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and
|
||||
[chat](https://t.me/InMoTelegramBotAPIChat).
|
||||
|
|
16
build.gradle
16
build.gradle
|
@ -16,6 +16,8 @@ buildscript {
|
|||
|
||||
plugins {
|
||||
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
|
||||
|
@ -24,7 +26,7 @@ allprojects {
|
|||
mavenLocal()
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url "https://git.inmo.dev/api/packages/InsanusMokrassar/maven" }
|
||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||
}
|
||||
if (it != rootProject.findProject("docs")) {
|
||||
tasks.whenTaskAdded { task ->
|
||||
|
@ -53,13 +55,13 @@ if (new File(projectDir, "secret.gradle").exists()) {
|
|||
githubRelease {
|
||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||
|
||||
owner "InsanusMokrassar"
|
||||
repo "TelegramBotAPI"
|
||||
owner = "InsanusMokrassar"
|
||||
repo = "TelegramBotAPI"
|
||||
|
||||
tagName "v$library_version"
|
||||
releaseName "$library_version"
|
||||
targetCommitish "$library_version"
|
||||
tagName = "v$library_version"
|
||||
releaseName = "$library_version"
|
||||
targetCommitish = "$library_version"
|
||||
|
||||
body getCurrentVersionChangelog()
|
||||
body = getCurrentVersionChangelog()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ Object callback = {
|
|||
skipDeprecated.set(true)
|
||||
|
||||
sourceLink {
|
||||
localDirectory.set(file("./"))
|
||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"))
|
||||
localDirectory.set(file("../"))
|
||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi/tree/master"))
|
||||
remoteLineSuffix.set("#L")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=9.1.1
|
||||
library_version=14.0.0
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
[versions]
|
||||
|
||||
kotlin = "1.8.22"
|
||||
kotlin-serialization = "1.5.1"
|
||||
kotlin-coroutines = "1.7.3"
|
||||
kotlin = "1.9.23"
|
||||
kotlin-serialization = "1.6.3"
|
||||
kotlin-coroutines = "1.8.0"
|
||||
|
||||
javax-activation = "1.1.1"
|
||||
|
||||
korlibs = "4.0.3"
|
||||
uuid = "0.7.1"
|
||||
ktor = "2.3.3"
|
||||
korlibs = "5.4.0"
|
||||
uuid = "0.8.4"
|
||||
ktor = "2.3.10"
|
||||
|
||||
ksp = "1.8.22-1.0.11"
|
||||
kotlin-poet = "1.14.2"
|
||||
ksp = "1.9.23-1.0.20"
|
||||
kotlin-poet = "1.16.0"
|
||||
|
||||
microutils = "0.19.9"
|
||||
microutils = "0.20.45"
|
||||
kslog = "1.3.3"
|
||||
|
||||
github-release-plugin = "2.4.1"
|
||||
dokka = "1.8.20"
|
||||
versions = "0.51.0"
|
||||
|
||||
github-release-plugin = "2.5.2"
|
||||
dokka = "1.9.20"
|
||||
|
||||
validator = "0.14.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
@ -38,11 +43,12 @@ ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.
|
|||
|
||||
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
|
||||
|
||||
korlibs-klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "korlibs" }
|
||||
korlibs-krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "korlibs" }
|
||||
korlibs-klock = { module = "com.soywiz.korge:korlibs-time", version.ref = "korlibs" }
|
||||
korlibs-krypto = { module = "com.soywiz.korge:korlibs-crypto", version.ref = "korlibs" }
|
||||
|
||||
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-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" }
|
||||
|
@ -52,6 +58,8 @@ microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", ver
|
|||
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" }
|
||||
|
||||
kslog = { module = "dev.inmo:kslog", version.ref = "kslog" }
|
||||
|
||||
# ksp dependencies
|
||||
|
||||
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
||||
|
@ -71,3 +79,5 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", 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-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
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
|
|
|
@ -5,7 +5,7 @@ kotlin {
|
|||
jvm {
|
||||
compilations.main {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ kotlin {
|
|||
}
|
||||
linuxX64()
|
||||
mingwX64()
|
||||
linuxArm64()
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
|
@ -40,10 +41,18 @@ kotlin {
|
|||
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 {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
apply plugin: 'maven-publish'
|
||||
|
||||
task javadocsJar(type: Jar) {
|
||||
archiveClassifier.convention("javadoc")
|
||||
archiveClassifier.set("javadoc")
|
||||
archiveClassifier = 'javadoc'
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
@ -20,22 +19,22 @@ publishing {
|
|||
}
|
||||
|
||||
developers {
|
||||
|
||||
|
||||
developer {
|
||||
id = "InsanusMokrassar"
|
||||
name = "Ovsiannikov Aleksei"
|
||||
email = "ovsyannikov.alexey95@gmail.com"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
licenses {
|
||||
|
||||
|
||||
license {
|
||||
name = "Apache Software License 2.0"
|
||||
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
|
@ -43,58 +42,77 @@ publishing {
|
|||
maven {
|
||||
name = "GithubPackages"
|
||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
||||
|
||||
|
||||
credentials {
|
||||
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')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (project.hasProperty('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
|
||||
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "Gitea"
|
||||
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
|
||||
|
||||
credentials(HttpHeaderCredentials) {
|
||||
name = "Authorization"
|
||||
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
|
||||
name = "InmoNexus"
|
||||
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
||||
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
||||
}
|
||||
|
||||
authentication {
|
||||
header(HttpHeaderAuthentication)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||
|
||||
|
||||
credentials {
|
||||
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||
apply plugin: 'signing'
|
||||
|
||||
|
||||
signing {
|
||||
useGpgCmd()
|
||||
|
||||
|
||||
sign publishing.publications
|
||||
}
|
||||
|
||||
|
||||
task signAll {
|
||||
tasks.withType(Sign).forEach {
|
||||
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":"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"}}}
|
||||
{"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"}}}
|
2247
tgbotapi.api/api/tgbotapi.api.api
Normal file
2247
tgbotapi.api/api/tgbotapi.api.api
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -16,6 +16,9 @@ kotlin {
|
|||
api project(":tgbotapi.core")
|
||||
}
|
||||
}
|
||||
configureEach {
|
||||
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,9 +6,8 @@ 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.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||
|
||||
suspend fun TelegramBot.deleteMessage(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -23,7 +22,7 @@ suspend fun TelegramBot.deleteMessage(
|
|||
) = deleteMessage(chat.id, messageId)
|
||||
|
||||
suspend fun TelegramBot.deleteMessage(
|
||||
message: Message
|
||||
message: AccessibleMessage
|
||||
): Boolean {
|
||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
||||
if (mediaGroupContent == null) {
|
||||
|
@ -46,9 +45,9 @@ suspend fun TelegramBot.delete(
|
|||
) = deleteMessage(chat, messageId)
|
||||
|
||||
suspend fun TelegramBot.delete(
|
||||
message: Message
|
||||
message: AccessibleMessage
|
||||
) = deleteMessage(message)
|
||||
|
||||
suspend fun Message.delete(
|
||||
suspend fun AccessibleMessage.delete(
|
||||
requestsExecutor: TelegramBot
|
||||
) = requestsExecutor.deleteMessage(this)
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
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(
|
||||
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(
|
||||
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.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
suspend fun TelegramBot.forwardMessage(
|
||||
|
@ -49,7 +49,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||
|
||||
suspend fun TelegramBot.forwardMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
|
@ -57,7 +57,7 @@ suspend fun TelegramBot.forwardMessage(
|
|||
|
||||
suspend fun TelegramBot.forwardMessage(
|
||||
toChat: Chat,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
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,
|
||||
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,
|
||||
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
|
||||
)
|
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.*
|
|||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
suspend fun TelegramBot.getUpdates(
|
||||
offset: UpdateIdentifier? = null,
|
||||
offset: UpdateId? = null,
|
||||
limit: Int = getUpdatesLimit.last,
|
||||
timeout: Seconds? = null,
|
||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
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,
|
||||
offset: UpdateId? = null,
|
||||
limit: Int = getUpdatesLimit.last,
|
||||
timeout: Seconds? = null,
|
||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
||||
|
||||
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
||||
import dev.inmo.tgbotapi.types.MediaGroupId
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||
import dev.inmo.tgbotapi.types.update.*
|
||||
|
@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage
|
|||
*/
|
||||
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
||||
val resultUpdates = mutableListOf<Update>()
|
||||
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
||||
val mediaGroups = mutableMapOf<MediaGroupId, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
||||
|
||||
for (update in this) {
|
||||
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
||||
|
|
|
@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.edit
|
|||
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
|
@ -42,50 +43,60 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||
) {
|
||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||
while (isActive) {
|
||||
delay(liveTimeMillis)
|
||||
// Remove previous location message info to resend live location message
|
||||
currentLiveLocationMessage = null
|
||||
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
||||
null
|
||||
} else {
|
||||
CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||
while (isActive) {
|
||||
delay(liveTimeMillis)
|
||||
// Remove previous location message info to resend live location message
|
||||
currentLiveLocationMessage = null
|
||||
}
|
||||
}
|
||||
}
|
||||
locationsFlow.collect {
|
||||
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||
if (capturedLiveLocationMessage == null) {
|
||||
updateMessageJob.start()
|
||||
updateMessageJob ?.start()
|
||||
currentLiveLocationMessage = send(
|
||||
chatId,
|
||||
it.latitude,
|
||||
it.longitude,
|
||||
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
|
||||
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
||||
LiveLocation.INDEFINITE_LIVE_PERIOD
|
||||
} else {
|
||||
ceil(liveTimeMillis.toDouble() / 1000).toInt()
|
||||
},
|
||||
it.horizontalAccuracy,
|
||||
it.heading,
|
||||
it.proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
it.replyMarkup
|
||||
).also {
|
||||
sentMessageFlow ?.emit(it)
|
||||
}
|
||||
} else {
|
||||
edit(
|
||||
capturedLiveLocationMessage,
|
||||
it.latitude,
|
||||
it.longitude,
|
||||
it.horizontalAccuracy,
|
||||
it.heading,
|
||||
it.proximityAlertRadius,
|
||||
it.replyMarkup
|
||||
message = capturedLiveLocationMessage,
|
||||
latitude = it.latitude,
|
||||
longitude = it.longitude,
|
||||
horizontalAccuracy = it.horizontalAccuracy,
|
||||
heading = it.heading,
|
||||
proximityAlertRadius = it.proximityAlertRadius,
|
||||
replyMarkup = it.replyMarkup
|
||||
).also {
|
||||
sentMessageFlow ?.emit(it)
|
||||
}
|
||||
|
@ -104,15 +115,16 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||
locationsFlow: Flow<Location>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||
) {
|
||||
handleLiveLocation(
|
||||
chatId,
|
||||
locationsFlow.map {
|
||||
chatId = chatId,
|
||||
locationsFlow = locationsFlow.map {
|
||||
EditLiveLocationInfo(
|
||||
it.latitude,
|
||||
it.longitude,
|
||||
|
@ -122,13 +134,14 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||
)
|
||||
},
|
||||
liveTimeMillis,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
sentMessageFlow
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -143,26 +156,28 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||
locationsFlow: Flow<Pair<Double, Double>>,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
||||
) {
|
||||
handleLiveLocation(
|
||||
chatId,
|
||||
locationsFlow.map { (lat, long) ->
|
||||
chatId = chatId,
|
||||
locationsFlow = locationsFlow.map { (lat, long) ->
|
||||
EditLiveLocationInfo(
|
||||
lat,
|
||||
long
|
||||
)
|
||||
},
|
||||
liveTimeMillis,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
sentMessageFlow
|
||||
liveTimeMillis = liveTimeMillis,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
sentMessageFlow = sentMessageFlow
|
||||
)
|
||||
}
|
||||
|
|
|
@ -2,41 +2,29 @@ package dev.inmo.tgbotapi.extensions.api
|
|||
|
||||
import korlibs.time.DateTime
|
||||
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.extensions.api.edit.edit
|
||||
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.send.send
|
||||
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||
import io.ktor.utils.io.core.Closeable
|
||||
import korlibs.time.millisecondsLong
|
||||
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 kotlin.js.JsName
|
||||
import kotlin.jvm.JvmName
|
||||
import kotlin.math.ceil
|
||||
|
||||
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
||||
const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
||||
const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis
|
||||
|
||||
/**
|
||||
* @see startLiveLocation
|
||||
|
@ -108,10 +96,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider {
|
||||
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
||||
|
@ -125,10 +114,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -155,10 +145,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
|
@ -170,10 +161,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -190,10 +182,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
|
@ -205,10 +198,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -225,10 +219,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): LiveLocationProvider = startLiveLocation(
|
||||
scope,
|
||||
|
@ -240,10 +235,11 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -252,7 +248,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
to: Message,
|
||||
to: AccessibleMessage,
|
||||
scope: CoroutineScope,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
|
@ -261,8 +257,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = startLiveLocation(
|
||||
|
@ -275,10 +273,11 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
to.messageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -287,7 +286,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||
to: Message,
|
||||
to: AccessibleMessage,
|
||||
scope: CoroutineScope,
|
||||
location: StaticLocation,
|
||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||
|
@ -295,8 +294,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||
initHeading: Degrees? = null,
|
||||
initProximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = startLiveLocation(
|
||||
|
@ -308,9 +309,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||
initHeading,
|
||||
initProximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
to.messageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||
replyMarkup
|
||||
)
|
||||
|
|
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.StopPoll
|
|||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
/**
|
||||
* @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(
|
||||
chatId: IdChatIdentifier,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
||||
|
||||
|
@ -45,6 +45,6 @@ suspend fun TelegramBot.stopPoll(
|
|||
*/
|
||||
suspend fun TelegramBot.stopPoll(
|
||||
chat: Chat,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
||||
|
|
|
@ -3,10 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.answers
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
|
||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||
import dev.inmo.tgbotapi.types.CallbackQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.CallbackQueryId
|
||||
|
||||
suspend fun TelegramBot.answerCallbackQuery(
|
||||
callbackQueryId: CallbackQueryIdentifier,
|
||||
callbackQueryId: CallbackQueryId,
|
||||
text: String? = null,
|
||||
showAlert: Boolean? = null,
|
||||
url: String? = null,
|
||||
|
|
|
@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.answers.AnswerInlineQuery
|
|||
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineQueryId
|
||||
|
||||
suspend fun TelegramBot.answerInlineQuery(
|
||||
inlineQueryID: InlineQueryIdentifier,
|
||||
inlineQueryID: InlineQueryId,
|
||||
results: List<InlineQueryResult> = emptyList(),
|
||||
cachedTime: Int? = null,
|
||||
isPersonal: Boolean? = null,
|
||||
|
@ -37,7 +37,7 @@ suspend fun TelegramBot.answer(
|
|||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
||||
|
||||
suspend fun TelegramBot.answerInlineQuery(
|
||||
inlineQueryID: InlineQueryIdentifier,
|
||||
inlineQueryID: InlineQueryId,
|
||||
results: List<InlineQueryResult> = emptyList(),
|
||||
cachedTime: Int? = null,
|
||||
isPersonal: Boolean? = null,
|
||||
|
|
|
@ -3,12 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.answers.payments
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryError
|
||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryOk
|
||||
import dev.inmo.tgbotapi.types.ShippingQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.ShippingQueryId
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
|
||||
suspend fun TelegramBot.answerShippingQueryOk(
|
||||
id: ShippingQueryIdentifier,
|
||||
id: ShippingQueryId,
|
||||
shippingOptions: List<ShippingOption>
|
||||
) = execute(AnswerShippingQueryOk(id, shippingOptions))
|
||||
suspend fun TelegramBot.answerShippingQueryOk(
|
||||
|
@ -17,7 +17,7 @@ suspend fun TelegramBot.answerShippingQueryOk(
|
|||
) = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
||||
|
||||
suspend fun TelegramBot.answerShippingQueryError(
|
||||
id: ShippingQueryIdentifier,
|
||||
id: ShippingQueryId,
|
||||
error: String
|
||||
) = execute(AnswerShippingQueryError(id, error))
|
||||
suspend fun TelegramBot.answerShippingQueryError(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||
|
@ -8,10 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||
|
||||
suspend fun TelegramBot.deleteMyCommands(
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: IetfLanguageCode?
|
||||
languageCode: IetfLang?
|
||||
) = execute(DeleteMyCommands(scope, languageCode))
|
||||
|
||||
suspend fun TelegramBot.deleteMyCommands(
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: String? = null
|
||||
) = deleteMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||
) = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||
|
@ -8,10 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||
|
||||
suspend fun TelegramBot.getMyCommands(
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(GetMyCommands(scope, languageCode))
|
||||
|
||||
suspend fun TelegramBot.getMyCommands(
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: String?
|
||||
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||
) = getMyCommands(scope, languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
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(
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(GetMyDescription(languageCode))
|
||||
|
||||
suspend fun TelegramBot.getMyDescription(
|
||||
languageCode: String?
|
||||
) = getMyDescription(languageCode ?.let(::IetfLanguageCode))
|
||||
) = getMyDescription(languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
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(
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(GetMyName(languageCode))
|
||||
|
||||
suspend fun TelegramBot.getMyName(
|
||||
languageCode: String?
|
||||
) = getMyName(languageCode ?.let(::IetfLanguageCode))
|
||||
) = getMyName(languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
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
|
||||
|
||||
suspend fun TelegramBot.getMyShortDescription(
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(GetMyShortDescription(languageCode))
|
||||
|
||||
suspend fun TelegramBot.getMyShortDescription(
|
||||
languageCode: String?
|
||||
) = getMyShortDescription(languageCode ?.let(::IetfLanguageCode))
|
||||
) = getMyShortDescription(languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
||||
import dev.inmo.tgbotapi.types.BotCommand
|
||||
|
@ -10,20 +10,20 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||
suspend fun TelegramBot.setMyCommands(
|
||||
commands: List<BotCommand>,
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: IetfLanguageCode?
|
||||
languageCode: IetfLang?
|
||||
) = execute(SetMyCommands(commands, scope, languageCode))
|
||||
|
||||
suspend fun TelegramBot.setMyCommands(
|
||||
vararg commands: BotCommand,
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: IetfLanguageCode?
|
||||
languageCode: IetfLang?
|
||||
) = setMyCommands(commands.toList(), scope, languageCode)
|
||||
|
||||
suspend fun TelegramBot.setMyCommands(
|
||||
commands: List<BotCommand>,
|
||||
scope: BotCommandScope = BotCommandScopeDefault,
|
||||
languageCode: String? = null
|
||||
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLanguageCode))
|
||||
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
|
||||
|
||||
suspend fun TelegramBot.setMyCommands(
|
||||
vararg commands: BotCommand,
|
||||
|
|
|
@ -2,17 +2,17 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||
|
||||
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
||||
rights: ChatAdministratorRightsImpl,
|
||||
rights: ChatCommonAdministratorRights,
|
||||
forChannels: Boolean? = null
|
||||
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
||||
|
||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
||||
rights: ChatAdministratorRightsImpl
|
||||
rights: ChatCommonAdministratorRights
|
||||
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
||||
|
||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
||||
rights: ChatAdministratorRightsImpl
|
||||
rights: ChatCommonAdministratorRights
|
||||
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
||||
|
@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||
|
||||
suspend fun TelegramBot.setMyDescription(
|
||||
description: String? = null,
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(SetMyDescription(description, languageCode))
|
||||
|
||||
suspend fun TelegramBot.setMyDescription(
|
||||
description: String?,
|
||||
languageCode: String?
|
||||
) = setMyDescription(description, languageCode ?.let(::IetfLanguageCode))
|
||||
) = setMyDescription(description, languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
||||
|
@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||
|
||||
suspend fun TelegramBot.setMyName(
|
||||
name: String? = null,
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(SetMyName(name, languageCode))
|
||||
|
||||
suspend fun TelegramBot.setMyName(
|
||||
name: String?,
|
||||
languageCode: String?
|
||||
) = setMyName(name, languageCode ?.let(::IetfLanguageCode))
|
||||
) = setMyName(name, languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.bot
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
||||
|
||||
suspend fun TelegramBot.setMyShortDescription(
|
||||
shortDescription: String? = null,
|
||||
languageCode: IetfLanguageCode? = null
|
||||
languageCode: IetfLang? = null
|
||||
) = execute(SetMyShortDescription(shortDescription, languageCode))
|
||||
|
||||
suspend fun TelegramBot.setMyShortDescription(
|
||||
shortDescription: String?,
|
||||
languageCode: String?
|
||||
) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLanguageCode))
|
||||
) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
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
|
||||
)
|
|
@ -0,0 +1,116 @@
|
|||
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,14 +1,13 @@
|
|||
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.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.*
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
userId: UserId,
|
||||
|
@ -24,27 +23,34 @@ suspend fun TelegramBot.promoteChatMember(
|
|||
canPromoteMembers: Boolean? = null,
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
) = execute(
|
||||
PromoteChatMember(
|
||||
chatId,
|
||||
userId,
|
||||
untilDate,
|
||||
isAnonymous,
|
||||
canChangeInfo,
|
||||
canPostMessages,
|
||||
canEditMessages,
|
||||
canDeleteMessages,
|
||||
canInviteUsers,
|
||||
canRestrictMembers,
|
||||
canPinMessages,
|
||||
canPromoteMembers,
|
||||
canManageVideoChats,
|
||||
canManageChat,
|
||||
canManageTopics
|
||||
chatId = chatId,
|
||||
userId = userId,
|
||||
untilDate = untilDate,
|
||||
isAnonymous = isAnonymous,
|
||||
canChangeInfo = canChangeInfo,
|
||||
canPostMessages = canPostMessages,
|
||||
canEditMessages = canEditMessages,
|
||||
canDeleteMessages = canDeleteMessages,
|
||||
canInviteUsers = canInviteUsers,
|
||||
canRestrictMembers = canRestrictMembers,
|
||||
canPinMessages = canPinMessages,
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
)
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chat: PublicChat,
|
||||
userId: UserId,
|
||||
|
@ -60,25 +66,32 @@ suspend fun TelegramBot.promoteChatMember(
|
|||
canPromoteMembers: Boolean? = null,
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
) = promoteChatMember(
|
||||
chat.id,
|
||||
userId,
|
||||
untilDate,
|
||||
isAnonymous,
|
||||
canChangeInfo,
|
||||
canPostMessages,
|
||||
canEditMessages,
|
||||
canDeleteMessages,
|
||||
canInviteUsers,
|
||||
canRestrictMembers,
|
||||
canPinMessages,
|
||||
canPromoteMembers,
|
||||
canManageVideoChats,
|
||||
canManageChat,
|
||||
canManageTopics
|
||||
untilDate = untilDate,
|
||||
isAnonymous = isAnonymous,
|
||||
canChangeInfo = canChangeInfo,
|
||||
canPostMessages = canPostMessages,
|
||||
canEditMessages = canEditMessages,
|
||||
canDeleteMessages = canDeleteMessages,
|
||||
canInviteUsers = canInviteUsers,
|
||||
canRestrictMembers = canRestrictMembers,
|
||||
canPinMessages = canPinMessages,
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chatId: IdChatIdentifier,
|
||||
user: User,
|
||||
|
@ -94,25 +107,32 @@ suspend fun TelegramBot.promoteChatMember(
|
|||
canPromoteMembers: Boolean? = null,
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
) = promoteChatMember(
|
||||
chatId,
|
||||
user.id,
|
||||
untilDate,
|
||||
isAnonymous,
|
||||
canChangeInfo,
|
||||
canPostMessages,
|
||||
canEditMessages,
|
||||
canDeleteMessages,
|
||||
canInviteUsers,
|
||||
canRestrictMembers,
|
||||
canPinMessages,
|
||||
canPromoteMembers,
|
||||
canManageVideoChats,
|
||||
canManageChat,
|
||||
canManageTopics
|
||||
untilDate = untilDate,
|
||||
isAnonymous = isAnonymous,
|
||||
canChangeInfo = canChangeInfo,
|
||||
canPostMessages = canPostMessages,
|
||||
canEditMessages = canEditMessages,
|
||||
canDeleteMessages = canDeleteMessages,
|
||||
canInviteUsers = canInviteUsers,
|
||||
canRestrictMembers = canRestrictMembers,
|
||||
canPinMessages = canPinMessages,
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chat: PublicChat,
|
||||
user: User,
|
||||
|
@ -128,21 +148,27 @@ suspend fun TelegramBot.promoteChatMember(
|
|||
canPromoteMembers: Boolean? = null,
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null
|
||||
canManageTopics: Boolean? = null,
|
||||
canPostStories: Boolean? = null,
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null
|
||||
) = promoteChatMember(
|
||||
chat.id,
|
||||
user.id,
|
||||
untilDate,
|
||||
isAnonymous,
|
||||
canChangeInfo,
|
||||
canPostMessages,
|
||||
canEditMessages,
|
||||
canDeleteMessages,
|
||||
canInviteUsers,
|
||||
canRestrictMembers,
|
||||
canPinMessages,
|
||||
canPromoteMembers,
|
||||
canManageVideoChats,
|
||||
canManageChat,
|
||||
canManageTopics
|
||||
untilDate = untilDate,
|
||||
isAnonymous = isAnonymous,
|
||||
canChangeInfo = canChangeInfo,
|
||||
canPostMessages = canPostMessages,
|
||||
canEditMessages = canEditMessages,
|
||||
canDeleteMessages = canDeleteMessages,
|
||||
canInviteUsers = canInviteUsers,
|
||||
canRestrictMembers = canRestrictMembers,
|
||||
canPinMessages = canPinMessages,
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
)
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
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.MessageId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
suspend fun TelegramBot.pinChatMessage(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -20,6 +20,6 @@ suspend fun TelegramBot.pinChatMessage(
|
|||
) = pinChatMessage(chat.id, messageId, disableNotification)
|
||||
|
||||
suspend fun TelegramBot.pinChatMessage(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
disableNotification: Boolean = false
|
||||
) = 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.MessageId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
suspend fun TelegramBot.unpinChatMessage(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -18,5 +18,5 @@ suspend fun TelegramBot.unpinChatMessage(
|
|||
) = unpinChatMessage(chat.id, messageId)
|
||||
|
||||
suspend fun TelegramBot.unpinChatMessage(
|
||||
message: Message
|
||||
message: AccessibleMessage
|
||||
) = 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.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
|
@ -29,9 +29,10 @@ suspend fun <T> TelegramBot.edit(
|
|||
message: ContentMessage<T>,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||
return editMessageCaption(message, text, parseMode, replyMarkup)
|
||||
return editMessageCaption(message, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,9 +42,10 @@ suspend fun <T> TelegramBot.edit(
|
|||
suspend fun <T> TelegramBot.edit(
|
||||
message: ContentMessage<T>,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||
return editMessageCaption(message, entities, replyMarkup)
|
||||
return editMessageCaption(message, entities, showCaptionAboveMedia, replyMarkup)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,11 +57,12 @@ suspend fun TelegramBot.edit(
|
|||
messageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -70,11 +73,12 @@ suspend fun TelegramBot.edit(
|
|||
messageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -84,11 +88,12 @@ suspend fun TelegramBot.edit(
|
|||
message: ContentMessage<LocationContent>,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -181,7 +186,7 @@ suspend fun TelegramBot.edit(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageReplyMarkup(message, replyMarkup)
|
||||
|
||||
|
@ -194,9 +199,9 @@ suspend fun TelegramBot.edit(
|
|||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -206,9 +211,9 @@ suspend fun TelegramBot.edit(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -218,10 +223,10 @@ suspend fun TelegramBot.edit(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -231,10 +236,10 @@ suspend fun TelegramBot.edit(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -244,9 +249,9 @@ suspend fun TelegramBot.edit(
|
|||
message: ContentMessage<TextContent>,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = edit(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
) = edit(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -255,9 +260,9 @@ suspend fun TelegramBot.edit(
|
|||
suspend fun TelegramBot.edit(
|
||||
message: ContentMessage<TextContent>,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = edit(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -266,10 +271,10 @@ suspend fun TelegramBot.edit(
|
|||
suspend fun TelegramBot.edit(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -278,10 +283,10 @@ suspend fun TelegramBot.edit(
|
|||
suspend fun TelegramBot.edit(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -290,10 +295,10 @@ suspend fun TelegramBot.edit(
|
|||
suspend fun TelegramBot.editMessageText(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -302,7 +307,7 @@ suspend fun TelegramBot.editMessageText(
|
|||
suspend fun TelegramBot.editMessageText(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
|
|
@ -1,21 +1,15 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.edit
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.TextedWithTextSources
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.caption.editMessageCaption
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
|
@ -26,7 +20,7 @@ import dev.inmo.tgbotapi.utils.buildEntities
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
|
@ -40,7 +34,7 @@ suspend fun TelegramBot.edit(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
location: LiveLocation,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(
|
||||
|
@ -52,7 +46,7 @@ suspend fun TelegramBot.edit(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
media: TelegramMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageMedia(messageId, media, replyMarkup)
|
||||
|
@ -62,7 +56,7 @@ suspend fun TelegramBot.edit(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageReplyMarkup(messageId, replyMarkup)
|
||||
|
||||
|
@ -71,44 +65,48 @@ suspend fun TelegramBot.edit(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.edit(
|
||||
messageId: InlineMessageIdentifier,
|
||||
messageId: InlineMessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = edit(messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
|
|
@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
|||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MediaContent
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
|
@ -24,9 +24,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
|
||||
EditChatMessageCaption(chatId, messageId, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -38,8 +39,9 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
|
||||
) = editMessageCaption(chat.id, messageId, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -49,10 +51,11 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||
message: ContentMessage<T>,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) as ContentMessage<T>
|
||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,9 +66,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
|
||||
EditChatMessageCaption(chatId, messageId, entities, showCaptionAboveMedia, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -76,8 +80,9 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
||||
) = editMessageCaption(chat.id, messageId, entities, showCaptionAboveMedia, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -86,10 +91,11 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
suspend fun <T> TelegramBot.editMessageCaption(
|
||||
message: ContentMessage<T>,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) as ContentMessage<T>
|
||||
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,9 +104,10 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||
*/
|
||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
|
||||
suspend fun <T> TelegramBot.editMessageCaption(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
||||
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup)
|
||||
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.caption
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.caption.EditInlineMessageCaption
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
|
@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageCaption(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
|
@ -23,7 +23,7 @@ suspend fun TelegramBot.editMessageCaption(
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageCaption(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
entities: TextSourcesList,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))
|
||||
|
|
|
@ -18,13 +18,14 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
messageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageLiveLocation(
|
||||
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
|
||||
chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -37,11 +38,12 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
messageId: MessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -51,11 +53,12 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
message: ContentMessage<LocationContent>,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds? = null,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -68,7 +71,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageLiveLocation(
|
||||
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
|
||||
chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -81,7 +84,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
messageId: MessageId,
|
||||
location: LiveLocation,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -91,4 +94,4 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
message: ContentMessage<LocationContent>,
|
||||
location: LiveLocation,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||
|
|
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
|
||||
suspend fun TelegramBot.editLiveLocation(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
|
@ -20,7 +20,7 @@ suspend fun TelegramBot.editLiveLocation(
|
|||
)
|
||||
)
|
||||
suspend fun TelegramBot.editLiveLocation(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
location: LiveLocation,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||
|
|
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.location.live
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.location.live.StopInlineMessageLiveLocation
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.stopLiveLocation(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
StopInlineMessageLiveLocation(
|
||||
|
|
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.media
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.media.EditInlineMessageMedia
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
|
||||
|
@ -11,7 +11,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageMedia(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
media: TelegramMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
||||
|
|
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageReplyMarkup(message.chat.id, message.messageId, replyMarkup)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.edit.reply_markup
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditInlineMessageReplyMarkup
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
|
||||
/**
|
||||
|
@ -10,6 +10,6 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(EditInlineMessageReplyMarkup(inlineMessageId, replyMarkup))
|
||||
|
|
|
@ -3,13 +3,14 @@ package dev.inmo.tgbotapi.extensions.api.edit.text
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.text.EditChatMessageText
|
||||
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.MessageId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.utils.*
|
||||
|
@ -23,10 +24,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
EditChatMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -38,9 +39,9 @@ suspend fun TelegramBot.editMessageText(
|
|||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chat.id, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -50,9 +51,9 @@ suspend fun TelegramBot.editMessageText(
|
|||
message: ContentMessage<TextContent>,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -62,10 +63,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
EditChatMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -76,10 +77,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -89,10 +90,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -102,9 +103,9 @@ suspend fun TelegramBot.editMessageText(
|
|||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chat.id, messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -114,10 +115,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -127,10 +128,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
chat: Chat,
|
||||
messageId: MessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(chat.id, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -139,9 +140,9 @@ suspend fun TelegramBot.editMessageText(
|
|||
suspend fun TelegramBot.editMessageText(
|
||||
message: ContentMessage<TextContent>,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -150,10 +151,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
suspend fun TelegramBot.editMessageText(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -162,10 +163,10 @@ suspend fun TelegramBot.editMessageText(
|
|||
suspend fun TelegramBot.editMessageText(
|
||||
message: ContentMessage<TextContent>,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -173,11 +174,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")
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = editMessageText(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -185,12 +186,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")
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -198,9 +199,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")
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(message.chat.id, message.messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
|
|
|
@ -2,7 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.edit.text
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.text.EditInlineMessageText
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineMessageId
|
||||
import dev.inmo.tgbotapi.types.LinkPreviewOptions
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
|
@ -15,44 +16,48 @@ import dev.inmo.tgbotapi.utils.buildEntities
|
|||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, disableWebPagePreview, replyMarkup))
|
||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(EditInlineMessageText(inlineMessageId, entities, disableWebPagePreview, replyMarkup))
|
||||
) = execute(EditInlineMessageText(inlineMessageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup))
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.editMessageText(
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||
) = editMessageText(inlineMessageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||
|
|
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.chat.CommonUser
|
|||
|
||||
suspend fun TelegramBot.getGameScore(
|
||||
userId: UserId,
|
||||
inlineMessageId: InlineMessageIdentifier
|
||||
inlineMessageId: InlineMessageId
|
||||
) = execute(
|
||||
GetGameHighScoresByInlineMessageId(
|
||||
userId, inlineMessageId
|
||||
|
@ -16,5 +16,5 @@ suspend fun TelegramBot.getGameScore(
|
|||
|
||||
suspend fun TelegramBot.getGameScore(
|
||||
user: CommonUser,
|
||||
inlineMessageId: InlineMessageIdentifier
|
||||
inlineMessageId: InlineMessageId
|
||||
) = getGameScore(user.id, inlineMessageId)
|
||||
|
|
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.chat.CommonUser
|
|||
suspend fun TelegramBot.setGameScore(
|
||||
userId: UserId,
|
||||
score: Long,
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
force: Boolean = false,
|
||||
disableEditMessage: Boolean = false
|
||||
) = execute(
|
||||
|
@ -20,7 +20,7 @@ suspend fun TelegramBot.setGameScore(
|
|||
suspend fun TelegramBot.setGameScore(
|
||||
user: CommonUser,
|
||||
score: Long,
|
||||
inlineMessageId: InlineMessageIdentifier,
|
||||
inlineMessageId: InlineMessageId,
|
||||
force: Boolean = false,
|
||||
disableEditMessage: Boolean = false
|
||||
) = setGameScore(user.id, score, inlineMessageId, force, disableEditMessage)
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.get
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.get.GetBusinessConnection
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
suspend fun TelegramBot.getBusinessConnection(
|
||||
id: BusinessConnectionId
|
||||
) = execute(GetBusinessConnection(businessConnectionId = id))
|
||||
|
||||
@Warning("This method may lead to error due to raw String type usage")
|
||||
suspend fun TelegramBot.getBusinessConnection(
|
||||
id: String
|
||||
) = getBusinessConnection(
|
||||
BusinessConnectionId(id)
|
||||
)
|
|
@ -2,14 +2,21 @@ package dev.inmo.tgbotapi.extensions.api.get
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.files.Sticker
|
||||
|
||||
suspend fun TelegramBot.getStickerSet(
|
||||
name: String
|
||||
name: StickerSetName
|
||||
) = execute(
|
||||
GetStickerSet(name)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.getStickerSet(
|
||||
name: String
|
||||
) = getStickerSet(
|
||||
StickerSetName(name)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.getStickerSetOrNull(
|
||||
sticker: Sticker
|
||||
) = sticker.stickerSetName ?.let {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
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,15 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
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.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -22,11 +19,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChatId: ChatIdentifier,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
CopyMessage(
|
||||
|
@ -35,11 +32,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChatId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -54,13 +51,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChatId: ChatIdentifier,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -72,13 +69,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChat: Chat,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -90,13 +87,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChat: Chat,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -108,11 +105,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
toChatId: ChatIdentifier,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
CopyMessage(
|
||||
|
@ -120,11 +117,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId,
|
||||
toChatId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -138,13 +135,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
toChatId: ChatIdentifier,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChat.id, messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -155,13 +152,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
toChat: Chat,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChatId, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -172,13 +169,13 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
toChat: Chat,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(fromChat.id, messageId, toChat.id, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -186,16 +183,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
*/
|
||||
suspend inline fun TelegramBot.copyMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -203,16 +200,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
*/
|
||||
suspend inline fun TelegramBot.copyMessage(
|
||||
toChat: Chat,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -220,15 +217,15 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
*/
|
||||
suspend inline fun TelegramBot.copyMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(message.chat, message.messageId, toChatId, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -236,15 +233,15 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
*/
|
||||
suspend inline fun TelegramBot.copyMessage(
|
||||
toChat: Chat,
|
||||
message: Message,
|
||||
message: AccessibleMessage,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = copyMessage(message.chat, message.messageId, toChat, entities, showCaptionAboveMedia, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -256,11 +253,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
CopyMessage(
|
||||
|
@ -269,11 +266,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
toChatId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -288,11 +285,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChatId,
|
||||
|
@ -300,11 +297,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -318,11 +315,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChat.id,
|
||||
|
@ -330,11 +327,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -348,11 +345,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId: MessageId,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChat.id,
|
||||
|
@ -360,11 +357,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -378,11 +375,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
fromChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
CopyMessage(
|
||||
|
@ -390,11 +387,11 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
messageId,
|
||||
toChatId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -408,22 +405,22 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
fromChat: Chat,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChatId,
|
||||
fromChat.id,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -436,22 +433,22 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
fromChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChat.id,
|
||||
fromChatId,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -464,21 +461,21 @@ suspend inline fun TelegramBot.copyMessage(
|
|||
fromChat: Chat,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = copyMessage(
|
||||
toChat.id,
|
||||
fromChat.id,
|
||||
messageId,
|
||||
entities,
|
||||
showCaptionAboveMedia,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
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,
|
||||
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,
|
||||
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,14 +1,11 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* This method will send [content] to the [chatId] as is
|
||||
|
@ -19,8 +16,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
content.createResend(
|
||||
|
@ -28,14 +25,14 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
) as ContentMessage<T>
|
||||
|
||||
/**
|
||||
* This method will send [content] to the [chatId] as is
|
||||
* This method will send [content] to the [chat] as is
|
||||
*/
|
||||
suspend inline fun <T : MessageContent> TelegramBot.resend(
|
||||
chat: Chat,
|
||||
|
@ -43,8 +40,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = resend(
|
||||
chatId = chat.id,
|
||||
|
@ -52,8 +49,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
@ -68,8 +65,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = resend(
|
||||
chatId = chatId,
|
||||
|
@ -77,8 +74,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
@ -93,8 +90,8 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = resend(
|
||||
chatId = chat.id,
|
||||
|
@ -102,7 +99,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
|
|||
messageThreadId = messageThreadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
|
@ -5,127 +5,152 @@ import dev.inmo.tgbotapi.requests.send.SendAction
|
|||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
suspend fun TelegramBot.sendBotAction(
|
||||
chatId: ChatIdentifier,
|
||||
action: BotAction,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = execute(
|
||||
SendAction(chatId, action, threadId)
|
||||
SendAction(chatId, action, threadId, businessConnectionId)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendBotAction(
|
||||
chat: Chat,
|
||||
action: BotAction,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat.id, action, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat.id, action, threadId, businessConnectionId)
|
||||
|
||||
|
||||
suspend fun TelegramBot.sendActionTyping(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, TypingAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, TypingAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, UploadPhotoAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, UploadPhotoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVideo(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, RecordVideoAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, RecordVideoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVideo(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, UploadVideoAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, UploadVideoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVoice(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, RecordVoiceAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, RecordVoiceAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVoice(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, UploadVoiceAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, UploadVoiceAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadDocument(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, UploadDocumentAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, UploadDocumentAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionFindLocation(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, FindLocationAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, FindLocationAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, RecordVideoNoteAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
) = sendBotAction(chatId, UploadVideoNoteAction, threadId)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
) = sendBotAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId)
|
||||
|
||||
|
||||
suspend fun TelegramBot.sendActionTyping(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, TypingAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, TypingAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadPhoto(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, UploadPhotoAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, UploadPhotoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVideo(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, RecordVideoAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, RecordVideoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVideo(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, UploadVideoAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, UploadVideoAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVoice(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, RecordVoiceAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, RecordVoiceAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVoice(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, UploadVoiceAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, UploadVoiceAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadDocument(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, UploadDocumentAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, UploadDocumentAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionFindLocation(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, FindLocationAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, FindLocationAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVideoNote(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, RecordVideoNoteAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, RecordVideoNoteAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionUploadVideoNote(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, UploadVideoNoteAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, UploadVideoNoteAction, threadId, businessConnectionId)
|
||||
|
||||
suspend fun TelegramBot.sendActionChooseStickerAction(
|
||||
chat: Chat,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
) = sendBotAction(chat, ChooseStickerAction, threadId)
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||
) = sendBotAction(chat, ChooseStickerAction, threadId, businessConnectionId)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import kotlinx.coroutines.*
|
||||
import kotlin.contracts.*
|
||||
|
@ -39,13 +40,14 @@ suspend fun <T> TelegramBot.withAction(
|
|||
chatId: IdChatIdentifier,
|
||||
action: BotAction,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
block: TelegramBotActionCallback<T>
|
||||
): T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(
|
||||
SendAction(chatId, action, threadId),
|
||||
SendAction(chatId, action, threadId, businessConnectionId),
|
||||
block
|
||||
)
|
||||
}
|
||||
|
@ -55,6 +57,7 @@ suspend fun <T> TelegramBot.withAction(
|
|||
chat: Chat,
|
||||
action: BotAction,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
block: TelegramBotActionCallback<T>
|
||||
): T {
|
||||
contract {
|
||||
|
@ -64,163 +67,164 @@ suspend fun <T> TelegramBot.withAction(
|
|||
chat.id,
|
||||
action,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
block
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withTypingAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, TypingAction, threadId, block)
|
||||
return withAction(chatId, TypingAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadPhotoAction, threadId, block)
|
||||
return withAction(chatId, UploadPhotoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVideoAction, threadId, block)
|
||||
return withAction(chatId, RecordVideoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVideoAction, threadId, block)
|
||||
return withAction(chatId, UploadVideoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVoiceAction, threadId, block)
|
||||
return withAction(chatId, RecordVoiceAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVoiceAction, threadId, block)
|
||||
return withAction(chatId, UploadVoiceAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadDocumentAction, threadId, block)
|
||||
return withAction(chatId, UploadDocumentAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, FindLocationAction, threadId, block)
|
||||
return withAction(chatId, FindLocationAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, RecordVideoNoteAction, threadId, block)
|
||||
return withAction(chatId, RecordVideoNoteAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, UploadVideoNoteAction, threadId, block)
|
||||
return withAction(chatId, UploadVideoNoteAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: IdChatIdentifier, threadId: MessageThreadId? = chatId.threadId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chatId, ChooseStickerAction, threadId, block)
|
||||
return withAction(chatId, ChooseStickerAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, TypingAction, threadId, block)
|
||||
return withAction(chat, TypingAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, UploadPhotoAction, threadId, block)
|
||||
return withAction(chat, UploadPhotoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, RecordVideoAction, threadId, block)
|
||||
return withAction(chat, RecordVideoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, UploadVideoAction, threadId, block)
|
||||
return withAction(chat, UploadVideoAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, RecordVoiceAction, threadId, block)
|
||||
return withAction(chat, RecordVoiceAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, UploadVoiceAction, threadId, block)
|
||||
return withAction(chat, UploadVoiceAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, UploadDocumentAction, threadId, block)
|
||||
return withAction(chat, UploadDocumentAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, FindLocationAction, threadId, block)
|
||||
return withAction(chat, FindLocationAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, RecordVideoNoteAction, threadId, block)
|
||||
return withAction(chat, RecordVideoNoteAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, UploadVideoNoteAction, threadId, block)
|
||||
return withAction(chat, UploadVideoNoteAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId,block: TelegramBotActionCallback<T>) : T {
|
||||
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, threadId: MessageThreadId? = chat.id.threadId, businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, block: TelegramBotActionCallback<T>) : T {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
return withAction(chat, ChooseStickerAction, threadId, block)
|
||||
return withAction(chat, ChooseStickerAction, threadId, businessConnectionId, block)
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendContact
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
|
@ -16,14 +17,15 @@ suspend fun TelegramBot.sendContact(
|
|||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendContact(
|
||||
chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -35,14 +37,15 @@ suspend fun TelegramBot.sendContact(
|
|||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendContact(
|
||||
chatId, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -56,13 +59,14 @@ suspend fun TelegramBot.sendContact(
|
|||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendContact(
|
||||
chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chat.id, phoneNumber, firstName, lastName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -73,11 +77,12 @@ suspend fun TelegramBot.sendContact(
|
|||
chat: Chat,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendContact(
|
||||
chat.id, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chat.id, contact, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
|
|
@ -2,13 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendDice
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
|
@ -18,13 +16,14 @@ suspend fun TelegramBot.sendDice(
|
|||
chatId: ChatIdentifier,
|
||||
animationType: DiceAnimationType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
SendDice(chatId, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -35,9 +34,10 @@ suspend fun TelegramBot.sendDice(
|
|||
chat: Chat,
|
||||
animationType: DiceAnimationType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendDice(chat.id, animationType, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
|
@ -20,10 +21,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendLiveLocation(
|
||||
|
@ -35,10 +37,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -55,10 +58,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chatId,
|
||||
|
@ -69,10 +73,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -89,10 +94,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chat.id,
|
||||
|
@ -103,10 +109,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -122,25 +129,27 @@ suspend fun TelegramBot.sendLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chat.id,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
livePeriod,
|
||||
horizontalAccuracy,
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -156,12 +165,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -175,12 +185,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -195,12 +206,13 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -214,9 +226,10 @@ suspend fun TelegramBot.sendLiveLocation(
|
|||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
|
@ -19,24 +20,26 @@ suspend fun TelegramBot.sendMessage(
|
|||
chatId: ChatIdentifier,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendTextMessage(
|
||||
chatId,
|
||||
text,
|
||||
parseMode,
|
||||
disableWebPagePreview,
|
||||
linkPreviewOptions,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -49,15 +52,16 @@ suspend fun TelegramBot.sendTextMessage(
|
|||
chatId: ChatIdentifier,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendMessage(
|
||||
chatId, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -68,14 +72,15 @@ suspend fun TelegramBot.sendTextMessage(
|
|||
chat: Chat,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendTextMessage(chat.id, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -86,14 +91,15 @@ suspend fun TelegramBot.sendMessage(
|
|||
chat: Chat,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendMessage(chat.id, text, parseMode, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -102,51 +108,54 @@ suspend fun TelegramBot.sendMessage(
|
|||
suspend fun TelegramBot.sendMessage(
|
||||
chatId: ChatIdentifier,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendTextMessage(chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
SendTextMessage(chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendMessage(
|
||||
chatId: ChatIdentifier,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendMessage(
|
||||
chatId: ChatIdentifier,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -155,51 +164,54 @@ suspend fun TelegramBot.sendMessage(
|
|||
suspend fun TelegramBot.sendTextMessage(
|
||||
chatId: ChatIdentifier,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendMessage(
|
||||
chatId, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendTextMessage(
|
||||
chatId: ChatIdentifier,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendTextMessage(
|
||||
chatId: ChatIdentifier,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -208,49 +220,52 @@ suspend fun TelegramBot.sendTextMessage(
|
|||
suspend fun TelegramBot.sendMessage(
|
||||
chat: Chat,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendMessage(chat.id, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendMessage(
|
||||
chat: Chat,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendMessage(
|
||||
chat: Chat,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -260,46 +275,49 @@ suspend fun TelegramBot.sendMessage(
|
|||
suspend fun TelegramBot.sendTextMessage(
|
||||
chat: Chat,
|
||||
entities: TextSourcesList,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendTextMessage(chat.id, entities, disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendTextMessage(
|
||||
chat: Chat,
|
||||
separator: TextSource? = null,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* @param replyMarkup Some [dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendTextMessage(
|
||||
chat: Chat,
|
||||
separator: String,
|
||||
disableWebPagePreview: Boolean? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), disableWebPagePreview, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -2,13 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
|
@ -19,10 +17,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendStaticLocation(
|
||||
|
@ -30,10 +29,11 @@ suspend fun TelegramBot.sendLocation(
|
|||
latitude,
|
||||
longitude,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyToMessageId = replyToMessageId,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -46,20 +46,22 @@ suspend fun TelegramBot.sendLocation(
|
|||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chatId,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowSendingWithoutReply,
|
||||
replyToMessageId,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -72,20 +74,22 @@ suspend fun TelegramBot.sendLocation(
|
|||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chat.id,
|
||||
latitude,
|
||||
longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowSendingWithoutReply,
|
||||
replyToMessageId,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -97,20 +101,22 @@ suspend fun TelegramBot.sendLocation(
|
|||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(
|
||||
chat.id,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowSendingWithoutReply,
|
||||
replyToMessageId,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
|
@ -123,12 +129,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||
) = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -138,12 +145,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||
) = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -154,12 +162,13 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||
) = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -169,9 +178,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyToMessageId: MessageId? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup)
|
||||
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.send
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendVenue
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
|
@ -23,10 +24,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVenue(
|
||||
|
@ -40,10 +42,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -63,10 +66,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVenue(
|
||||
chatId = chat.id,
|
||||
|
@ -79,10 +83,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
@ -100,10 +105,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVenue(
|
||||
chatId = chatId,
|
||||
|
@ -116,10 +122,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
@ -137,10 +144,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVenue(
|
||||
chatId = chat.id,
|
||||
|
@ -153,10 +161,11 @@ suspend fun TelegramBot.sendVenue(
|
|||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
@ -168,20 +177,22 @@ suspend fun TelegramBot.sendVenue(
|
|||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVenue(
|
||||
chatId = chatId,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -194,18 +205,20 @@ suspend fun TelegramBot.sendVenue(
|
|||
chat: Chat,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVenue(
|
||||
chatId = chat.id,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyToMessageId = replyToMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,121 @@
|
|||
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.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,13 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send.games
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.games.SendGame
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
|
@ -18,14 +16,15 @@ suspend fun TelegramBot.sendGame(
|
|||
chatId: ChatIdentifier,
|
||||
gameShortName: String,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendGame(
|
||||
chatId, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -37,13 +36,14 @@ suspend fun TelegramBot.sendGame(
|
|||
chat: Chat,
|
||||
gameShortName: String,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendGame(
|
||||
chat.id, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chat.id, gameShortName, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -54,13 +54,14 @@ suspend fun TelegramBot.sendGame(
|
|||
chatId: ChatIdentifier,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendGame(
|
||||
chatId, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -71,11 +72,12 @@ suspend fun TelegramBot.sendGame(
|
|||
chat: Chat,
|
||||
game: Game,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendGame(
|
||||
chat.id, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chat.id, game.title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -23,33 +21,37 @@ suspend fun TelegramBot.sendAnimation(
|
|||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendAnimation(
|
||||
chatId,
|
||||
animation,
|
||||
thumb,
|
||||
text,
|
||||
parseMode,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumbnail = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -62,18 +64,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||
animation: AnimationFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(
|
||||
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation.fileId,
|
||||
thumb = animation.thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -86,17 +106,37 @@ suspend fun TelegramBot.sendAnimation(
|
|||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAnimation(
|
||||
chatId = chat.id,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -107,17 +147,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||
animation: AnimationFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAnimation(
|
||||
chatId = chat.id,
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -129,32 +188,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendAnimation(
|
||||
chatId,
|
||||
animation,
|
||||
thumb,
|
||||
entities,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumbnail = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -166,18 +229,35 @@ suspend fun TelegramBot.sendAnimation(
|
|||
chatId: ChatIdentifier,
|
||||
animation: AnimationFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(
|
||||
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation.fileId,
|
||||
thumb = animation.thumbnail ?.fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -189,17 +269,36 @@ suspend fun TelegramBot.sendAnimation(
|
|||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAnimation(
|
||||
chatId = chat.id,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -209,14 +308,32 @@ suspend fun TelegramBot.sendAnimation(
|
|||
chat: Chat,
|
||||
animation: AnimationFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAnimation(
|
||||
chatId = chat.id,
|
||||
animation = animation,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -27,10 +25,11 @@ suspend fun TelegramBot.sendAudio(
|
|||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendAudio(
|
||||
|
@ -43,10 +42,11 @@ suspend fun TelegramBot.sendAudio(
|
|||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -65,12 +65,13 @@ suspend fun TelegramBot.sendAudio(
|
|||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -83,12 +84,13 @@ suspend fun TelegramBot.sendAudio(
|
|||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -101,12 +103,13 @@ suspend fun TelegramBot.sendAudio(
|
|||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chat.id, audio, text, parseMode, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -122,10 +125,11 @@ suspend inline fun TelegramBot.sendAudio(
|
|||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendAudio(
|
||||
|
@ -137,10 +141,11 @@ suspend inline fun TelegramBot.sendAudio(
|
|||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -158,12 +163,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -175,12 +181,13 @@ suspend inline fun TelegramBot.sendAudio(
|
|||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -192,9 +199,10 @@ suspend inline fun TelegramBot.sendAudio(
|
|||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendAudio(chat.id, audio, entities, title, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -24,10 +22,11 @@ suspend fun TelegramBot.sendDocument(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = execute(
|
||||
|
@ -38,10 +37,11 @@ suspend fun TelegramBot.sendDocument(
|
|||
text,
|
||||
parseMode,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup,
|
||||
disableContentTypeDetection
|
||||
)
|
||||
|
@ -58,13 +58,14 @@ suspend fun TelegramBot.sendDocument(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -76,14 +77,15 @@ suspend fun TelegramBot.sendDocument(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -96,13 +98,14 @@ suspend fun TelegramBot.sendDocument(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
) = sendDocument(chat.id, document, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -114,10 +117,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = execute(
|
||||
|
@ -127,10 +131,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||
thumb,
|
||||
entities,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup,
|
||||
disableContentTypeDetection
|
||||
)
|
||||
|
@ -146,13 +151,14 @@ suspend inline fun TelegramBot.sendDocument(
|
|||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
) = sendDocument(chat.id, document, thumb, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -163,14 +169,15 @@ suspend inline fun TelegramBot.sendDocument(
|
|||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -182,10 +189,11 @@ suspend inline fun TelegramBot.sendDocument(
|
|||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||
) = sendDocument(chat.id, document, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup, disableContentTypeDetection)
|
||||
|
|
|
@ -2,16 +2,14 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.media.*
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
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.message.content.MediaGroupPartContent
|
||||
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent
|
||||
import dev.inmo.tgbotapi.types.message.content.AudioContent
|
||||
import dev.inmo.tgbotapi.types.message.content.DocumentContent
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
|
@ -23,13 +21,14 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = execute(
|
||||
SendMediaGroup<MediaGroupPartContent>(
|
||||
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -41,12 +40,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||
chat: Chat,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendMediaGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -58,12 +58,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendMediaGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -75,12 +76,13 @@ suspend fun TelegramBot.sendMediaGroup(
|
|||
chat: Chat,
|
||||
media: List<MediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendMediaGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -90,13 +92,14 @@ suspend fun TelegramBot.sendPlaylist(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = execute(
|
||||
SendPlaylist(
|
||||
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -107,12 +110,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||
chat: Chat,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendPlaylist(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -123,12 +127,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<AudioContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendPlaylist(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -139,12 +144,13 @@ suspend fun TelegramBot.sendPlaylist(
|
|||
chat: Chat,
|
||||
media: List<AudioContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendPlaylist(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -154,13 +160,14 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = execute(
|
||||
SendDocumentsGroup(
|
||||
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -171,12 +178,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||
chat: Chat,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendDocumentsGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -187,12 +195,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<DocumentContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendDocumentsGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -203,12 +212,13 @@ suspend fun TelegramBot.sendDocumentsGroup(
|
|||
chat: Chat,
|
||||
media: List<DocumentContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendDocumentsGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -218,13 +228,14 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = execute(
|
||||
SendVisualMediaGroup(
|
||||
chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -235,12 +246,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||
chat: Chat,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendVisualMediaGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -251,12 +263,13 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendVisualMediaGroup(
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -267,10 +280,11 @@ suspend fun TelegramBot.sendVisualMediaGroup(
|
|||
chat: Chat,
|
||||
media: List<VisualMediaGroupPartContent>,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null
|
||||
) = sendVisualMediaGroup(
|
||||
chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply
|
||||
chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
|
||||
)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -22,26 +20,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
fileId: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendPhoto(
|
||||
chatId,
|
||||
fileId,
|
||||
text,
|
||||
parseMode,
|
||||
spoilered,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
photo = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -54,14 +56,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
fileId: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
fileId = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -72,14 +90,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
photo: Photo,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -90,14 +124,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
photo: Photo,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -108,14 +158,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
photoSize: PhotoSize,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = photoSize.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -126,14 +192,30 @@ suspend fun TelegramBot.sendPhoto(
|
|||
photoSize: PhotoSize,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
photoSize = photoSize,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -144,25 +226,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chatId: ChatIdentifier,
|
||||
fileId: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendPhoto(
|
||||
chatId,
|
||||
fileId,
|
||||
entities,
|
||||
spoilered,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
photo = fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -174,14 +260,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chat: Chat,
|
||||
fileId: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
fileId = fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -191,14 +292,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chatId: ChatIdentifier,
|
||||
photo: Photo,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = photo.biggest() ?.fileId ?: error("Photo content must not be empty"),
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -208,14 +324,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chat: Chat,
|
||||
photo: Photo,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
photo = photo,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -225,14 +356,29 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chatId: ChatIdentifier,
|
||||
photoSize: PhotoSize,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = photoSize.fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -242,11 +388,26 @@ suspend inline fun TelegramBot.sendPhoto(
|
|||
chat: Chat,
|
||||
photoSize: PhotoSize,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendPhoto(
|
||||
chatId = chat.id,
|
||||
photoSize = photoSize,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
|
@ -3,13 +3,11 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
|
@ -19,14 +17,15 @@ suspend fun TelegramBot.sendSticker(
|
|||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
SendSticker(chatId, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -37,13 +36,14 @@ suspend fun TelegramBot.sendSticker(
|
|||
chat: Chat,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendSticker(chat.id, sticker, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -53,13 +53,14 @@ suspend fun TelegramBot.sendSticker(
|
|||
chatId: ChatIdentifier,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendSticker(chatId, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -69,10 +70,11 @@ suspend fun TelegramBot.sendSticker(
|
|||
chat: Chat,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendSticker(chat, sticker.fileId, threadId, businessConnectionId, emoji, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VideoFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -23,34 +21,38 @@ suspend fun TelegramBot.sendVideo(
|
|||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVideo(
|
||||
chatId,
|
||||
video,
|
||||
thumb,
|
||||
text,
|
||||
parseMode,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
null,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumbnail = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = null,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -63,14 +65,34 @@ suspend fun TelegramBot.sendVideo(
|
|||
video: VideoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video.fileId,
|
||||
thumb = video.thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = video.duration,
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -82,17 +104,37 @@ suspend fun TelegramBot.sendVideo(
|
|||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chat.id,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -104,14 +146,30 @@ suspend fun TelegramBot.sendVideo(
|
|||
video: VideoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chat.id,
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -122,33 +180,37 @@ suspend inline fun TelegramBot.sendVideo(
|
|||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVideo(
|
||||
chatId,
|
||||
video,
|
||||
thumb,
|
||||
entities,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
null,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumbnail = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = null,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -160,14 +222,33 @@ suspend inline fun TelegramBot.sendVideo(
|
|||
chatId: ChatIdentifier,
|
||||
video: VideoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video.fileId,
|
||||
thumb = video.thumbnail ?.fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = video.duration,
|
||||
width = video.width,
|
||||
height = video.height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -178,17 +259,36 @@ suspend inline fun TelegramBot.sendVideo(
|
|||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chat.id,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -199,11 +299,26 @@ suspend inline fun TelegramBot.sendVideo(
|
|||
chat: Chat,
|
||||
video: VideoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideo(
|
||||
chatId = chat.id,
|
||||
video = video,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
|
@ -3,13 +3,11 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
|
@ -22,10 +20,11 @@ suspend fun TelegramBot.sendVideoNote(
|
|||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVideoNote(
|
||||
|
@ -35,10 +34,11 @@ suspend fun TelegramBot.sendVideoNote(
|
|||
duration,
|
||||
size,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -51,13 +51,14 @@ suspend fun TelegramBot.sendVideoNote(
|
|||
chatId: ChatIdentifier,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideoNote(
|
||||
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -71,12 +72,13 @@ suspend fun TelegramBot.sendVideoNote(
|
|||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -86,9 +88,10 @@ suspend fun TelegramBot.sendVideoNote(
|
|||
chat: Chat,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVideoNote(chat.id, videoNote, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -3,15 +3,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media
|
|||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||
import dev.inmo.tgbotapi.types.threadId
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -24,10 +22,11 @@ suspend fun TelegramBot.sendVoice(
|
|||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVoice(
|
||||
|
@ -37,10 +36,11 @@ suspend fun TelegramBot.sendVoice(
|
|||
parseMode,
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
@ -56,12 +56,13 @@ suspend fun TelegramBot.sendVoice(
|
|||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -73,13 +74,14 @@ suspend fun TelegramBot.sendVoice(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(
|
||||
chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -92,12 +94,13 @@ suspend fun TelegramBot.sendVoice(
|
|||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(chat.id, voice, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -110,23 +113,25 @@ suspend inline fun TelegramBot.sendVoice(
|
|||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendVoice(
|
||||
chatId,
|
||||
voice,
|
||||
entities,
|
||||
duration,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyToMessageId,
|
||||
allowSendingWithoutReply,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
duration = duration,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -140,12 +145,13 @@ suspend inline fun TelegramBot.sendVoice(
|
|||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(chat.id, voice, entities, duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -156,13 +162,14 @@ suspend inline fun TelegramBot.sendVoice(
|
|||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(
|
||||
chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
|
||||
)
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -173,9 +180,10 @@ suspend inline fun TelegramBot.sendVoice(
|
|||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
|
|
@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||
|
||||
suspend fun TelegramBot.createInvoiceLink(
|
||||
title: String,
|
||||
|
@ -29,3 +30,25 @@ suspend fun TelegramBot.createInvoiceLink(
|
|||
) = execute(
|
||||
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||
)
|
||||
|
||||
/**
|
||||
* For links witn XTR currency and using of Telegram Stars
|
||||
*/
|
||||
suspend fun TelegramBot.createInvoiceLink(
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
prices: List<LabeledPrice>,
|
||||
maxTipAmount: Int? = null,
|
||||
suggestedTipAmounts: List<Int>? = null,
|
||||
providerData: String? = null,
|
||||
requireName: Boolean = false,
|
||||
requirePhoneNumber: Boolean = false,
|
||||
requireEmail: Boolean = false,
|
||||
requireShippingAddress: Boolean = false,
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false
|
||||
) = execute(
|
||||
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.send.payments
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.payments.RefundStarPayment
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.payments.SuccessfulPayment
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
|
||||
|
||||
suspend fun TelegramBot.refundStarPayment(
|
||||
userId: UserId,
|
||||
telegramPaymentChargeId: TelegramPaymentChargeId
|
||||
) = execute(RefundStarPayment(userId, telegramPaymentChargeId))
|
||||
|
||||
suspend fun TelegramBot.refundStarPayment(
|
||||
userId: UserId,
|
||||
successfulPayment: SuccessfulPayment
|
||||
) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId)
|
|
@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
|
@ -34,11 +35,11 @@ suspend fun TelegramBot.sendInvoice(
|
|||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
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)
|
||||
SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -66,7 +67,90 @@ suspend fun TelegramBot.sendInvoice(
|
|||
priceDependOnShipAddress: Boolean = false,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = 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, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||
) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendInvoice(
|
||||
chatId: IdChatIdentifier,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
prices: List<LabeledPrice>,
|
||||
maxTipAmount: Int? = null,
|
||||
suggestedTipAmounts: List<Int>? = null,
|
||||
startParameter: StartParameter? = null,
|
||||
providerData: String? = null,
|
||||
requireName: Boolean = false,
|
||||
requirePhoneNumber: Boolean = false,
|
||||
requireEmail: Boolean = false,
|
||||
requireShippingAddress: Boolean = false,
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendInvoice(chatId, title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
suspend fun TelegramBot.sendInvoice(
|
||||
user: CommonUser,
|
||||
title: String,
|
||||
description: String,
|
||||
payload: String,
|
||||
prices: List<LabeledPrice>,
|
||||
maxTipAmount: Int? = null,
|
||||
suggestedTipAmounts: List<Int>? = null,
|
||||
startParameter: StartParameter? = null,
|
||||
providerData: String? = null,
|
||||
requireName: Boolean = false,
|
||||
requirePhoneNumber: Boolean = false,
|
||||
requireEmail: Boolean = false,
|
||||
requireShippingAddress: Boolean = false,
|
||||
shouldSendPhoneNumberToProvider: Boolean = false,
|
||||
shouldSendEmailToProvider: Boolean = false,
|
||||
priceDependOnShipAddress: Boolean = false,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = sendInvoice(
|
||||
chatId = user.id,
|
||||
title = title,
|
||||
description = description,
|
||||
payload = payload,
|
||||
prices = prices,
|
||||
maxTipAmount = maxTipAmount,
|
||||
suggestedTipAmounts = suggestedTipAmounts,
|
||||
startParameter = startParameter,
|
||||
providerData = providerData,
|
||||
requireName = requireName,
|
||||
requirePhoneNumber = requirePhoneNumber,
|
||||
requireEmail = requireEmail,
|
||||
requireShippingAddress = requireShippingAddress,
|
||||
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
|
||||
shouldSendEmailToProvider = shouldSendEmailToProvider,
|
||||
priceDependOnShipAddress = priceDependOnShipAddress,
|
||||
threadId = null,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
effectId = effectId,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
|
|
@ -1,301 +0,0 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
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.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
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
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
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
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
poll: RegularPoll,
|
||||
isClosed: Boolean = false,
|
||||
question: String = poll.question,
|
||||
options: List<String> = poll.options.map { it.text },
|
||||
isAnonymous: Boolean = poll.isAnonymous,
|
||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = 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
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chat: Chat,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendRegularPoll(
|
||||
chat.id, 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
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chat: Chat,
|
||||
poll: RegularPoll,
|
||||
isClosed: Boolean = false,
|
||||
question: String = poll.question,
|
||||
options: List<String> = poll.options.map { it.text },
|
||||
isAnonymous: Boolean = poll.isAnonymous,
|
||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendRegularPoll(
|
||||
chat.id, 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
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
correctOptionId: Int,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chat: Chat,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
correctOptionId: Int,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
isClosed: Boolean = false,
|
||||
quizPoll: QuizPoll,
|
||||
question: String = quizPoll.question,
|
||||
options: List<String> = quizPoll.options.map { it.text },
|
||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chat: Chat,
|
||||
isClosed: Boolean = false,
|
||||
quizPoll: QuizPoll,
|
||||
question: String = quizPoll.question,
|
||||
options: List<String> = quizPoll.options.map { it.text },
|
||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
explanation: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
correctOptionId: Int,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.sendQuizPoll(
|
||||
chat: Chat,
|
||||
question: String,
|
||||
options: List<String>,
|
||||
correctOptionId: Int,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
isClosed: Boolean = false,
|
||||
quizPoll: QuizPoll,
|
||||
question: String = quizPoll.question,
|
||||
options: List<String> = quizPoll.options.map { it.text },
|
||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||
*/
|
||||
suspend inline fun TelegramBot.sendQuizPoll(
|
||||
chat: Chat,
|
||||
isClosed: Boolean = false,
|
||||
quizPoll: QuizPoll,
|
||||
question: String = quizPoll.question,
|
||||
options: List<String> = quizPoll.options.map { it.text },
|
||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||
entities: TextSourcesList,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyToMessageId: MessageId? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = sendQuizPoll(
|
||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||
)
|
|
@ -0,0 +1,325 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanation: String?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanation,
|
||||
questionParseMode,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanation: String?,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanation,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
questionParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
questionParseMode,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanation: String?,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanation,
|
||||
questionParseMode,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
explanation: String?,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanation,
|
||||
explanationParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
questionParseMode,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendQuizPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendQuizPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
correctOptionId,
|
||||
closeInfo,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
|
@ -0,0 +1,156 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.send.polls
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||
|
||||
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
questionParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
questionParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
openPeriod,
|
||||
closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
question,
|
||||
options,
|
||||
closeInfo,
|
||||
questionParseMode,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.sendRegularPoll(
|
||||
chatId: ChatIdentifier,
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = execute(
|
||||
SendRegularPoll(
|
||||
chatId,
|
||||
questionEntities,
|
||||
options,
|
||||
closeInfo,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
allowMultipleAnswers,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
effectId,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
)
|
||||
)
|
|
@ -4,6 +4,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
|
@ -12,12 +14,18 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
|||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
stickerSetName: StickerSetName,
|
||||
inputSticker: InputSticker
|
||||
) = execute(
|
||||
AddStickerToSet(userId, stickerSetName, inputSticker)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
inputSticker: InputSticker
|
||||
) = addStickerToSet(userId, StickerSetName(stickerSetName), inputSticker)
|
||||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
|
@ -32,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
|
@ -40,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
|
|||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
|
@ -60,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
|
@ -68,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
|
|||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
|
@ -99,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
|
|||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, keywords
|
||||
user.id, stickerSet, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, maskPosition
|
||||
user.id, stickerSet, sticker, format, emojis, maskPosition
|
||||
)
|
||||
|
|
|
@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||
userId: UserId,
|
||||
name: String,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean = false
|
||||
) = execute(
|
||||
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting)
|
||||
CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
|
||||
)
|
||||
|
||||
|
||||
|
@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||
user: CommonUser,
|
||||
name: String,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean = false,
|
||||
) = createNewStickerSet(
|
||||
user.id, name, title, stickersFormat, stickers, needsRepainting
|
||||
user.id, name, title, stickers, needsRepainting
|
||||
)
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.requests.stickers.ReplaceStickerInSet
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = execute(
|
||||
ReplaceStickerInSet(userId, stickerSetName, oldSticker, newSticker)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
newSticker
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet,
|
||||
oldSticker,
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||
}
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||
}
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(
|
||||
user.id,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
newSticker
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition
|
||||
)
|
|
@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
|
@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
|||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = execute(
|
||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
||||
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = execute(
|
||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
||||
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSetName, thumbnail
|
||||
user.id, stickerSetName, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSetName, thumbnail
|
||||
user.id, stickerSetName, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
userId, stickerSet.name, thumbnail
|
||||
userId, stickerSet.name, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
userId, stickerSet.name, thumbnail
|
||||
userId, stickerSet.name, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSet.name, thumbnail
|
||||
user.id, stickerSet, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSet.name, thumbnail
|
||||
user.id, stickerSet, format, thumbnail
|
||||
)
|
|
@ -13,6 +13,8 @@ kotlin {
|
|||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api project(":tgbotapi.core")
|
||||
api project(":tgbotapi.utils")
|
||||
api project(":tgbotapi.behaviour_builder")
|
||||
api libs.microutils.fsm.common
|
||||
}
|
||||
|
|
1425
tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api
Normal file
1425
tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,8 @@ kotlin {
|
|||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api project(":tgbotapi.utils")
|
||||
api project(path: ':tgbotapi.core')
|
||||
api project(path: ':tgbotapi.utils')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder
|
|||
import dev.inmo.micro_utils.coroutines.*
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||
import dev.inmo.tgbotapi.types.UpdateIdentifier
|
||||
import dev.inmo.tgbotapi.types.UpdateId
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import dev.inmo.tgbotapi.updateshandlers.*
|
||||
import kotlinx.coroutines.*
|
||||
|
@ -72,7 +72,7 @@ class DefaultBehaviourContext(
|
|||
private val additionalUpdatesSharedFlow = MutableSharedFlow<Update>(0, broadcastChannelsSize, onBufferOverflow)
|
||||
override val allUpdatesFlow: Flow<Update> = (additionalUpdatesSharedFlow.asSharedFlow()).let {
|
||||
if (upstreamUpdatesFlow != null) {
|
||||
val handledUpdates = mutableSetOf<UpdateIdentifier>()
|
||||
val handledUpdates = mutableSetOf<UpdateId>()
|
||||
(it + upstreamUpdatesFlow).filter {
|
||||
val passed = handledUpdates.add(it.updateId)
|
||||
(passed).also { passed ->
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user