mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-17 04:20:13 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d6709baf4 | |||
| b50ad30176 | |||
| 887c51f83a | |||
| c193b512d9 | |||
| ee055873e6 | |||
| 6db6209c88 | |||
| e92563e85f | |||
| 03f2f0e25b |
3
.github/workflows/greetings.yml
vendored
3
.github/workflows/greetings.yml
vendored
@@ -5,9 +5,6 @@ on: [pull_request, issues]
|
|||||||
jobs:
|
jobs:
|
||||||
greeting:
|
greeting:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/kdocs.yml
vendored
6
.github/workflows/kdocs.yml
vendored
@@ -10,12 +10,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 11
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew dokkaHtmlMultiModule
|
run: ./gradlew dokkaHtml
|
||||||
- name: Publish KDocs
|
- name: Publish KDocs
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./build/dokka/htmlMultiModule
|
publish_dir: ./docs/build/dokka/html
|
||||||
publish_branch: kdocs
|
publish_branch: kdocs
|
||||||
|
|||||||
23
.github/workflows/packages_publishing.yml
vendored
23
.github/workflows/packages_publishing.yml
vendored
@@ -7,30 +7,23 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 11
|
||||||
- name: Setup LibCurl
|
|
||||||
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
|
|
||||||
- name: Rewrite version
|
- name: Rewrite version
|
||||||
run: |
|
run: |
|
||||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||||
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
|
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
|
||||||
rm gradle.properties
|
rm gradle.properties
|
||||||
mv gradle.properties.tmp gradle.properties
|
mv gradle.properties.tmp gradle.properties
|
||||||
- name: KotlinSymbolProcessing execution
|
|
||||||
run: ./gradlew ksp
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: API compatibility check
|
- name: Publish to Gitea
|
||||||
run: ./gradlew apiCheck
|
continue-on-error: true
|
||||||
|
run: ./gradlew publishAllPublicationsToGiteaRepository
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
- name: Publish to GithubPackages
|
- name: Publish to GithubPackages
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
env:
|
env:
|
||||||
GITHUB_USER: ${{ github.actor }}
|
GITHUBPACKAGES_USER: ${{ github.actor }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Publish to Gitea
|
|
||||||
continue-on-error: true
|
|
||||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
|
||||||
env:
|
|
||||||
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
|
||||||
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
|||||||
.idea
|
.idea
|
||||||
.kotlin
|
|
||||||
out/*
|
out/*
|
||||||
*.iml
|
*.iml
|
||||||
target
|
target
|
||||||
|
|||||||
513
CHANGELOG.md
513
CHANGELOG.md
@@ -1,518 +1,5 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
## 16.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS KOTLIN UPDATE UP TO 2.0**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.23` -> `2.0.10`
|
|
||||||
* `Serialization`: `1.6.3` -> `1.7.1`
|
|
||||||
* `MicroUtils`: `0.21.2` -> `0.22.0`
|
|
||||||
* `KSLog`: `1.3.4` -> `1.3.5`
|
|
||||||
|
|
||||||
## 15.3.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.8**
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* `OptionallyBusinessConnectionRequest` now extends `WithOptionalBusinessConnectionId`
|
|
||||||
* Add `hasMainWebApp` in `ExtendedBot`
|
|
||||||
* `API`:
|
|
||||||
* Add `BusinessConnectionId` to pin/unpin methods
|
|
||||||
* `WebApp`:
|
|
||||||
* Add `shareToStory` in `WebApp`
|
|
||||||
|
|
||||||
## 15.2.0
|
|
||||||
|
|
||||||
* `API`:
|
|
||||||
* Enabled an `explicit mode` for `API` module ([PR #876](https://github.com/InsanusMokrassar/ktgbotapi/pull/876))
|
|
||||||
* `WebApps`:
|
|
||||||
* Built-in `onClick` and `offClick` of `MainButton` become public ([PR #875](https://github.com/InsanusMokrassar/ktgbotapi/pull/875))
|
|
||||||
* Old `MainButton.onClick` extension **has been removed** to avoid collisions of types
|
|
||||||
|
|
||||||
## 15.1.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.7** (thanks to [bpavuk](https://threads.net/b_pavuchok))
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.6** (with participation and help of [bpavuk](https://threads.net/b_pavuchok))
|
|
||||||
|
|
||||||
* Add support of paid media
|
|
||||||
* Update web apps
|
|
||||||
* `Version`:
|
|
||||||
* `MicroUtils`: `0.21.1` -> `0.21.2`
|
|
||||||
* `Core`:
|
|
||||||
* `TelegramMedia` has been separated onto two interfaces: `TelegramFreeMedia` and `TelegramPaidMedia`
|
|
||||||
* `TelegramFreeMedia` has replaced `TelegramMedia` on all old places where it have been used
|
|
||||||
* `Photo` has been renamed to `PhotoFile`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Add notification when handling of `/privacy` command is absence
|
|
||||||
* Add several extensions to simplify setting up `/privacy` reaction
|
|
||||||
|
|
||||||
## 15.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS ADDING OF SUPPORT FOR BOTS API 7.5**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `MicroUtils`: `0.21.0` -> `0.21.1`
|
|
||||||
* A lot of `edit` methods and classes has been changed to support business connection id
|
|
||||||
|
|
||||||
## 14.1.0
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.8.0` -> `1.8.1`
|
|
||||||
* `Ktor`: `2.3.10` -> `2.3.11`
|
|
||||||
* `MicroUtils`: `0.20.45` -> `0.21.0`
|
|
||||||
* `KSLog`: `1.3.3` -> `1.3.4`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* `BehaviourContext` updates listening job will be weakly subscribed. It means that `BehaviourContext` scope will
|
|
||||||
not be prevented from cancelling by this job anymore
|
|
||||||
* `BehaviourContext.doInContext` will not stop automatically current `BehaviourContext` job anymore
|
|
||||||
* `BehaviourContext.createSubContextAndDoWithUpdatesFilter` will use `supervisorScope` instead of
|
|
||||||
`LinkedSupervisorScope`. That will prevent scope leaking in runtime
|
|
||||||
|
|
||||||
## 14.0.1
|
|
||||||
|
|
||||||
* In `core` and `api` modules related to invoices changed their APIs to suite current API
|
|
||||||
|
|
||||||
## 14.0.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
|
|
||||||
* All the methods/classes related to sending of messages got `effectId` parameter
|
|
||||||
* All the methods/classes related to sending of photos/animations/videos got `showCaptionAboveMedia` parameter
|
|
||||||
|
|
||||||
## 13.0.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.3](https://core.telegram.org/bots/api-changelog#may-6-2024)**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* For polls, `textSources` now means `question` text sources. For `QuizPoll` there are `explanation` and `explanationTextSources`
|
|
||||||
for hinting
|
|
||||||
* `API`:
|
|
||||||
* A lot of API related to `Poll`s has been changed to include opportunity to pass `ParseMode` and `TextSource`s list
|
|
||||||
|
|
||||||
## 12.0.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Ktor`: `2.3.9` -> `2.3.10`
|
|
||||||
* `MicroUtils`: `0.20.39` -> `0.20.45`
|
|
||||||
* `UUID`: `0.8.2` -> `0.8.4`
|
|
||||||
|
|
||||||
## 12.0.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
|
||||||
|
|
||||||
## 11.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* `MessageId` now is `value class`. `MessageIdentifier` become deprecated
|
|
||||||
* `MessageThreadId` now is `value class`
|
|
||||||
* `InlineQueryIdentifier` now is `value class`
|
|
||||||
* `MediaGroupIdentifier` has been renamed to `MediaGroupId` and now is `value class`
|
|
||||||
* `CallbackQueryIdentifier` has been renamed to `CallbackQueryId` and now is `value class`
|
|
||||||
* `WebAppQueryId` now is `value class`
|
|
||||||
* `PreCheckoutQueryId` now is `value class`
|
|
||||||
* `FileUniqueId` has been renamed to `TgFileUniqueId` and now is `value class`
|
|
||||||
* `UpdateIdentifier` has been renamed to `UpdateId` and now is `value class`
|
|
||||||
* `InlineMessageIdentifier` has been renamed to `InlineMessageId` and now is `value class`
|
|
||||||
* `ShippingQueryIdentifier` has been renamed to `ShippingQueryId` and now is `value class`
|
|
||||||
* `Identifier` has been renamed to `RawChatId` and now is `value class`
|
|
||||||
* `ShippingOptionIdentifier` has been renamed to `ShippingOptionId` and now is `value class`
|
|
||||||
* `PollIdentifier` has been renamed to `PollId` and now is `value class`
|
|
||||||
* `StickerSetName` now is `value class`
|
|
||||||
|
|
||||||
## 10.1.2
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.22` -> `1.9.23`
|
|
||||||
* `Korlibs`: `5.3.2` -> `5.4.0`
|
|
||||||
* `Ktor`: `2.3.8` -> `2.3.9`
|
|
||||||
* `MicroUtils`: `0.20.37` -> `0.20.39`
|
|
||||||
* `KSLog`: `1.3.2` -> `1.3.3`
|
|
||||||
|
|
||||||
## 10.1.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Serialization`: `1.6.2` -> `1.6.3`
|
|
||||||
* `MicroUtils`: `0.20.34` -> `0.20.37`
|
|
||||||
* `Korlibs`: `5.3.1` -> `5.3.2`
|
|
||||||
|
|
||||||
## 10.1.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.1](https://core.telegram.org/bots/api-changelog#february-16-2024)**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.7.3` -> `1.8.0`
|
|
||||||
* `MicroUtils`: `0.20.32` -> `0.20.34`
|
|
||||||
|
|
||||||
## 10.0.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Ktor`: `2.3.7` -> `2.3.8`
|
|
||||||
* `MicroUtils`: `0.20.26` -> `0.20.32`
|
|
||||||
* `Korlibs`: `5.3.0` -> `5.3.1`
|
|
||||||
* `KSLog`: `1.3.1` -> `1.3.2`
|
|
||||||
|
|
||||||
## 10.0.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 7.0](https://core.telegram.org/bots/api-changelog#december-29-2023)**
|
|
||||||
|
|
||||||
**IN THIS UPDATE KLOCK DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-time` UP TO 5.3.0 VERSION**
|
|
||||||
|
|
||||||
**IN THIS UPDATE KRYPTO DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-crypto` UP TO 5.3.0 VERSION**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `MicroUtils`: `0.20.23` -> `0.20.26`
|
|
||||||
* `Korlibs`: `4.0.10` -> `5.3.0`
|
|
||||||
* `Core`:
|
|
||||||
* `Message` now inherited by two variants: `AccessibleMessage` and `InaccessibleMessage`
|
|
||||||
* `Common`:
|
|
||||||
* In most places `disableWebPagePreview` has been replaced by new `LinkPreviewOptions`
|
|
||||||
* In most places arguments `replyToMessageId` and `allowSendingWithoutReply` has been replaced with
|
|
||||||
`ReplyParameters`
|
|
||||||
* In `reply` extension two parameters have been added: `replyInChatId` and `replyInThreadId`
|
|
||||||
|
|
||||||
## 9.4.3
|
|
||||||
|
|
||||||
**IetfLanguageCode has been renamed to IetfLang in MicroUtils**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.21` -> `1.9.22`
|
|
||||||
* `MicroUtils`: `0.20.19` -> `0.20.23`
|
|
||||||
|
|
||||||
## 9.4.2
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Serialization`: `1.6.1` -> `1.6.2`
|
|
||||||
* `Ktor`: `2.3.6` -> `2.3.7`
|
|
||||||
* `MicroUtils`: `0.20.15` -> `0.20.19`
|
|
||||||
* `UUID`: `0.8.1` -> `0.8.2`
|
|
||||||
|
|
||||||
## 9.4.1
|
|
||||||
|
|
||||||
* Replace warning about two bots from `LongPolling` to `DefaultKtorRequestsExecutor`
|
|
||||||
|
|
||||||
## 9.4.0
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.9.20` -> `1.9.21`
|
|
||||||
* `Serialization`: `1.6.0` -> `1.6.1`
|
|
||||||
* `Ktor`: `2.3.5` -> `2.3.6`
|
|
||||||
* `MicroUtils`: `0.20.12` -> `0.20.15`
|
|
||||||
|
|
||||||
## 9.3.0
|
|
||||||
|
|
||||||
This release become possible thanks to [Anton Lakotka](https://youtrack.jetbrains.com/users/anton.lakotka)
|
|
||||||
|
|
||||||
**THIS RELEASE CONTAINS UPDATES UP TO RELEASE CANDIDATES VERSIONS**
|
|
||||||
|
|
||||||
**UPDATE MAY HAVE BREAKING CHANGES**
|
|
||||||
|
|
||||||
**SINCE THIS UPDATE IT WILL BE REQUIRED TO USE JDK 17+ FOR DEVELOPMENT**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `1.8.22` -> `1.9.20`
|
|
||||||
* `Serialization`: `1.5.1` -> `1.6.0`
|
|
||||||
* `KorLibs`: `4.0.3` -> `4.0.10`
|
|
||||||
* `UUID`: `0.7.1` -> `0.8.1`
|
|
||||||
* `Ktor`: `2.3.4` -> `2.3.5`
|
|
||||||
* `MicroUtils`: `0.19.9` -> `0.20.12`
|
|
||||||
|
|
||||||
## 9.2.4
|
|
||||||
|
|
||||||
* `Utils`:
|
|
||||||
* New extensions `*.parseCommandsWithNamedArgs`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* In expectaters and triggers of `commands` add `*WithNamedArgs` variants
|
|
||||||
* In expectaters and triggers of `commands` add opportunity to use custom separator
|
|
||||||
|
|
||||||
## 9.2.3
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix in `VoiceContent#createResend`
|
|
||||||
|
|
||||||
## 9.2.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix of [#793](https://github.com/InsanusMokrassar/ktgbotapi/issues/793): Add `PreviewChat`
|
|
||||||
|
|
||||||
## 9.2.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Ktor`: `2.3.3` -> `2.3.4`
|
|
||||||
* `Core`:
|
|
||||||
* All `ChatMember` inheritors have fixes `status` field
|
|
||||||
|
|
||||||
## 9.2.0
|
|
||||||
|
|
||||||
**Add support of [Telegram Bots API 6.9](https://core.telegram.org/bots/api-changelog#september-22-2023)**
|
|
||||||
|
|
||||||
* Rename `ChatAdministratorRightsImpl` -> `ChatCommonAdministratorRights`
|
|
||||||
* All the request chat keyboards has changed their parameters `ChatAdministratorRights` to `ChatCommonAdministratorRights`
|
|
||||||
|
|
||||||
## 9.1.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Fix of `MessageContent` serialization
|
|
||||||
|
|
||||||
## 9.1.1
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Potential fix of incorrect parsing in `RawMessageEntity`
|
|
||||||
|
|
||||||
## 9.1.0
|
|
||||||
|
|
||||||
**This update contains adding of [Telegram Bot API 6.8](https://core.telegram.org/bots/api-changelog#august-18-2023) support**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.7.2` -> `1.7.3`
|
|
||||||
* `Ktor`: `2.3.2` -> `2.3.3`
|
|
||||||
* `MicroUtils`: `0.19.7` -> `0.19.9`
|
|
||||||
|
|
||||||
## 9.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES: USERNAMES OF BOTS NOW BECAME NULLABLE**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Coroutines`: `1.6.4` -> `1.7.1`
|
|
||||||
* `Ktor`: `2.3.1` -> `2.3.2`
|
|
||||||
* `MicroUtils`: `0.19.4` -> `0.19.7`
|
|
||||||
* `Core`:
|
|
||||||
* **All bots now have nullable usernames just like common users ([#772](https://github.com/InsanusMokrassar/ktgbotapi/issues/772))**
|
|
||||||
* Decrease possible errors in updates handling by additional handling of update deserialization wrapping ([#773](https://github.com/InsanusMokrassar/ktgbotapi/issues/773))
|
|
||||||
* New interface `GetUpdatesRequest`. You may implement it to show default telegram bot ktor executor that this
|
|
||||||
request is an updates request and should be handled in a different way
|
|
||||||
* Now it is possible to get raw updates with `GetUpdatesRaw` request
|
|
||||||
* `Utils`:
|
|
||||||
* Improve extension `Update.sourceChat` to add opportunity to select some chats by logic different with the default
|
|
||||||
|
|
||||||
## 8.1.0
|
|
||||||
|
|
||||||
**PARTIALLY BREAKING CHANGES: Exclude `.*Impl` classcasts from `ClassCastsNew`**
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `MicroUtils`: `0.19.2` -> `0.19.4`
|
|
||||||
* `Utils`:
|
|
||||||
* Add deep links formatting for internal `tg://` prefix (thanks to [@klimatov](https://github.com/klimatov))
|
|
||||||
* Exclude `.*Impl` classcasts from `ClassCastsNew`
|
|
||||||
|
|
||||||
## 8.0.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `UUID`: `0.7.0` -> `0.7.1`
|
|
||||||
* `Ktor`: `2.3.0` -> `2.3.1`
|
|
||||||
* `MicroUtils`: `0.19.1` -> `0.19.2`
|
|
||||||
|
|
||||||
## 8.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
**ALL PROJECT DEPRECATIONS HAVE BEEN REMOVED**
|
|
||||||
|
|
||||||
**IN THIS UPDATE KORLIBS HAVE BEEN UPDATED TO VERSION `4.0.2`. SINCE THAT VERSION A LOT OF PACKAGES HAVE BEEN RENAMED.
|
|
||||||
MIGRATIONS USED IN THIS LIB:**
|
|
||||||
|
|
||||||
* `com.soywiz.klock` -> `korlibs.time`
|
|
||||||
* `com.soywiz.krypto` -> `korlibs.crypto`
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Korlibs`: `3.4.0` -> `4.0.3`
|
|
||||||
* `MicroUtils`: `0.18.4` -> `0.19.1`
|
|
||||||
|
|
||||||
## 7.1.3
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Serialization`: `1.5.0` -> `1.5.1`
|
|
||||||
* `MicroUtils`: `0.18.1` -> `0.18.4`
|
|
||||||
* `Core`:
|
|
||||||
* Actualize kdocs in `InputFile`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Now it is possible to use `waitMediaContent`/`waitMediaContentMessage`/`onMediaContent`
|
|
||||||
* Add `onMention`/`waitMention` functionality
|
|
||||||
* Add opportunity to map content with extensions to `Flow`
|
|
||||||
|
|
||||||
## 7.1.2
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.18.0` -> `0.18.1`
|
|
||||||
* `Core`:
|
|
||||||
* Now it is possible to serialize `Sticker`s
|
|
||||||
|
|
||||||
## 7.1.1
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Kotlin`: `1.8.20` -> `1.8.21`
|
|
||||||
* `MicroUtils`: `0.17.8` -> `0.18.0`
|
|
||||||
* `Utils`:
|
|
||||||
* Fixes in `makeLinkToMessage`
|
|
||||||
|
|
||||||
## 7.1.0
|
|
||||||
|
|
||||||
**This update contains changes according to the [Telegram Bot API 6.7](https://core.telegram.org/bots/api-changelog#april-21-2023)**
|
|
||||||
|
|
||||||
* `API`:
|
|
||||||
* Rename `editMessageCaption` to `editMessageMedia` due to wrong old naming
|
|
||||||
* Add `edit` extensions for `InlineMessageIdentifier`s
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* `BehaviourContext` extensions `onDeepLink` and `waitDeepLinks` now can be used with `Regex` or `String` as first parameters
|
|
||||||
|
|
||||||
## 7.0.2
|
|
||||||
|
|
||||||
_This update brings experimental support of `linuxX64` and `mingwX64` platforms_
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Kotlin`: `1.8.10` -> `1.8.20`
|
|
||||||
* `MicroUtils`: `0.17.5` -> `0.17.8`
|
|
||||||
* `Ktor`: `2.2.4` -> `2.3.0`
|
|
||||||
* `Core`:
|
|
||||||
* New `RequestsExecutor` - `MultipleClientKtorRequestsExecutor`
|
|
||||||
* Old `KtorRequestsExecutor` has been renamed to `DefaultKtorRequestsExecutor`
|
|
||||||
* `KtorRequestsExecutor` now is `expect class`
|
|
||||||
* On `JS`, `JVM` and `MinGWX64` platforms it is `DefaultKtorRequestsExecutor`
|
|
||||||
* On `LinuxX64` platform it is `MultipleClientKtorRequestsExecutor`
|
|
||||||
|
|
||||||
## 7.0.1
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* New interface `WithChat` which contains `chat` field
|
|
||||||
* `Message` now inherits `WithChat`
|
|
||||||
* `ChatMemberUpdated` now inherits `WithChat`
|
|
||||||
* `Utils`:
|
|
||||||
* Improvements in `same`-notations
|
|
||||||
|
|
||||||
## 7.0.0
|
|
||||||
|
|
||||||
This update contains support of [Telegram Bot API 6.6](https://core.telegram.org/bots/api-changelog#march-9-2023)
|
|
||||||
|
|
||||||
**THIS VERSION CONTAINS BREAKING CHANGES**:
|
|
||||||
|
|
||||||
* All previous deprecations have been removed
|
|
||||||
* Fully reworked mechanism of stickers creating and adding
|
|
||||||
* All separations of stickers types like `Animeted` have been replaces with type `StickerFormat`
|
|
||||||
* New `InputSticker` type (and all subtypes) as replacements for old raw fields in methods
|
|
||||||
* Reworked mechanism of files uploading
|
|
||||||
|
|
||||||
Other changes
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.17.3` -> `0.17.5`
|
|
||||||
|
|
||||||
## 6.1.0
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.17.2` -> `0.17.3`
|
|
||||||
* `API`:
|
|
||||||
* Fix of [#732](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/732)
|
|
||||||
|
|
||||||
## 6.0.3
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.17.1` -> `0.17.2`
|
|
||||||
* `Core`:
|
|
||||||
* `User` in `CallbackQuery` now is `CommonUser` as well as in `from`
|
|
||||||
* `User` in `InlineQuery` now is `CommonUser` as well as in `from`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Fixes in `DeepLink` triggers and waiters
|
|
||||||
|
|
||||||
## 6.0.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Long polling now uses media groups debounce as in webhooks
|
|
||||||
|
|
||||||
## 6.0.1
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Ktor`: `2.2.3` -> `2.2.4`
|
|
||||||
* `MicroUtils`: `0.17.0` -> `0.17.1`
|
|
||||||
|
|
||||||
## 6.0.0
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `Kotlin`: `1.7.22` -> `1.8.10`
|
|
||||||
* `MicroUtils`: `0.16.10` -> `0.17.0`
|
|
||||||
* `Serialization`: `1.4.1` -> `1.5.0`
|
|
||||||
* `uuid`: `0.6.0` -> `0.7.0`
|
|
||||||
* `Core`:
|
|
||||||
* `*.link` extensions have been deprecated with renaming to avoid collisions with `link` methods
|
|
||||||
* `API`:
|
|
||||||
* Add `TelegramBot.resend` methods
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Add triggers and waiters for `VisualMediaGroupPartContent`
|
|
||||||
* `Utils`:
|
|
||||||
* `*.link` extensions have been deprecated with renaming to avoid collisions with `link` methods
|
|
||||||
|
|
||||||
## 5.2.1
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* All the `CallbackQuery`es now will receive `CommonUser` instead of `User` due inability of bots to trigger any
|
|
||||||
inline interaction with others bots
|
|
||||||
* `API`:
|
|
||||||
* Now `sentMessageFlow` will take each sent message in `handleLiveLocation`
|
|
||||||
|
|
||||||
## 5.2.0
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.16.8` -> `0.16.10`
|
|
||||||
|
|
||||||
## 5.1.1
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Add opportunity to get user link with `makeUserLink`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Fixes in content waiting expectators
|
|
||||||
|
|
||||||
## 5.1.0
|
|
||||||
|
|
||||||
[Bot API 6.5](https://core.telegram.org/bots/api-changelog#february-3-2023) support
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* `ChatPermissions` now is interface and have two main realizations: `ChatPermissions.Granular` and
|
|
||||||
`ChatPermissions.Common`
|
|
||||||
* `RestrictedChatMember` now implements `ChatPermissions` too
|
|
||||||
* `API`:
|
|
||||||
* Now it is possible to pass all long polling parameters in all places used it
|
|
||||||
* `Issues`:
|
|
||||||
* Fix of [#697](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/697)
|
|
||||||
|
|
||||||
## 5.0.2
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.16.6` -> `0.16.8`
|
|
||||||
* `Ktor`: `2.2.2` -> `2.2.3`
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* Fixes in `BehaviourContext.onEditedContentMessage` - now it will trigger callback on channel post edits too
|
|
||||||
|
|
||||||
## 5.0.1
|
|
||||||
|
|
||||||
* `Versions`:
|
|
||||||
* `MicroUtils`: `0.16.4` -> `0.16.6`
|
|
||||||
* `Ktor`: `2.2.1` -> `2.2.2`
|
|
||||||
* `Core`:
|
|
||||||
* Fixes in `SendMediaGroup` request
|
|
||||||
* Fixes in `SetChatAdministratorCustomTitle` request (thanks to [@madhead](https://github.com/madhead))
|
|
||||||
|
|
||||||
## 5.0.0
|
|
||||||
|
|
||||||
[Bot API 6.4](https://core.telegram.org/bots/api-changelog#december-30-2022) support!
|
|
||||||
|
|
||||||
* Long-polling improvements
|
|
||||||
|
|
||||||
## 4.2.4
|
## 4.2.4
|
||||||
|
|
||||||
* `Core`:
|
* `Core`:
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -1,16 +1,14 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-31-2024)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#november-5-2022)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:---:|:---:|
|
||||||
| Useful repos | [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) |
|
| Useful repos | [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) |
|
||||||
| Misc | [](https://github.com/KotlinBy/awesome-kotlin) [](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) |
|
| Misc | [](https://github.com/KotlinBy/awesome-kotlin) [](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) |
|
||||||
| Platforms |   |
|
|
||||||
| Experimental Platforms | [](https://kotlinlang.org/docs/native-target-support.html#tier-1) [](https://kotlinlang.org/docs/native-target-support.html#tier-1) |
|
|
||||||
|
|
||||||
<!--- [](https://t.me/ktgbotapi) --->
|
<!--- [](https://t.me/InMoTelegramBotAPI) --->
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://t.me/ktgbotapi">
|
<a href="https://t.me/InMoTelegramBotAPI">
|
||||||
<img src="./resources/tg_channel_qr.jpg">
|
<img src="./resources/tg_channel_qr.jpg">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -118,5 +116,5 @@ suspend fun main() {
|
|||||||
### More examples
|
### More examples
|
||||||
|
|
||||||
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
|
||||||
always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and
|
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
|
||||||
[chat](https://t.me/InMoTelegramBotAPIChat).
|
[chat](https://t.me/InMoTelegramBotAPIChat).
|
||||||
|
|||||||
20
build.gradle
20
build.gradle
@@ -14,19 +14,13 @@ 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
|
// temporal crutch until legacy tests will be stabled or legacy target will be removed
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
maven { url "https://git.inmo.dev/api/packages/InsanusMokrassar/maven" }
|
||||||
}
|
}
|
||||||
if (it != rootProject.findProject("docs")) {
|
if (it != rootProject.findProject("docs")) {
|
||||||
tasks.whenTaskAdded { task ->
|
tasks.whenTaskAdded { task ->
|
||||||
@@ -55,13 +49,13 @@ if (new File(projectDir, "secret.gradle").exists()) {
|
|||||||
githubRelease {
|
githubRelease {
|
||||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||||
|
|
||||||
owner = "InsanusMokrassar"
|
owner "InsanusMokrassar"
|
||||||
repo = "TelegramBotAPI"
|
repo "TelegramBotAPI"
|
||||||
|
|
||||||
tagName = "v$library_version"
|
tagName "v$library_version"
|
||||||
releaseName = "$library_version"
|
releaseName "$library_version"
|
||||||
targetCommitish = "$library_version"
|
targetCommitish "$library_version"
|
||||||
|
|
||||||
body = getCurrentVersionChangelog()
|
body getCurrentVersionChangelog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ Object callback = {
|
|||||||
skipDeprecated.set(true)
|
skipDeprecated.set(true)
|
||||||
|
|
||||||
sourceLink {
|
sourceLink {
|
||||||
localDirectory.set(file("../"))
|
localDirectory.set(file("./"))
|
||||||
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi/tree/master"))
|
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"))
|
||||||
remoteLineSuffix.set("#L")
|
remoteLineSuffix.set("#L")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=16.0.0
|
library_version=4.2.4
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "2.0.10"
|
kotlin = "1.7.22"
|
||||||
kotlin-serialization = "1.7.1"
|
kotlin-serialization = "1.4.1"
|
||||||
kotlin-coroutines = "1.8.1"
|
kotlin-coroutines = "1.6.4"
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.4.0"
|
korlibs = "3.4.0"
|
||||||
uuid = "0.8.4"
|
uuid = "0.6.0"
|
||||||
ktor = "2.3.11"
|
ktor = "2.2.1"
|
||||||
|
|
||||||
ksp = "2.0.10-1.0.24"
|
ksp = "1.7.22-1.0.8"
|
||||||
kotlin-poet = "1.18.1"
|
kotlin-poet = "1.12.0"
|
||||||
|
|
||||||
microutils = "0.22.0"
|
microutils = "0.16.4"
|
||||||
kslog = "1.3.5"
|
|
||||||
|
|
||||||
versions = "0.51.0"
|
github-release-plugin = "2.4.1"
|
||||||
|
dokka = "1.7.20"
|
||||||
github-release-plugin = "2.5.2"
|
|
||||||
dokka = "1.9.20"
|
|
||||||
|
|
||||||
validator = "0.16.2"
|
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -36,30 +31,24 @@ kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref =
|
|||||||
|
|
||||||
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
||||||
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
|
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
|
||||||
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
|
|
||||||
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
|
|
||||||
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }
|
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }
|
||||||
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" }
|
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" }
|
||||||
|
|
||||||
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
|
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
|
||||||
|
|
||||||
korlibs-klock = { module = "com.soywiz.korge:korlibs-time", version.ref = "korlibs" }
|
korlibs-klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "korlibs" }
|
||||||
korlibs-krypto = { module = "com.soywiz.korge:korlibs-crypto", version.ref = "korlibs" }
|
korlibs-krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "korlibs" }
|
||||||
|
|
||||||
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
|
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
|
||||||
|
|
||||||
microutils-colors-common = { module = "dev.inmo:micro_utils.colors.common", version.ref = "microutils" }
|
|
||||||
microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" }
|
microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" }
|
||||||
microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" }
|
microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" }
|
||||||
microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" }
|
microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" }
|
||||||
microutils-serialization-typedSerializer = { module = "dev.inmo:micro_utils.serialization.typed_serializer", version.ref = "microutils" }
|
microutils-serialization-typedSerializer = { module = "dev.inmo:micro_utils.serialization.typed_serializer", version.ref = "microutils" }
|
||||||
microutils-serialization-mapper = { module = "dev.inmo:micro_utils.serialization.mapper", version.ref = "microutils" }
|
|
||||||
microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" }
|
microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" }
|
||||||
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
|
||||||
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
|
||||||
|
|
||||||
kslog = { module = "dev.inmo:kslog", version.ref = "kslog" }
|
|
||||||
|
|
||||||
# ksp dependencies
|
# ksp dependencies
|
||||||
|
|
||||||
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
|
||||||
@@ -78,6 +67,3 @@ github-release-plugin = { module = "com.github.breadmoirai:github-release", vers
|
|||||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
|
||||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
|
||||||
validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "validator" }
|
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ kotlin {
|
|||||||
jsTest {
|
jsTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.kotlin.test.js
|
implementation libs.kotlin.test.js
|
||||||
|
implementation libs.kotlin.test.junit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ kotlin {
|
|||||||
jvm {
|
jvm {
|
||||||
compilations.main {
|
compilations.main {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "17"
|
jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,9 +13,6 @@ kotlin {
|
|||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
linuxX64()
|
|
||||||
mingwX64()
|
|
||||||
linuxArm64()
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
||||||
@@ -38,20 +35,13 @@ kotlin {
|
|||||||
jsTest {
|
jsTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.kotlin.test.js
|
implementation libs.kotlin.test.js
|
||||||
}
|
implementation libs.kotlin.test.junit
|
||||||
}
|
|
||||||
all {
|
|
||||||
languageSettings {
|
|
||||||
optIn('dev.inmo.tgbotapi.utils.RiskFeature')
|
|
||||||
optIn('dev.inmo.tgbotapi.utils.PreviewFeature')
|
|
||||||
optIn('dev.inmo.micro_utils.common.Warning')
|
|
||||||
optIn('dev.inmo.micro_utils.common.PreviewFeature')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
task javadocsJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
archiveClassifier = 'javadoc'
|
classifier = 'javadoc'
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@@ -38,26 +38,30 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
|
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
||||||
maven {
|
maven {
|
||||||
name = "GithubPackages"
|
name = "GithubPackages"
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
|
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
||||||
|
|
||||||
credentials {
|
credentials {
|
||||||
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
|
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
||||||
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
|
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
if (project.hasProperty('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
|
||||||
maven {
|
maven {
|
||||||
name = "InmoNexus"
|
name = "Gitea"
|
||||||
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
|
||||||
|
|
||||||
credentials {
|
credentials(HttpHeaderCredentials) {
|
||||||
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
name = "Authorization"
|
||||||
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
|
||||||
|
}
|
||||||
|
|
||||||
|
authentication {
|
||||||
|
header(HttpHeaderAuthentication)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -92,27 +96,4 @@ if (project.hasProperty("signing.gnupg.keyName")) {
|
|||||||
dependsOn(it)
|
dependsOn(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround to make android sign operations depend on signing tasks
|
|
||||||
project.getTasks().withType(AbstractPublishToMaven.class).configureEach {
|
|
||||||
def signingTasks = project.getTasks().withType(Sign.class)
|
|
||||||
mustRunAfter(signingTasks)
|
|
||||||
}
|
|
||||||
// Workaround to make test tasks use sign
|
|
||||||
project.getTasks().withType(Sign.class).configureEach { signTask ->
|
|
||||||
def withoutSign = (signTask.name.startsWith("sign") ? signTask.name.minus("sign") : signTask.name)
|
|
||||||
def pubName = withoutSign.endsWith("Publication") ? withoutSign.substring(0, withoutSign.length() - "Publication".length()) : withoutSign
|
|
||||||
// These tasks only exist for native targets, hence findByName() to avoid trying to find them for other targets
|
|
||||||
|
|
||||||
// Task ':linkDebugTest<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
|
||||||
def debugTestTask = tasks.findByName("linkDebugTest$pubName")
|
|
||||||
if (debugTestTask != null) {
|
|
||||||
signTask.mustRunAfter(debugTestTask)
|
|
||||||
}
|
|
||||||
// Task ':compileTestKotlin<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
|
||||||
def testTask = tasks.findByName("compileTestKotlin$pubName")
|
|
||||||
if (testTask != null) {
|
|
||||||
signTask.mustRunAfter(testTask)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.UsernameAndPassword","usernameProperty":"GITHUB_USER","passwordProperty":"GITHUB_TOKEN"}},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/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"}}}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 448 KiB After Width: | Height: | Size: 593 KiB |
@@ -19,3 +19,4 @@ include ":tgbotapi.behaviour_builder"
|
|||||||
include ":tgbotapi.behaviour_builder.fsm"
|
include ":tgbotapi.behaviour_builder.fsm"
|
||||||
include ":tgbotapi"
|
include ":tgbotapi"
|
||||||
include ":tgbotapi.webapps"
|
include ":tgbotapi.webapps"
|
||||||
|
include ":docs"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "org.jetbrains.kotlin.multiplatform"
|
id "org.jetbrains.kotlin.multiplatform"
|
||||||
id "org.jetbrains.kotlin.plugin.serialization"
|
id "org.jetbrains.kotlin.plugin.serialization"
|
||||||
id "org.jetbrains.dokka"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
|
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
|
||||||
@@ -16,9 +15,6 @@ kotlin {
|
|||||||
api project(":tgbotapi.core")
|
api project(":tgbotapi.core")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
configureEach {
|
|
||||||
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
explicitApi()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import io.ktor.client.engine.*
|
|||||||
* @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO]
|
* @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO]
|
||||||
* @param ktorClientConfig Config block for preconfiguring of bot [HttpClient]
|
* @param ktorClientConfig Config block for preconfiguring of bot [HttpClient]
|
||||||
*/
|
*/
|
||||||
public data class BotBuilder internal constructor(
|
data class BotBuilder internal constructor(
|
||||||
var proxy: ProxyConfig? = null,
|
var proxy: ProxyConfig? = null,
|
||||||
var ktorClientEngineFactory: HttpClientEngineFactory<HttpClientEngineConfig>? = null,
|
var ktorClientEngineFactory: HttpClientEngineFactory<HttpClientEngineConfig>? = null,
|
||||||
var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null
|
var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null
|
||||||
@@ -37,12 +37,12 @@ public data class BotBuilder internal constructor(
|
|||||||
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
|
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
|
||||||
* [block]
|
* [block]
|
||||||
*/
|
*/
|
||||||
public fun buildBot(
|
fun buildBot(
|
||||||
token: String,
|
token: String,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
block: BotBuilder.() -> Unit
|
block: BotBuilder.() -> Unit
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
||||||
BotBuilder().apply(block).createHttpClient()
|
BotBuilder().apply(block).createHttpClient()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import io.ktor.client.engine.*
|
|||||||
/**
|
/**
|
||||||
* Allows to create bot using bot [urlsKeeper] and already prepared [client]
|
* Allows to create bot using bot [urlsKeeper] and already prepared [client]
|
||||||
*/
|
*/
|
||||||
public fun telegramBot(
|
fun telegramBot(
|
||||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||||
client: HttpClient = HttpClient()
|
client: HttpClient = HttpClient()
|
||||||
): TelegramBot = telegramBot(urlsKeeper) {
|
): TelegramBot = telegramBot(urlsKeeper) {
|
||||||
@@ -23,11 +23,11 @@ public fun telegramBot(
|
|||||||
* configure it with [clientConfig]
|
* configure it with [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun <T: HttpClientEngineConfig> telegramBot(
|
inline fun <T: HttpClientEngineConfig> telegramBot(
|
||||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||||
clientFactory: HttpClientEngineFactory<T>,
|
clientFactory: HttpClientEngineFactory<T>,
|
||||||
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
|
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
urlsKeeper,
|
urlsKeeper,
|
||||||
HttpClient(clientFactory, clientConfig)
|
HttpClient(clientFactory, clientConfig)
|
||||||
)
|
)
|
||||||
@@ -37,11 +37,11 @@ public inline fun <T: HttpClientEngineConfig> telegramBot(
|
|||||||
* configure [HttpClient] using [clientConfig]
|
* configure [HttpClient] using [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun telegramBot(
|
inline fun telegramBot(
|
||||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||||
clientEngine: HttpClientEngine,
|
clientEngine: HttpClientEngine,
|
||||||
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
|
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
urlsKeeper,
|
urlsKeeper,
|
||||||
HttpClient(clientEngine, clientConfig)
|
HttpClient(clientEngine, clientConfig)
|
||||||
)
|
)
|
||||||
@@ -51,10 +51,10 @@ public inline fun telegramBot(
|
|||||||
* [clientConfig]
|
* [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun telegramBot(
|
inline fun telegramBot(
|
||||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||||
noinline clientConfig: HttpClientConfig<*>.() -> Unit
|
noinline clientConfig: HttpClientConfig<*>.() -> Unit
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
urlsKeeper,
|
urlsKeeper,
|
||||||
HttpClient(clientConfig)
|
HttpClient(clientConfig)
|
||||||
)
|
)
|
||||||
@@ -63,7 +63,7 @@ public inline fun telegramBot(
|
|||||||
* Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client]
|
* Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun telegramBot(
|
inline fun telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
@@ -71,13 +71,13 @@ public inline fun telegramBot(
|
|||||||
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client)
|
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client)
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun <T: HttpClientEngineConfig> telegramBot(
|
inline fun <T: HttpClientEngineConfig> telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
clientFactory: HttpClientEngineFactory<T>,
|
clientFactory: HttpClientEngineFactory<T>,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
|
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
||||||
clientFactory,
|
clientFactory,
|
||||||
clientConfig
|
clientConfig
|
||||||
@@ -88,13 +88,13 @@ public inline fun <T: HttpClientEngineConfig> telegramBot(
|
|||||||
* configure [HttpClient] using [clientConfig]
|
* configure [HttpClient] using [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun telegramBot(
|
inline fun telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
clientEngine: HttpClientEngine,
|
clientEngine: HttpClientEngine,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
|
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
||||||
clientEngine,
|
clientEngine,
|
||||||
clientConfig
|
clientConfig
|
||||||
@@ -105,12 +105,12 @@ public inline fun telegramBot(
|
|||||||
* [clientConfig]
|
* [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
public inline fun telegramBot(
|
inline fun telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
noinline clientConfig: HttpClientConfig<*>.() -> Unit
|
noinline clientConfig: HttpClientConfig<*>.() -> Unit
|
||||||
): TelegramBot = telegramBot(
|
) = telegramBot(
|
||||||
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
|
||||||
clientConfig
|
clientConfig
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.local.Close
|
import dev.inmo.tgbotapi.requests.local.Close
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
public suspend inline fun TelegramBot.close(): Boolean = execute(Close)
|
suspend inline fun TelegramBot.close() = execute(Close)
|
||||||
|
|||||||
@@ -5,49 +5,38 @@ import dev.inmo.tgbotapi.requests.DeleteMessage
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.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
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
DeleteMessage(chatId, messageId)
|
DeleteMessage(chatId, messageId)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
): Boolean = deleteMessage(chat.id, messageId)
|
) = deleteMessage(chat.id, messageId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
message: AccessibleMessage
|
message: Message
|
||||||
): Boolean {
|
) = deleteMessage(message.chat, message.messageId)
|
||||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
|
||||||
if (mediaGroupContent == null) {
|
|
||||||
return deleteMessage(message.chat, message.messageId)
|
|
||||||
} else {
|
|
||||||
return mediaGroupContent.group.map {
|
|
||||||
deleteMessage(it.sourceMessage)
|
|
||||||
}.all { it }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
): Boolean = deleteMessage(chatId, messageId)
|
) = deleteMessage(chatId, messageId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
): Boolean = deleteMessage(chat, messageId)
|
) = deleteMessage(chat, messageId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
suspend fun TelegramBot.delete(
|
||||||
message: AccessibleMessage
|
message: Message
|
||||||
): Boolean = deleteMessage(message)
|
) = deleteMessage(message)
|
||||||
|
|
||||||
public suspend fun AccessibleMessage.delete(
|
suspend fun Message.delete(
|
||||||
requestsExecutor: TelegramBot
|
requestsExecutor: TelegramBot
|
||||||
): Boolean = requestsExecutor.deleteMessage(this)
|
) = requestsExecutor.deleteMessage(this)
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.DeleteMessages
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessages(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>
|
|
||||||
): Boolean = messageIds.chunked(deleteMessagesLimit.last).map {
|
|
||||||
execute(
|
|
||||||
DeleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = it
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}.all { it }
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessages(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>
|
|
||||||
): Boolean = deleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = messageIds.toList()
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMessages(
|
|
||||||
messagesMetas: List<Message.MetaInfo>
|
|
||||||
): Boolean = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
|
||||||
deleteMessages(
|
|
||||||
chatId = chatId,
|
|
||||||
messageIds = messages.map { it.messageId }
|
|
||||||
)
|
|
||||||
}.all { it }
|
|
||||||
|
|
||||||
@JvmName("deleteMessagesWithMessages")
|
|
||||||
public suspend fun TelegramBot.deleteMessages(
|
|
||||||
messages: List<AccessibleMessage>
|
|
||||||
): Boolean = deleteMessages(messages.map { it.metaInfo })
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>
|
|
||||||
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>
|
|
||||||
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.delete(
|
|
||||||
messagesMetas: List<Message.MetaInfo>
|
|
||||||
): Boolean = deleteMessages(messagesMetas)
|
|
||||||
|
|
||||||
@JvmName("deleteWithMessages")
|
|
||||||
public suspend fun TelegramBot.delete(
|
|
||||||
messages: List<AccessibleMessage>
|
|
||||||
): Boolean = deleteMessages(messages)
|
|
||||||
@@ -6,60 +6,59 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
|
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = execute(
|
) = execute(
|
||||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
) = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
) = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
|
) = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
) = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|||||||
@@ -1,154 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.copyMessages
|
|
||||||
import dev.inmo.tgbotapi.requests.ForwardMessages
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
||||||
import kotlin.jvm.JvmName
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = messageIds.chunked(forwardMessagesLimit.last).flatMap {
|
|
||||||
execute(
|
|
||||||
ForwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = it,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds.toList(),
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = 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")
|
|
||||||
public suspend fun TelegramBot.forwardMessages(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messages.map { it.metaInfo },
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: List<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
fromChatId: ChatIdentifier,
|
|
||||||
messageIds: Array<MessageId>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
fromChatId = fromChatId,
|
|
||||||
messageIds = messageIds,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messagesMetas = messagesMetas,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
|
|
||||||
@JvmName("forwardWithMessages")
|
|
||||||
public suspend fun TelegramBot.forward(
|
|
||||||
toChatId: ChatIdentifier,
|
|
||||||
messages: List<AccessibleMessage>,
|
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
|
||||||
disableNotification: Boolean = false,
|
|
||||||
protectContent: Boolean = false,
|
|
||||||
removeCaption: Boolean = false
|
|
||||||
): List<MessageId> = forwardMessages(
|
|
||||||
toChatId = toChatId,
|
|
||||||
messages = messages,
|
|
||||||
threadId = threadId,
|
|
||||||
disableNotification = disableNotification,
|
|
||||||
protectContent = protectContent,
|
|
||||||
removeCaption = removeCaption
|
|
||||||
)
|
|
||||||
@@ -5,22 +5,22 @@ import dev.inmo.tgbotapi.requests.GetUpdates
|
|||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
|
||||||
public suspend fun TelegramBot.getUpdates(
|
suspend fun TelegramBot.getUpdates(
|
||||||
offset: UpdateId? = null,
|
offset: UpdateIdentifier? = null,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
): List<Update> = execute(
|
) = execute(
|
||||||
GetUpdates(
|
GetUpdates(
|
||||||
offset, limit, timeout, allowed_updates
|
offset, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.getUpdates(
|
suspend fun TelegramBot.getUpdates(
|
||||||
lastUpdate: Update,
|
lastUpdate: Update,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
): List<Update> = getUpdates(
|
) = getUpdates(
|
||||||
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
import kotlinx.serialization.json.JsonArray
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getRawUpdates(
|
|
||||||
offset: UpdateId? = null,
|
|
||||||
limit: Int = getUpdatesLimit.last,
|
|
||||||
timeout: Seconds? = null,
|
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
|
||||||
): JsonArray = execute(
|
|
||||||
GetUpdatesRaw(
|
|
||||||
offset, limit, timeout, allowed_updates
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getRawUpdates(
|
|
||||||
lastUpdate: Update,
|
|
||||||
limit: Int = getUpdatesLimit.last,
|
|
||||||
timeout: Seconds? = null,
|
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
|
||||||
): JsonArray = getRawUpdates(
|
|
||||||
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
|
||||||
)
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
package dev.inmo.tgbotapi.extensions.api.InternalUtils
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.MediaGroupId
|
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
|
||||||
import dev.inmo.tgbotapi.types.update.*
|
import dev.inmo.tgbotapi.types.update.*
|
||||||
@@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage
|
|||||||
*/
|
*/
|
||||||
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
|
||||||
val resultUpdates = mutableListOf<Update>()
|
val resultUpdates = mutableListOf<Update>()
|
||||||
val mediaGroups = mutableMapOf<MediaGroupId, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
|
||||||
|
|
||||||
for (update in this) {
|
for (update in this) {
|
||||||
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
|
||||||
|
|||||||
@@ -1,38 +1,30 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
||||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.abstracts.Headed
|
import dev.inmo.tgbotapi.abstracts.*
|
||||||
import dev.inmo.tgbotapi.abstracts.HorizontallyAccured
|
|
||||||
import dev.inmo.tgbotapi.abstracts.Locationed
|
|
||||||
import dev.inmo.tgbotapi.abstracts.ProximityAlertable
|
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.edit
|
import dev.inmo.tgbotapi.extensions.api.edit.edit
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.send
|
import dev.inmo.tgbotapi.extensions.api.send.send
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.location.Location
|
import dev.inmo.tgbotapi.types.location.Location
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
import kotlinx.coroutines.CoroutineStart
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.currentCoroutineContext
|
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.FlowCollector
|
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.isActive
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlin.js.JsName
|
import kotlin.js.JsName
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
public data class EditLiveLocationInfo(
|
data class EditLiveLocationInfo(
|
||||||
override val latitude: Double,
|
override val latitude: Double,
|
||||||
override val longitude: Double,
|
override val longitude: Double,
|
||||||
override val horizontalAccuracy: Meters? = null,
|
override val horizontalAccuracy: Meters? = null,
|
||||||
@@ -45,69 +37,53 @@ public data class EditLiveLocationInfo(
|
|||||||
* Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing,
|
* Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing,
|
||||||
* the message will be sent again and new edits will be applied to the new message
|
* the message will be sent again and new edits will be applied to the new message
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.handleLiveLocation(
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LiveLocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
||||||
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||||
null
|
while (isActive) {
|
||||||
} else {
|
delay(liveTimeMillis)
|
||||||
val scope = currentCoroutineContext().LinkedSupervisorScope()
|
// Remove previous location message info to resend live location message
|
||||||
scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
currentLiveLocationMessage = null
|
||||||
while (scope.isActive) {
|
|
||||||
delay(liveTimeMillis)
|
|
||||||
// Remove previous location message info to resend live location message
|
|
||||||
currentLiveLocationMessage = null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
locationsFlow.collect {
|
locationsFlow.collect {
|
||||||
val capturedLiveLocationMessage = currentLiveLocationMessage
|
val capturedLiveLocationMessage = currentLiveLocationMessage
|
||||||
if (capturedLiveLocationMessage == null) {
|
if (capturedLiveLocationMessage == null) {
|
||||||
updateMessageJob ?.start()
|
updateMessageJob.start()
|
||||||
currentLiveLocationMessage = send(
|
currentLiveLocationMessage = send(
|
||||||
chatId,
|
chatId,
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
|
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
|
||||||
LiveLocation.INDEFINITE_LIVE_PERIOD
|
|
||||||
} else {
|
|
||||||
ceil(liveTimeMillis.toDouble() / 1000).toInt()
|
|
||||||
},
|
|
||||||
it.horizontalAccuracy,
|
it.horizontalAccuracy,
|
||||||
it.heading,
|
it.heading,
|
||||||
it.proximityAlertRadius,
|
it.proximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
replyToMessageId,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
)
|
||||||
sentMessageFlow ?.emit(it)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
edit(
|
edit(
|
||||||
message = capturedLiveLocationMessage,
|
capturedLiveLocationMessage,
|
||||||
latitude = it.latitude,
|
it.latitude,
|
||||||
longitude = it.longitude,
|
it.longitude,
|
||||||
horizontalAccuracy = it.horizontalAccuracy,
|
it.horizontalAccuracy,
|
||||||
heading = it.heading,
|
it.heading,
|
||||||
proximityAlertRadius = it.proximityAlertRadius,
|
it.proximityAlertRadius,
|
||||||
replyMarkup = it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
)
|
||||||
sentMessageFlow ?.emit(it)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,21 +94,19 @@ public suspend fun TelegramBot.handleLiveLocation(
|
|||||||
*/
|
*/
|
||||||
@JvmName("handleLiveLocationWithLocation")
|
@JvmName("handleLiveLocationWithLocation")
|
||||||
@JsName("handleLiveLocationWithLocation")
|
@JsName("handleLiveLocationWithLocation")
|
||||||
public suspend fun TelegramBot.handleLiveLocation(
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Location>,
|
locationsFlow: Flow<Location>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId = chatId,
|
chatId,
|
||||||
locationsFlow = locationsFlow.map {
|
locationsFlow.map {
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -142,14 +116,12 @@ public suspend fun TelegramBot.handleLiveLocation(
|
|||||||
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis = liveTimeMillis,
|
liveTimeMillis,
|
||||||
threadId = threadId,
|
threadId,
|
||||||
businessConnectionId = businessConnectionId,
|
disableNotification,
|
||||||
disableNotification = disableNotification,
|
protectContent,
|
||||||
protectContent = protectContent,
|
replyToMessageId,
|
||||||
effectId = effectId,
|
allowSendingWithoutReply
|
||||||
replyParameters = replyParameters,
|
|
||||||
sentMessageFlow = sentMessageFlow
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,33 +131,29 @@ public suspend fun TelegramBot.handleLiveLocation(
|
|||||||
*/
|
*/
|
||||||
@JvmName("handleLiveLocationWithLatLong")
|
@JvmName("handleLiveLocationWithLatLong")
|
||||||
@JsName("handleLiveLocationWithLatLong")
|
@JsName("handleLiveLocationWithLatLong")
|
||||||
public suspend fun TelegramBot.handleLiveLocation(
|
suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Pair<Double, Double>>,
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId = chatId,
|
chatId,
|
||||||
locationsFlow = locationsFlow.map { (lat, long) ->
|
locationsFlow.map { (lat, long) ->
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
lat,
|
lat,
|
||||||
long
|
long
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis = liveTimeMillis,
|
liveTimeMillis,
|
||||||
threadId = threadId,
|
threadId,
|
||||||
businessConnectionId = businessConnectionId,
|
disableNotification,
|
||||||
disableNotification = disableNotification,
|
protectContent,
|
||||||
protectContent = protectContent,
|
replyToMessageId,
|
||||||
effectId = effectId,
|
allowSendingWithoutReply
|
||||||
replyParameters = replyParameters,
|
|
||||||
sentMessageFlow = sentMessageFlow
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,32 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import korlibs.time.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import korlibs.time.TimeSpan
|
import com.soywiz.klock.TimeSpan
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
|
||||||
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
||||||
import io.ktor.utils.io.core.Closeable
|
import io.ktor.utils.io.core.Closeable
|
||||||
import korlibs.time.millisecondsLong
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
public const val indefiniteLivePeriodDelayMillis: Long = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
||||||
public const val defaultLivePeriodDelayMillis: Long = indefiniteLivePeriodDelayMillis
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see startLiveLocation
|
* @see startLiveLocation
|
||||||
*/
|
*/
|
||||||
public class LiveLocationProvider internal constructor(
|
class LiveLocationProvider internal constructor(
|
||||||
private val requestsExecutor: TelegramBot,
|
private val requestsExecutor: TelegramBot,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
autoCloseTimeDelay: Double,
|
autoCloseTimeDelay: Double,
|
||||||
@@ -41,23 +38,22 @@ public class LiveLocationProvider internal constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay)
|
private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay)
|
||||||
public val leftUntilCloseMillis: TimeSpan
|
val leftUntilCloseMillis: TimeSpan
|
||||||
get() = autoCloseTime - DateTime.now()
|
get() = autoCloseTime - DateTime.now()
|
||||||
|
|
||||||
public var isClosed: Boolean = false
|
var isClosed: Boolean = false
|
||||||
private set
|
private set
|
||||||
get() = field || leftUntilCloseMillis.millisecondsLong < 0L
|
get() = field || leftUntilCloseMillis.millisecondsLong < 0L
|
||||||
|
|
||||||
public var message: ContentMessage<LocationContent> = initMessage
|
private var message: ContentMessage<LocationContent> = initMessage
|
||||||
private set
|
val lastLocation: LiveLocation
|
||||||
public val lastLocation: LiveLocation
|
|
||||||
get() = message.content.location as LiveLocation
|
get() = message.content.location as LiveLocation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun updateLocation(
|
suspend fun updateLocation(
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): LiveLocation {
|
): LiveLocation {
|
||||||
@@ -65,7 +61,7 @@ public class LiveLocationProvider internal constructor(
|
|||||||
message = requestsExecutor.editLiveLocation(
|
message = requestsExecutor.editLiveLocation(
|
||||||
message,
|
message,
|
||||||
location,
|
location,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
return lastLocation
|
return lastLocation
|
||||||
} else {
|
} else {
|
||||||
@@ -86,7 +82,7 @@ public class LiveLocationProvider internal constructor(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -96,11 +92,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
val liveTimeAsDouble = liveTimeMillis.toDouble()
|
||||||
@@ -114,11 +109,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
replyToMessageId,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -135,7 +129,7 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -145,11 +139,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -161,11 +154,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
replyToMessageId,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -173,7 +165,7 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -182,11 +174,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -198,11 +189,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
replyToMessageId,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -210,7 +200,7 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -219,11 +209,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
@@ -235,11 +224,10 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
replyToMessageId,
|
||||||
replyParameters,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -247,8 +235,8 @@ public suspend fun TelegramBot.startLiveLocation(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
@@ -257,13 +245,11 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
) = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
to.chat,
|
to.chat,
|
||||||
latitude,
|
latitude,
|
||||||
@@ -273,11 +259,10 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
to.messageId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -285,8 +270,8 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
public suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
@@ -294,13 +279,11 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
threadId: MessageThreadId? = to.threadIdOrNull,
|
threadId: MessageThreadId? = to.threadIdOrNull,
|
||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
effectId: EffectId? = null,
|
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
) = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
to.chat,
|
to.chat,
|
||||||
location,
|
location,
|
||||||
@@ -309,10 +292,9 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
threadId,
|
threadId,
|
||||||
businessConnectionId,
|
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
effectId,
|
to.messageId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.local.LogOut
|
import dev.inmo.tgbotapi.requests.local.LogOut
|
||||||
|
|
||||||
public suspend inline fun TelegramBot.logOut(): Boolean = execute(LogOut)
|
suspend inline fun TelegramBot.logOut() = execute(LogOut)
|
||||||
|
|||||||
@@ -3,54 +3,48 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.StopPoll
|
import dev.inmo.tgbotapi.requests.StopPoll
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.polls.Poll
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): Poll = execute(
|
) = execute(
|
||||||
StopPoll(chatId, messageId, businessConnectionId, replyMarkup)
|
StopPoll(chatId, messageId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): Poll = stopPoll(chat.id, messageId, businessConnectionId, replyMarkup)
|
) = stopPoll(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): Poll = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup)
|
) = stopPoll(chatId, message.messageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): Poll = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup)
|
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
||||||
|
|||||||
@@ -3,28 +3,28 @@ package dev.inmo.tgbotapi.extensions.api.answers
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
|
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||||
import dev.inmo.tgbotapi.types.CallbackQueryId
|
import dev.inmo.tgbotapi.types.CallbackQueryIdentifier
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerCallbackQuery(
|
suspend fun TelegramBot.answerCallbackQuery(
|
||||||
callbackQueryId: CallbackQueryId,
|
callbackQueryId: CallbackQueryIdentifier,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
showAlert: Boolean? = null,
|
showAlert: Boolean? = null,
|
||||||
url: String? = null,
|
url: String? = null,
|
||||||
cachedTimeSeconds: Int? = null
|
cachedTimeSeconds: Int? = null
|
||||||
): Boolean = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
|
) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerCallbackQuery(
|
suspend fun TelegramBot.answerCallbackQuery(
|
||||||
callbackQuery: CallbackQuery,
|
callbackQuery: CallbackQuery,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
showAlert: Boolean? = null,
|
showAlert: Boolean? = null,
|
||||||
url: String? = null,
|
url: String? = null,
|
||||||
cachedTimeSeconds: Int? = null
|
cachedTimeSeconds: Int? = null
|
||||||
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
|
|
||||||
public suspend fun TelegramBot.answer(
|
suspend fun TelegramBot.answer(
|
||||||
callbackQuery: CallbackQuery,
|
callbackQuery: CallbackQuery,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
showAlert: Boolean? = null,
|
showAlert: Boolean? = null,
|
||||||
url: String? = null,
|
url: String? = null,
|
||||||
cachedTimeSeconds: Int? = null
|
cachedTimeSeconds: Int? = null
|
||||||
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
|
|||||||
@@ -2,68 +2,38 @@ package dev.inmo.tgbotapi.extensions.api.answers
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.answers.AnswerInlineQuery
|
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.InlineQueryResult.abstracts.InlineQueryResult
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||||
import dev.inmo.tgbotapi.types.InlineQueryId
|
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerInlineQuery(
|
suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQueryID: InlineQueryId,
|
inlineQueryID: InlineQueryIdentifier,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
isPersonal: Boolean? = null,
|
isPersonal: Boolean? = null,
|
||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
button: InlineQueryResultsButton? = null
|
switchPmText: String? = null,
|
||||||
): Boolean = execute(
|
switchPmParameter: String? = null
|
||||||
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, button)
|
) = execute(
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerInlineQuery(
|
|
||||||
inlineQuery: InlineQuery,
|
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
|
||||||
cachedTime: Int? = null,
|
|
||||||
isPersonal: Boolean? = null,
|
|
||||||
nextOffset: String? = null,
|
|
||||||
button: InlineQueryResultsButton? = null
|
|
||||||
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.answer(
|
|
||||||
inlineQuery: InlineQuery,
|
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
|
||||||
cachedTime: Int? = null,
|
|
||||||
isPersonal: Boolean? = null,
|
|
||||||
nextOffset: String? = null,
|
|
||||||
button: InlineQueryResultsButton? = null
|
|
||||||
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerInlineQuery(
|
|
||||||
inlineQueryID: InlineQueryId,
|
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
|
||||||
cachedTime: Int? = null,
|
|
||||||
isPersonal: Boolean? = null,
|
|
||||||
nextOffset: String? = null,
|
|
||||||
switchPmText: String?,
|
|
||||||
switchPmParameter: String?
|
|
||||||
): Boolean = execute(
|
|
||||||
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerInlineQuery(
|
suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQuery: InlineQuery,
|
inlineQuery: InlineQuery,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
isPersonal: Boolean? = null,
|
isPersonal: Boolean? = null,
|
||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
switchPmText: String?,
|
switchPmText: String? = null,
|
||||||
switchPmParameter: String?
|
switchPmParameter: String? = null
|
||||||
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
|
|
||||||
public suspend fun TelegramBot.answer(
|
suspend fun TelegramBot.answer(
|
||||||
inlineQuery: InlineQuery,
|
inlineQuery: InlineQuery,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
isPersonal: Boolean? = null,
|
isPersonal: Boolean? = null,
|
||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
switchPmText: String?,
|
switchPmText: String? = null,
|
||||||
switchPmParameter: String?
|
switchPmParameter: String? = null
|
||||||
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
|
|||||||
@@ -4,14 +4,13 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.answers.AnswerWebAppQuery
|
import dev.inmo.tgbotapi.requests.answers.AnswerWebAppQuery
|
||||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
||||||
import dev.inmo.tgbotapi.types.WebAppQueryId
|
import dev.inmo.tgbotapi.types.WebAppQueryId
|
||||||
import dev.inmo.tgbotapi.types.webapps.query.SentWebAppMessage
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerWebAppQuery(
|
suspend fun TelegramBot.answerWebAppQuery(
|
||||||
webAppQueryId: WebAppQueryId,
|
webAppQueryId: WebAppQueryId,
|
||||||
result: InlineQueryResult
|
result: InlineQueryResult
|
||||||
): SentWebAppMessage = execute(AnswerWebAppQuery(webAppQueryId, result))
|
) = execute(AnswerWebAppQuery(webAppQueryId, result))
|
||||||
|
|
||||||
public suspend fun TelegramBot.answer(
|
suspend fun TelegramBot.answer(
|
||||||
webAppQueryId: WebAppQueryId,
|
webAppQueryId: WebAppQueryId,
|
||||||
result: InlineQueryResult
|
result: InlineQueryResult
|
||||||
): SentWebAppMessage = execute(AnswerWebAppQuery(webAppQueryId, result))
|
) = execute(AnswerWebAppQuery(webAppQueryId, result))
|
||||||
|
|||||||
@@ -6,18 +6,18 @@ import dev.inmo.tgbotapi.requests.answers.payments.AnswerPreCheckoutQueryOk
|
|||||||
import dev.inmo.tgbotapi.types.PreCheckoutQueryId
|
import dev.inmo.tgbotapi.types.PreCheckoutQueryId
|
||||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
||||||
id: PreCheckoutQueryId
|
id: PreCheckoutQueryId
|
||||||
): Boolean = execute(AnswerPreCheckoutQueryOk(id))
|
) = execute(AnswerPreCheckoutQueryOk(id))
|
||||||
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
||||||
preCheckoutQuery: PreCheckoutQuery
|
preCheckoutQuery: PreCheckoutQuery
|
||||||
): Boolean = answerPreCheckoutQueryOk(preCheckoutQuery.id)
|
) = answerPreCheckoutQueryOk(preCheckoutQuery.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerPreCheckoutQueryError(
|
suspend fun TelegramBot.answerPreCheckoutQueryError(
|
||||||
id: PreCheckoutQueryId,
|
id: PreCheckoutQueryId,
|
||||||
error: String
|
error: String
|
||||||
): Boolean = execute(AnswerPreCheckoutQueryError(id, error))
|
) = execute(AnswerPreCheckoutQueryError(id, error))
|
||||||
public suspend fun TelegramBot.answerPreCheckoutQueryError(
|
suspend fun TelegramBot.answerPreCheckoutQueryError(
|
||||||
preCheckoutQuery: PreCheckoutQuery,
|
preCheckoutQuery: PreCheckoutQuery,
|
||||||
error: String
|
error: String
|
||||||
): Boolean = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
|
) = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
|
||||||
|
|||||||
@@ -3,26 +3,26 @@ package dev.inmo.tgbotapi.extensions.api.answers.payments
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryError
|
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryError
|
||||||
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryOk
|
import dev.inmo.tgbotapi.requests.answers.payments.AnswerShippingQueryOk
|
||||||
import dev.inmo.tgbotapi.types.ShippingQueryId
|
import dev.inmo.tgbotapi.types.ShippingQueryIdentifier
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerShippingQueryOk(
|
suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
id: ShippingQueryId,
|
id: ShippingQueryIdentifier,
|
||||||
shippingOptions: List<ShippingOption>
|
shippingOptions: List<ShippingOption>
|
||||||
): Boolean = execute(AnswerShippingQueryOk(id, shippingOptions))
|
) = execute(AnswerShippingQueryOk(id, shippingOptions))
|
||||||
public suspend fun TelegramBot.answerShippingQueryOk(
|
suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
shippingQuery: ShippingQuery,
|
shippingQuery: ShippingQuery,
|
||||||
shippingOptions: List<ShippingOption>
|
shippingOptions: List<ShippingOption>
|
||||||
): Boolean = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
) = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
||||||
|
|
||||||
public suspend fun TelegramBot.answerShippingQueryError(
|
suspend fun TelegramBot.answerShippingQueryError(
|
||||||
id: ShippingQueryId,
|
id: ShippingQueryIdentifier,
|
||||||
error: String
|
error: String
|
||||||
): Boolean = execute(AnswerShippingQueryError(id, error))
|
) = execute(AnswerShippingQueryError(id, error))
|
||||||
public suspend fun TelegramBot.answerShippingQueryError(
|
suspend fun TelegramBot.answerShippingQueryError(
|
||||||
shippingQuery: ShippingQuery,
|
shippingQuery: ShippingQuery,
|
||||||
error: String
|
error: String
|
||||||
): Boolean = answerShippingQueryError(shippingQuery.id, error)
|
) = answerShippingQueryError(shippingQuery.id, error)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.ClearMyDefaultAdministratorRights
|
import dev.inmo.tgbotapi.requests.bot.ClearMyDefaultAdministratorRights
|
||||||
|
|
||||||
public suspend fun TelegramBot.clearMyDefaultAdministratorRights(
|
suspend fun TelegramBot.clearMyDefaultAdministratorRights(
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
): Boolean = execute(ClearMyDefaultAdministratorRights(forChannels))
|
) = execute(ClearMyDefaultAdministratorRights(forChannels))
|
||||||
|
|
||||||
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels(): Boolean = clearMyDefaultAdministratorRights(forChannels = true)
|
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels() = clearMyDefaultAdministratorRights(forChannels = true)
|
||||||
|
|
||||||
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups(): Boolean = clearMyDefaultAdministratorRights(forChannels = false)
|
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups() = clearMyDefaultAdministratorRights(forChannels = false)
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMyCommands(
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
): Boolean = execute(DeleteMyCommands(scope, languageCode))
|
) = execute(DeleteMyCommands(scope, languageCode))
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteMyCommands(
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
): Boolean = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
|
) = deleteMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMe
|
import dev.inmo.tgbotapi.requests.bot.GetMe
|
||||||
import dev.inmo.tgbotapi.types.chat.ExtendedBot
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMe(): ExtendedBot = execute(GetMe)
|
suspend fun TelegramBot.getMe() = execute(GetMe)
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
): List<BotCommand> = execute(GetMyCommands(scope, languageCode))
|
) = execute(GetMyCommands(scope, languageCode))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
): List<BotCommand> = getMyCommands(scope, languageCode ?.let(::IetfLang))
|
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyDefaultAdministratorRights
|
import dev.inmo.tgbotapi.requests.bot.GetMyDefaultAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyDefaultAdministratorRights(
|
suspend fun TelegramBot.getMyDefaultAdministratorRights(
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
): AdministratorChatMember = execute(GetMyDefaultAdministratorRights(forChannels))
|
) = execute(GetMyDefaultAdministratorRights(forChannels))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = true)
|
suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels() = getMyDefaultAdministratorRights(forChannels = true)
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = false)
|
suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups() = getMyDefaultAdministratorRights(forChannels = false)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
|
||||||
import dev.inmo.tgbotapi.types.BotDescription
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyDescription(
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): BotDescription = execute(GetMyDescription(languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyDescription(
|
|
||||||
languageCode: String?
|
|
||||||
): BotDescription = getMyDescription(languageCode ?.let(::IetfLang))
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
|
||||||
import dev.inmo.tgbotapi.types.BotName
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyName(
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): BotName = execute(GetMyName(languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyName(
|
|
||||||
languageCode: String?
|
|
||||||
): BotName = getMyName(languageCode ?.let(::IetfLang))
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
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
|
|
||||||
import dev.inmo.tgbotapi.types.BotShortDescription
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyShortDescription(
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): BotShortDescription = execute(GetMyShortDescription(languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getMyShortDescription(
|
|
||||||
languageCode: String?
|
|
||||||
): BotShortDescription = getMyShortDescription(languageCode ?.let(::IetfLang))
|
|
||||||
@@ -1,32 +1,32 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
): Boolean = execute(SetMyCommands(commands, scope, languageCode))
|
) = execute(SetMyCommands(commands, scope, languageCode))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLanguageCode?
|
||||||
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
|
) = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
): Boolean = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
|
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
|
) = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
||||||
rights: ChatCommonAdministratorRights,
|
rights: ChatAdministratorRightsImpl,
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
): Boolean = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatAdministratorRightsImpl
|
||||||
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = true)
|
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatAdministratorRightsImpl
|
||||||
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = false)
|
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
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.requests.bot.SetMyDescription
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyDescription(
|
|
||||||
description: String? = null,
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): Boolean = execute(SetMyDescription(description, languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyDescription(
|
|
||||||
description: String?,
|
|
||||||
languageCode: String?
|
|
||||||
): Boolean = setMyDescription(description, languageCode ?.let(::IetfLang))
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
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.requests.bot.SetMyName
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyName(
|
|
||||||
name: String? = null,
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): Boolean = execute(SetMyName(name, languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyName(
|
|
||||||
name: String?,
|
|
||||||
languageCode: String?
|
|
||||||
): Boolean = setMyName(name, languageCode ?.let(::IetfLang))
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
|
||||||
|
|
||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyShortDescription(
|
|
||||||
shortDescription: String? = null,
|
|
||||||
languageCode: IetfLang? = null
|
|
||||||
): Boolean = execute(SetMyShortDescription(shortDescription, languageCode))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setMyShortDescription(
|
|
||||||
shortDescription: String?,
|
|
||||||
languageCode: String?
|
|
||||||
): Boolean = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
|
|
||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.ExportChatInviteLink
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.exportChatInviteLink(
|
suspend fun TelegramBot.exportChatInviteLink(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): String = execute(ExportChatInviteLink(chatId))
|
) = execute(ExportChatInviteLink(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.exportChatInviteLink(
|
suspend fun TelegramBot.exportChatInviteLink(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): String = exportChatInviteLink(chat.id)
|
) = exportChatInviteLink(chat.id)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.LeaveChat
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.leaveChat(
|
suspend fun TelegramBot.leaveChat(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): Boolean = execute(LeaveChat(chatId))
|
) = execute(LeaveChat(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.leaveChat(
|
suspend fun TelegramBot.leaveChat(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): Boolean = leaveChat(chat.id)
|
) = leaveChat(chat.id)
|
||||||
|
|||||||
@@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic
|
|||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.closeForumTopic(
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
CloseForumTopic(
|
CloseForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.closeForumTopic(
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = closeForumTopic(chat.id, messageThreadId)
|
) = closeForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.closeForumTopic(
|
suspend fun TelegramBot.closeForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
): Boolean = closeForumTopic(chat.id, forumTopic.messageThreadId)
|
) = closeForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.closeGeneralForumTopic(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
): Boolean = execute(
|
|
||||||
CloseGeneralForumTopic(chatId)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.closeGeneralForumTopic(
|
|
||||||
chat: Chat
|
|
||||||
): Boolean = closeGeneralForumTopic(chat.id)
|
|
||||||
@@ -4,16 +4,15 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.forum.CreateForumTopic
|
import dev.inmo.tgbotapi.requests.chat.forum.CreateForumTopic
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.CustomEmojiId
|
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.utils.RGBColor
|
import dev.inmo.tgbotapi.utils.RGBColor
|
||||||
|
|
||||||
public suspend fun TelegramBot.createForumTopic(
|
suspend fun TelegramBot.createForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String,
|
name: String,
|
||||||
color: RGBColor,
|
color: RGBColor,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
): ForumTopic = execute(
|
) = execute(
|
||||||
CreateForumTopic(
|
CreateForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
name,
|
name,
|
||||||
@@ -22,9 +21,9 @@ public suspend fun TelegramBot.createForumTopic(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.createForumTopic(
|
suspend fun TelegramBot.createForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
name: String,
|
name: String,
|
||||||
color: RGBColor,
|
color: RGBColor,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
): ForumTopic = createForumTopic(chat.id, name, color, iconEmojiId)
|
) = createForumTopic(chat.id, name, color, iconEmojiId)
|
||||||
|
|||||||
@@ -7,27 +7,27 @@ import dev.inmo.tgbotapi.types.ForumTopic
|
|||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteForumTopic(
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
DeleteForumTopic(
|
DeleteForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteForumTopic(
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
): Boolean = deleteForumTopic(chatId, forumTopic.messageThreadId)
|
) = deleteForumTopic(chatId, forumTopic.messageThreadId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteForumTopic(
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = deleteForumTopic(chat.id, messageThreadId)
|
) = deleteForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteForumTopic(
|
suspend fun TelegramBot.deleteForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
): Boolean = deleteForumTopic(chat.id, forumTopic.messageThreadId)
|
) = deleteForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.types.ForumTopic
|
|||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.editForumTopic(
|
suspend fun TelegramBot.editForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId,
|
messageThreadId: MessageThreadId,
|
||||||
name: String? = null,
|
name: String,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
EditForumTopic(
|
EditForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId,
|
messageThreadId,
|
||||||
@@ -22,15 +22,15 @@ public suspend fun TelegramBot.editForumTopic(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editForumTopic(
|
suspend fun TelegramBot.editForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId,
|
messageThreadId: MessageThreadId,
|
||||||
name: String? = null,
|
name: String,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId
|
||||||
): Boolean = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
|
) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editForumTopic(
|
suspend fun TelegramBot.editForumTopic(
|
||||||
chatIdentifier: ChatIdentifier,
|
chatIdentifier: ChatIdentifier,
|
||||||
forumTopic: ForumTopic,
|
forumTopic: ForumTopic,
|
||||||
iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId
|
iconEmojiId: CustomEmojiId = forumTopic.iconEmojiId ?: error("Icon emoji id in forum topic should be presented when edit forum topic basing on other forum topic object")
|
||||||
): Boolean = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
|
) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.EditForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.EditGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.CustomEmojiId
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.editGeneralForumTopic(
|
|
||||||
chatId: ChatIdentifier,
|
|
||||||
name: String
|
|
||||||
): Boolean = execute(
|
|
||||||
EditGeneralForumTopic(
|
|
||||||
chatId,
|
|
||||||
name
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.editGeneralForumTopic(
|
|
||||||
chat: Chat,
|
|
||||||
name: String
|
|
||||||
): Boolean = editGeneralForumTopic(chat.id, name)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.editGeneralForumTopic(
|
|
||||||
chatIdentifier: ChatIdentifier,
|
|
||||||
forumTopic: ForumTopic,
|
|
||||||
): Boolean = editGeneralForumTopic(chatIdentifier, forumTopic.name)
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.HideGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.hideGeneralForumTopic(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
): Boolean = execute(
|
|
||||||
HideGeneralForumTopic(chatId)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.hideGeneralForumTopic(
|
|
||||||
chat: Chat
|
|
||||||
): Boolean = hideGeneralForumTopic(chat.id)
|
|
||||||
@@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic
|
|||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.reopenForumTopic(
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
ReopenForumTopic(
|
ReopenForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.reopenForumTopic(
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = reopenForumTopic(chat.id, messageThreadId)
|
) = reopenForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.reopenForumTopic(
|
suspend fun TelegramBot.reopenForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
): Boolean = reopenForumTopic(chat.id, forumTopic.messageThreadId)
|
) = reopenForumTopic(chat.id, forumTopic.messageThreadId)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.ReopenForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.ReopenGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.reopenGeneralForumTopic(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
): Boolean = execute(
|
|
||||||
ReopenGeneralForumTopic(chatId)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.reopenGeneralForumTopic(
|
|
||||||
chat: Chat
|
|
||||||
): Boolean = reopenGeneralForumTopic(chat.id)
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.CloseGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.HideGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.UnhideGeneralForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unhideGeneralForumTopic(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
): Boolean = execute(
|
|
||||||
UnhideGeneralForumTopic(chatId)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unhideGeneralForumTopic(
|
|
||||||
chat: Chat
|
|
||||||
): Boolean = unhideGeneralForumTopic(chat.id)
|
|
||||||
@@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ForumTopic
|
|||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = execute(
|
) = execute(
|
||||||
UnpinAllForumTopicMessages(
|
UnpinAllForumTopicMessages(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
): Boolean = unpinAllForumTopicMessages(chat.id, messageThreadId)
|
) = unpinAllForumTopicMessages(chat.id, messageThreadId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
): Boolean = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
|
) = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.forum
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllForumTopicMessages
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllGeneralForumTopicMessages
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ForumTopic
|
|
||||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
): Boolean = execute(
|
|
||||||
UnpinAllGeneralForumTopicMessages(
|
|
||||||
chatId
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
|
||||||
chat: Chat
|
|
||||||
): Boolean = unpinAllGeneralForumTopicMessages(chat.id)
|
|
||||||
@@ -3,16 +3,36 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetChat
|
import dev.inmo.tgbotapi.requests.chat.get.GetChat
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ChannelChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.ExtendedUser
|
||||||
|
import dev.inmo.tgbotapi.types.chat.GroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.GroupChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PrivateChatImpl
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||||
|
import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl
|
||||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): ExtendedChat = execute(GetChat(chatId))
|
) = execute(GetChat(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
): ExtendedChat = getChat(chat.id)
|
) = getChat(chat.id)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -21,9 +41,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): ExtendedPublicChat = getChat(chat.id) as ExtendedPublicChat
|
) = getChat(chat.id) as ExtendedPublicChat
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,9 +53,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: ChannelChat
|
chat: ChannelChat
|
||||||
): ExtendedChannelChat = getChat(chat.id) as ExtendedChannelChat
|
) = getChat(chat.id) as ExtendedChannelChat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -44,9 +64,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: ChannelChatImpl
|
chat: ChannelChatImpl
|
||||||
): ExtendedChannelChatImpl = getChat(chat.id) as ExtendedChannelChatImpl
|
) = getChat(chat.id) as ExtendedChannelChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,9 +76,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: GroupChat
|
chat: GroupChat
|
||||||
): ExtendedGroupChat = getChat(chat.id) as ExtendedGroupChat
|
) = getChat(chat.id) as ExtendedGroupChat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -67,9 +87,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: GroupChatImpl
|
chat: GroupChatImpl
|
||||||
): ExtendedGroupChatImpl = getChat(chat.id) as ExtendedGroupChatImpl
|
) = getChat(chat.id) as ExtendedGroupChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,9 +99,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: SupergroupChat
|
chat: SupergroupChat
|
||||||
): ExtendedSupergroupChat = getChat(chat.id) as ExtendedSupergroupChat
|
) = getChat(chat.id) as ExtendedSupergroupChat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -90,9 +110,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: SupergroupChatImpl
|
chat: SupergroupChatImpl
|
||||||
): ExtendedSupergroupChatImpl = getChat(chat.id) as ExtendedSupergroupChatImpl
|
) = getChat(chat.id) as ExtendedSupergroupChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,9 +122,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: PrivateChat
|
chat: PrivateChat
|
||||||
): ExtendedPrivateChat = getChat(chat.id) as ExtendedPrivateChat
|
) = getChat(chat.id) as ExtendedPrivateChat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -113,9 +133,9 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: PrivateChatImpl
|
chat: PrivateChatImpl
|
||||||
): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl
|
) = getChat(chat.id) as ExtendedPrivateChatImpl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||||
@@ -124,6 +144,6 @@ public suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
public suspend fun TelegramBot.getChat(
|
suspend fun TelegramBot.getChat(
|
||||||
chat: CommonUser
|
chat: CommonUser
|
||||||
): ExtendedUser = getChat(chat.id) as ExtendedUser
|
) = getChat(chat.id) as ExtendedUser
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatAdministrators
|
import dev.inmo.tgbotapi.requests.chat.get.GetChatAdministrators
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatAdministrators(
|
suspend fun TelegramBot.getChatAdministrators(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): List<AdministratorChatMember> = execute(GetChatAdministrators(chatId))
|
) = execute(GetChatAdministrators(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatAdministrators(
|
suspend fun TelegramBot.getChatAdministrators(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): List<AdministratorChatMember> = getChatAdministrators(chat.id)
|
) = getChatAdministrators(chat.id)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMemberCount(
|
suspend fun TelegramBot.getChatMemberCount(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): Int = execute(GetChatMemberCount(chatId))
|
) = execute(GetChatMemberCount(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMemberCount(
|
suspend fun TelegramBot.getChatMemberCount(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): Int = getChatMemberCount(chat.id)
|
) = getChatMemberCount(chat.id)
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MenuButton
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMenuButton(
|
suspend fun TelegramBot.getChatMenuButton(
|
||||||
chatId: IdChatIdentifier
|
chatId: IdChatIdentifier
|
||||||
): MenuButton = execute(GetChatMenuButton(chatId))
|
) = execute(GetChatMenuButton(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMenuButton(
|
suspend fun TelegramBot.getChatMenuButton(
|
||||||
chat: PrivateChat
|
chat: PrivateChat
|
||||||
): MenuButton = getChatMenuButton(chat.id)
|
) = getChatMenuButton(chat.id)
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton
|
import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton
|
||||||
import dev.inmo.tgbotapi.types.MenuButton
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getDefaultChatMenuButton(): MenuButton = execute(GetDefaultChatMenuButton)
|
suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton)
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.get.GetForumTopicIconStickers
|
import dev.inmo.tgbotapi.requests.chat.get.GetForumTopicIconStickers
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getForumTopicIconStickers(): List<Sticker> = execute(GetForumTopicIconStickers)
|
suspend fun TelegramBot.getForumTopicIconStickers() = execute(GetForumTopicIconStickers)
|
||||||
|
|||||||
@@ -9,34 +9,34 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
|
|||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): Boolean = execute(ApproveChatJoinRequest(chatId, userId))
|
) = execute(ApproveChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): Boolean = approveChatJoinRequest(chat.id, userId)
|
) = approveChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
): Boolean = approveChatJoinRequest(chatId, user.id)
|
) = approveChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
): Boolean = approveChatJoinRequest(chat.id, user.id)
|
) = approveChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
): Boolean = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
) = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
public suspend fun TelegramBot.approve(
|
suspend fun TelegramBot.approve(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
): Boolean = approveChatJoinRequest(chatJoinRequest)
|
) = approveChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
public suspend fun TelegramBot.approveChatJoinRequest(
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
): Boolean = approveChatJoinRequest(chatJoinRequestUpdate.data)
|
) = approveChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
|
|||||||
@@ -1,83 +1,86 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
import korlibs.time.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.MembersLimit
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.toTelegramDate
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkUnlimited = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
|
) = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration)
|
) = createChatInviteLinkUnlimited(chat.id, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
|
) = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null
|
name: String? = null
|
||||||
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
|
) = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithLimitedMembers = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
|
) = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
|
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
|
) = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
|
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithJoinRequest = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
|
) = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
|
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
|
) = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())
|
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())
|
||||||
|
|||||||
@@ -9,34 +9,34 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
|
|||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): Boolean = execute(DeclineChatJoinRequest(chatId, userId))
|
) = execute(DeclineChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): Boolean = declineChatJoinRequest(chat.id, userId)
|
) = declineChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
): Boolean = declineChatJoinRequest(chatId, user.id)
|
) = declineChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
): Boolean = declineChatJoinRequest(chat.id, user.id)
|
) = declineChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
): Boolean = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
) = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
public suspend fun TelegramBot.decline(
|
suspend fun TelegramBot.decline(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
): Boolean = declineChatJoinRequest(chatJoinRequest)
|
) = declineChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
public suspend fun TelegramBot.declineChatJoinRequest(
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
): Boolean = declineChatJoinRequest(chatJoinRequestUpdate.data)
|
) = declineChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
|
|||||||
@@ -1,183 +1,187 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
import korlibs.time.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||||
|
import dev.inmo.tgbotapi.types.MembersLimit
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.toTelegramDate
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkUnlimited = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithLimitedMembers = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithJoinRequest = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|||||||
@@ -4,25 +4,24 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.RevokeChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.RevokeChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.ChatInviteLink
|
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.SecondaryChatInviteLink
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.revokeChatInviteLink(
|
suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String
|
previousLink: String
|
||||||
): SecondaryChatInviteLink = execute(RevokeChatInviteLink(chatId, previousLink))
|
) = execute(RevokeChatInviteLink(chatId, previousLink))
|
||||||
|
|
||||||
public suspend fun TelegramBot.revokeChatInviteLink(
|
suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String
|
previousLink: String
|
||||||
): SecondaryChatInviteLink = revokeChatInviteLink(chat.id, previousLink)
|
) = revokeChatInviteLink(chat.id, previousLink)
|
||||||
|
|
||||||
public suspend fun TelegramBot.revokeChatInviteLink(
|
suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink
|
previousLink: ChatInviteLink
|
||||||
): SecondaryChatInviteLink = revokeChatInviteLink(chatId, previousLink.inviteLink)
|
) = revokeChatInviteLink(chatId, previousLink.inviteLink)
|
||||||
|
|
||||||
public suspend fun TelegramBot.revokeChatInviteLink(
|
suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink
|
previousLink: ChatInviteLink
|
||||||
): SecondaryChatInviteLink = revokeChatInviteLink(chat, previousLink.inviteLink)
|
) = revokeChatInviteLink(chat, previousLink.inviteLink)
|
||||||
|
|||||||
@@ -9,30 +9,30 @@ import dev.inmo.tgbotapi.types.UserId
|
|||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatMember(
|
suspend fun TelegramBot.banChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
): Boolean = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
|
) = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatMember(
|
suspend fun TelegramBot.banChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
): Boolean = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
) = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatMember(
|
suspend fun TelegramBot.banChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
): Boolean = banChatMember(chatId, user.id, untilDate, revokeMessages)
|
) = banChatMember(chatId, user.id, untilDate, revokeMessages)
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatMember(
|
suspend fun TelegramBot.banChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
): Boolean = banChatMember(chat.id, user.id, untilDate, revokeMessages)
|
) = banChatMember(chat.id, user.id, untilDate, revokeMessages)
|
||||||
|
|||||||
@@ -6,22 +6,22 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatSenderChat(
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
): Boolean = execute(BanChatSenderChat(chatId, senderChatId))
|
) = execute(BanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatSenderChat(
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
): Boolean = banChatSenderChat(chat.id, senderChatId)
|
) = banChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatSenderChat(
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
senderChat: PublicChat
|
senderChat: PublicChat
|
||||||
): Boolean = banChatSenderChat(chatId, senderChat.id)
|
) = banChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.banChatSenderChat(
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChat: PublicChat,
|
senderChat: PublicChat,
|
||||||
): Boolean = banChatSenderChat(chat.id, senderChat)
|
) = banChatSenderChat(chat.id, senderChat)
|
||||||
|
|||||||
@@ -7,24 +7,23 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.UserId
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatMember
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMember(
|
suspend fun TelegramBot.getChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): ChatMember = execute(GetChatMember(chatId, userId))
|
) = execute(GetChatMember(chatId, userId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMember(
|
suspend fun TelegramBot.getChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
): ChatMember = getChatMember(chat.id, userId)
|
) = getChatMember(chat.id, userId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMember(
|
suspend fun TelegramBot.getChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
): ChatMember = getChatMember(chatId, user.id)
|
) = getChatMember(chatId, user.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.getChatMember(
|
suspend fun TelegramBot.getChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
): ChatMember = getChatMember(chat.id, user.id)
|
) = getChatMember(chat.id, user.id)
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChannelAdministrator
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
public 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
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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
|
|
||||||
): Boolean = promoteChannelAdministrator(
|
|
||||||
chat.id,
|
|
||||||
user.id,
|
|
||||||
untilDate = untilDate,
|
|
||||||
isAnonymous = isAnonymous,
|
|
||||||
canChangeInfo = canChangeInfo,
|
|
||||||
canPostMessages = canPostMessages,
|
|
||||||
canEditMessages = canEditMessages,
|
|
||||||
canDeleteMessages = canDeleteMessages,
|
|
||||||
canInviteUsers = canInviteUsers,
|
|
||||||
canRestrictMembers = canRestrictMembers,
|
|
||||||
canPromoteMembers = canPromoteMembers,
|
|
||||||
canManageVideoChats = canManageVideoChats,
|
|
||||||
canManageChat = canManageChat,
|
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = execute(
|
|
||||||
PromoteChatMember(
|
|
||||||
chatId,
|
|
||||||
userId,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = promoteChatAdministrator(
|
|
||||||
chat.id,
|
|
||||||
userId,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = promoteChatAdministrator(
|
|
||||||
chatId,
|
|
||||||
user.id,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = promoteChatAdministrator(
|
|
||||||
chat.id,
|
|
||||||
user.id,
|
|
||||||
untilDate,
|
|
||||||
isAnonymous,
|
|
||||||
canChangeInfo,
|
|
||||||
canDeleteMessages,
|
|
||||||
canInviteUsers,
|
|
||||||
canRestrictMembers,
|
|
||||||
canPromoteMembers,
|
|
||||||
canManageVideoChats,
|
|
||||||
canManageChat
|
|
||||||
)
|
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
import dev.inmo.micro_utils.common.Warning
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.TelegramDate
|
||||||
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
public suspend fun TelegramBot.promoteChatMember(
|
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -23,35 +24,28 @@ public suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
) = execute(
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
): Boolean = execute(
|
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId = chatId,
|
chatId,
|
||||||
userId = userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
public suspend fun TelegramBot.promoteChatMember(
|
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -66,33 +60,26 @@ public suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
) = promoteChatMember(
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
): Boolean = promoteChatMember(
|
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
public suspend fun TelegramBot.promoteChatMember(
|
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -107,33 +94,26 @@ public suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
) = promoteChatMember(
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
): Boolean = promoteChatMember(
|
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
public suspend fun TelegramBot.promoteChatMember(
|
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -148,27 +128,21 @@ public suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null
|
||||||
canPostStories: Boolean? = null,
|
) = promoteChatMember(
|
||||||
canEditStories: Boolean? = null,
|
|
||||||
canDeleteStories: Boolean? = null
|
|
||||||
): Boolean = promoteChatMember(
|
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous,
|
||||||
canChangeInfo = canChangeInfo,
|
canChangeInfo,
|
||||||
canPostMessages = canPostMessages,
|
canPostMessages,
|
||||||
canEditMessages = canEditMessages,
|
canEditMessages,
|
||||||
canDeleteMessages = canDeleteMessages,
|
canDeleteMessages,
|
||||||
canInviteUsers = canInviteUsers,
|
canInviteUsers,
|
||||||
canRestrictMembers = canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages = canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers = canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVideoChats = canManageVideoChats,
|
canManageVideoChats,
|
||||||
canManageChat = canManageChat,
|
canManageChat,
|
||||||
canManageTopics = canManageTopics,
|
canManageTopics
|
||||||
canPostStories = canPostStories,
|
|
||||||
canEditStories = canEditStories,
|
|
||||||
canDeleteStories = canDeleteStories
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
|
||||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteSupergroupAdministrator
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
||||||
import dev.inmo.tgbotapi.types.TelegramDate
|
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
|
|
||||||
public 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,
|
|
||||||
): Boolean = 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
|
|
||||||
)
|
|
||||||
@@ -10,35 +10,31 @@ import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
|||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
public suspend fun TelegramBot.restrictChatMember(
|
suspend fun TelegramBot.restrictChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
permissions: ChatPermissions = ChatPermissions(),
|
permissions: ChatPermissions = ChatPermissions()
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = execute(RestrictChatMember(chatId, userId, untilDate, permissions))
|
||||||
): Boolean = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.restrictChatMember(
|
suspend fun TelegramBot.restrictChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
permissions: ChatPermissions = ChatPermissions(),
|
permissions: ChatPermissions = ChatPermissions()
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = restrictChatMember(chat.id, userId, untilDate, permissions)
|
||||||
): Boolean = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.restrictChatMember(
|
suspend fun TelegramBot.restrictChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
permissions: ChatPermissions = ChatPermissions(),
|
permissions: ChatPermissions = ChatPermissions()
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = restrictChatMember(chatId, user.id, untilDate, permissions)
|
||||||
): Boolean = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.restrictChatMember(
|
suspend fun TelegramBot.restrictChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
permissions: ChatPermissions = ChatPermissions(),
|
permissions: ChatPermissions = ChatPermissions()
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = restrictChatMember(chat.id, user.id, untilDate, permissions)
|
||||||
): Boolean = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions)
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,26 +7,26 @@ import dev.inmo.tgbotapi.types.UserId
|
|||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
): Boolean = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
|
) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
): Boolean = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
|
) = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
): Boolean = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
|
) = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
): Boolean = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
|
) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
|
||||||
|
|||||||
@@ -8,27 +8,27 @@ import dev.inmo.tgbotapi.types.UserId
|
|||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatMember(
|
suspend fun TelegramBot.unbanChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
): Boolean = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
|
) = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatMember(
|
suspend fun TelegramBot.unbanChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
): Boolean = unbanChatMember(chat.id, userId, onlyIfBanned)
|
) = unbanChatMember(chat.id, userId, onlyIfBanned)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatMember(
|
suspend fun TelegramBot.unbanChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
): Boolean = unbanChatMember(chatId, user.id, onlyIfBanned)
|
) = unbanChatMember(chatId, user.id, onlyIfBanned)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatMember(
|
suspend fun TelegramBot.unbanChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
): Boolean = unbanChatMember(chat.id, user.id, onlyIfBanned)
|
) = unbanChatMember(chat.id, user.id, onlyIfBanned)
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,22 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatSenderChat(
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
): Boolean = execute(UnbanChatSenderChat(chatId, senderChatId))
|
) = execute(UnbanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatSenderChat(
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
): Boolean = unbanChatSenderChat(chat.id, senderChatId)
|
) = unbanChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatSenderChat(
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
senderChat: PublicChat
|
senderChat: PublicChat
|
||||||
): Boolean = unbanChatSenderChat(chatId, senderChat.id)
|
) = unbanChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
public suspend fun TelegramBot.unbanChatSenderChat(
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChat: PublicChat,
|
senderChat: PublicChat,
|
||||||
): Boolean = unbanChatSenderChat(chat.id, senderChat)
|
) = unbanChatSenderChat(chat.id, senderChat)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.modify.DeleteChatPhoto
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteChatPhoto(
|
suspend fun TelegramBot.deleteChatPhoto(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): Boolean = execute(DeleteChatPhoto(chatId))
|
) = execute(DeleteChatPhoto(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteChatPhoto(
|
suspend fun TelegramBot.deleteChatPhoto(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
): Boolean = deleteChatPhoto(chat.id)
|
) = deleteChatPhoto(chat.id)
|
||||||
|
|||||||
@@ -4,27 +4,22 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.businessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
public suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
): Boolean = execute(PinChatMessage(chatId, messageId, businessConnectionId, disableNotification))
|
) = execute(PinChatMessage(chatId, messageId, disableNotification))
|
||||||
|
|
||||||
public suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
): Boolean = pinChatMessage(chat.id, messageId, businessConnectionId, disableNotification)
|
) = pinChatMessage(chat.id, messageId, disableNotification)
|
||||||
|
|
||||||
public suspend fun TelegramBot.pinChatMessage(
|
suspend fun TelegramBot.pinChatMessage(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
): Boolean = pinChatMessage(message.chat.id, message.messageId, businessConnectionId, disableNotification)
|
) = pinChatMessage(message.chat.id, message.messageId, disableNotification)
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatDescription
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatDescription(
|
suspend fun TelegramBot.setChatDescription(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
description: String
|
description: String
|
||||||
): Boolean = execute(SetChatDescription(chatId, description))
|
) = execute(SetChatDescription(chatId, description))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatDescription(
|
suspend fun TelegramBot.setChatDescription(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
description: String
|
description: String
|
||||||
): Boolean = setChatDescription(chat.id, description)
|
) = setChatDescription(chat.id, description)
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.MenuButton
|
import dev.inmo.tgbotapi.types.MenuButton
|
||||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatMenuButton(
|
suspend fun TelegramBot.setChatMenuButton(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
): Boolean = execute(SetChatMenuButton(chatId, menuButton))
|
) = execute(SetChatMenuButton(chatId, menuButton))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatMenuButton(
|
suspend fun TelegramBot.setChatMenuButton(
|
||||||
chat: PrivateChat,
|
chat: PrivateChat,
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
): Boolean = setChatMenuButton(chat.id, menuButton)
|
) = setChatMenuButton(chat.id, menuButton)
|
||||||
|
|||||||
@@ -6,14 +6,12 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
permissions: ChatPermissions,
|
permissions: ChatPermissions
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = execute(SetChatPermissions(chatId, permissions))
|
||||||
): Boolean = execute(SetChatPermissions(chatId, permissions, useIndependentChatPermissions))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
permissions: ChatPermissions,
|
permissions: ChatPermissions
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
) = setDefaultChatMembersPermissions(chat.id, permissions)
|
||||||
): Boolean = setDefaultChatMembersPermissions(chat.id, permissions, useIndependentChatPermissions)
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatPhoto
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatPhoto(
|
suspend fun TelegramBot.setChatPhoto(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: MultipartFile
|
photo: MultipartFile
|
||||||
): Boolean = execute(SetChatPhoto(chatId, photo))
|
) = execute(SetChatPhoto(chatId, photo))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatPhoto(
|
suspend fun TelegramBot.setChatPhoto(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
photo: MultipartFile
|
photo: MultipartFile
|
||||||
): Boolean = setChatPhoto(chat.id, photo)
|
) = setChatPhoto(chat.id, photo)
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import dev.inmo.tgbotapi.requests.chat.modify.SetChatTitle
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatTitle(
|
suspend fun TelegramBot.setChatTitle(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
title: String
|
title: String
|
||||||
): Boolean = execute(SetChatTitle(chatId, title))
|
) = execute(SetChatTitle(chatId, title))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatTitle(
|
suspend fun TelegramBot.setChatTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
title: String
|
title: String
|
||||||
): Boolean = setChatTitle(chat.id, title)
|
) = setChatTitle(chat.id, title)
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.modify.SetDefaultChatMenuButton
|
import dev.inmo.tgbotapi.requests.chat.modify.SetDefaultChatMenuButton
|
||||||
import dev.inmo.tgbotapi.types.MenuButton
|
import dev.inmo.tgbotapi.types.MenuButton
|
||||||
|
|
||||||
public suspend fun TelegramBot.setDefaultChatMenuButton(
|
suspend fun TelegramBot.setDefaultChatMenuButton(
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
): Boolean = execute(SetDefaultChatMenuButton(menuButton))
|
) = execute(SetDefaultChatMenuButton(menuButton))
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.modify.UnpinAllChatMessages
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllChatMessages(
|
suspend fun TelegramBot.unpinAllChatMessages(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): Boolean = execute(UnpinAllChatMessages(chatId))
|
) = execute(UnpinAllChatMessages(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinAllChatMessages(
|
suspend fun TelegramBot.unpinAllChatMessages(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
): Boolean = unpinAllChatMessages(chat.id)
|
) = unpinAllChatMessages(chat.id)
|
||||||
|
|||||||
@@ -4,24 +4,19 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.businessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId? = null,
|
messageId: MessageId? = null
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
) = execute(UnpinChatMessage(chatId, messageId))
|
||||||
): Boolean = execute(UnpinChatMessage(chatId, messageId, businessConnectionId))
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId? = null,
|
messageId: MessageId? = null
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
) = unpinChatMessage(chat.id, messageId)
|
||||||
): Boolean = unpinChatMessage(chat.id, messageId, businessConnectionId)
|
|
||||||
|
|
||||||
public suspend fun TelegramBot.unpinChatMessage(
|
suspend fun TelegramBot.unpinChatMessage(
|
||||||
message: AccessibleMessage,
|
message: Message
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
) = unpinChatMessage(message.chat.id, message.messageId)
|
||||||
): Boolean = unpinChatMessage(message.chat.id, message.messageId, businessConnectionId)
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import dev.inmo.tgbotapi.requests.chat.stickers.DeleteChatStickerSet
|
|||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteChatStickerSet(
|
suspend fun TelegramBot.deleteChatStickerSet(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
): Boolean = execute(DeleteChatStickerSet(chatId))
|
) = execute(DeleteChatStickerSet(chatId))
|
||||||
|
|
||||||
public suspend fun TelegramBot.deleteChatStickerSet(
|
suspend fun TelegramBot.deleteChatStickerSet(
|
||||||
chat: SupergroupChat
|
chat: SupergroupChat
|
||||||
): Boolean = deleteChatStickerSet(chat.id)
|
) = deleteChatStickerSet(chat.id)
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.StickerSetName
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatStickerSet(
|
suspend fun TelegramBot.setChatStickerSet(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
stickerSetName: StickerSetName
|
stickerSetName: StickerSetName
|
||||||
): Boolean = execute(SetChatStickerSet(chatId, stickerSetName))
|
) = execute(SetChatStickerSet(chatId, stickerSetName))
|
||||||
|
|
||||||
public suspend fun TelegramBot.setChatStickerSet(
|
suspend fun TelegramBot.setChatStickerSet(
|
||||||
chat: SupergroupChat,
|
chat: SupergroupChat,
|
||||||
stickerSetName: StickerSetName
|
stickerSetName: StickerSetName
|
||||||
): Boolean = setChatStickerSet(chat.id, stickerSetName)
|
) = setChatStickerSet(chat.id, stickerSetName)
|
||||||
|
|||||||
@@ -8,14 +8,13 @@ import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
|||||||
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
@@ -26,313 +25,284 @@ import dev.inmo.tgbotapi.utils.buildEntities
|
|||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun <T> TelegramBot.edit(
|
suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
showCaptionAboveMedia: Boolean = false,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
return editMessageCaption(message, text, parseMode, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun <T> TelegramBot.edit(
|
suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
showCaptionAboveMedia: Boolean = false,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
return editMessageCaption(message, entities, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
livePeriod: Seconds? = null,
|
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
livePeriod: Seconds? = null,
|
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
livePeriod: Seconds? = null,
|
|
||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(
|
) = editLiveLocation(
|
||||||
chatId, messageId, location, businessConnectionId, replyMarkup
|
chatId, messageId, location, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
|
) = editLiveLocation(chat, messageId, location, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<LiveLocationContent> = editLiveLocation(message, location, businessConnectionId, replyMarkup)
|
) = editLiveLocation(message, location, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramFreeMedia,
|
media: TelegramMedia,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
|
) = editMessageMedia(chatId, messageId, media, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramFreeMedia,
|
media: TelegramMedia,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup)
|
) = editMessageMedia(chat, messageId, media, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<MediaContent>,
|
message: ContentMessage<MediaContent>,
|
||||||
media: TelegramFreeMedia,
|
media: TelegramMedia,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> = editMessageMedia(message, media, businessConnectionId, replyMarkup)
|
) = editMessageMedia(message, media, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MessageContent> = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
|
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MessageContent> = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup)
|
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: AccessibleMessage,
|
message: Message,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MessageContent> = editMessageReplyMarkup(message, businessConnectionId, replyMarkup)
|
) = editMessageReplyMarkup(message, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<TextContent> = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<TextContent> = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<TextContent> = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<TextContent> = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.edit(
|
suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
public suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
disableWebPagePreview: Boolean? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user