mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-16 12:00:18 +00:00
Compare commits
231 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c9f1bc016 | |||
| e5bffa7c51 | |||
| dccd15a5e9 | |||
| 3d14c93d89 | |||
| b8a6534b6a | |||
| f5529033ec | |||
| 482c375327 | |||
| abb8b3491d | |||
| 2953005e6d | |||
| 1f6ddd97e3 | |||
| bc8da1120e | |||
| e895c2f3a8 | |||
| f84180b3ff | |||
| c21c8c5a26 | |||
| 27416daeb8 | |||
| b5b7482c2f | |||
| a7f4ab36c6 | |||
| 7398e53b85 | |||
| be25f705ef | |||
| 5ee87ac78d | |||
| fbd53e1f2d | |||
| 9fe8df9e11 | |||
| a053c08346 | |||
| 6fa769bce3 | |||
| 27ac8ee797 | |||
| ce84e3c198 | |||
| c3a3e9bd44 | |||
| 7b6be48ba8 | |||
| e98d5c7a9c | |||
| 7db4f47e82 | |||
| 42985cfa37 | |||
| 02be5b5e48 | |||
| be87e3c736 | |||
| ccced36cd5 | |||
| af4c843369 | |||
| f0bd4c3719 | |||
| b3dfef9a38 | |||
| 2e2abb8e15 | |||
| 3cbfb2fb0b | |||
| b60b0259db | |||
| 5d8deb4b9b | |||
| d347c94c8b | |||
| 6809b9d2ef | |||
| 1980f8a9ca | |||
| 3f726c9b3b | |||
| 4b8de04380 | |||
| e4ac100b38 | |||
| f76e88c880 | |||
| 19cb970461 | |||
| 159c5892e3 | |||
| b03eef8bcb | |||
| 89360235a6 | |||
| 5b4a7d912e | |||
| 6ba2b70f10 | |||
| 9f2ccde589 | |||
| 048599414a | |||
| 87ed66e3ad | |||
| e8a280c90d | |||
| b0d8abf6df | |||
| dd054f1e07 | |||
| 10d92c2fdb | |||
| 2d40af21fe | |||
| 93d1afdf1c | |||
| 39de983d42 | |||
|
|
49448408d1 | ||
|
|
04ead7e73d | ||
|
|
5175395be2 | ||
|
|
38e1d271ba | ||
| 6d90e571d9 | |||
| c03440c353 | |||
| d7e9c6a3a1 | |||
| f711eb013a | |||
| e422c3bc33 | |||
| c8d6b759b7 | |||
| 8823b268cc | |||
| 49031bf0e6 | |||
| c72f8e04ec | |||
| a56ad7d671 | |||
| 77158ffecf | |||
| 1990e6b158 | |||
| 40d3388c74 | |||
| ac6cf6e0b2 | |||
| 1dc9dc42fb | |||
| b7ff6a3061 | |||
| 76eae0a54f | |||
| e9a172565e | |||
| 49f7954db7 | |||
| 9c43fecf41 | |||
| 228ecba6cc | |||
| dfecf93dd5 | |||
| b469b1c789 | |||
| f58a28d062 | |||
|
|
21ba1cca30 | ||
| 40c5af4469 | |||
|
|
e8e7329f52 | ||
| a162c3a8e2 | |||
| e9f7028a20 | |||
| ecd8ca7d4d | |||
| 6fcd327ca4 | |||
| c6b809eb66 | |||
| 037f9974da | |||
| b2fcdc40d5 | |||
| 6016387e07 | |||
| 96bbf5fc81 | |||
| f7cf37f338 | |||
| 8e3e44769e | |||
| 2d11685b7b | |||
| 8bb3095fb1 | |||
| 799ad6ca66 | |||
| bd6ff747cb | |||
| 010c52adeb | |||
| 88008b7cfc | |||
| 42b32af986 | |||
| 4944c972a6 | |||
| 83445dd314 | |||
| 53ae56e887 | |||
| 1c587abcdc | |||
| 99f95ffc40 | |||
| a8ed162c9c | |||
| e5ea980347 | |||
| 4ce26c707e | |||
| 4343dbbde8 | |||
| cdecce96e7 | |||
| 8a6e06bbf0 | |||
| f767362c41 | |||
| 9bf7c621a4 | |||
|
|
4085913bc3 | ||
|
|
f36373b718 | ||
|
|
ed39fde776 | ||
|
|
b8837bffdc | ||
|
|
cad6b26fdc | ||
|
|
52f17178ab | ||
|
|
6fa0ca3b89 | ||
| fb00c0b8ef | |||
| 343c8a4319 | |||
| a368356c6f | |||
| f8e87ac49b | |||
| 6a2e8400c1 | |||
|
|
40613e3418 | ||
|
|
016cfcb7cd | ||
| e797546edb | |||
| 16ca2bd984 | |||
| fb796254cf | |||
| 77bd649251 | |||
| 1471381b12 | |||
| fc6c1da3e0 | |||
| ebac413997 | |||
|
|
9fa17c1360 | ||
|
|
982b401b28 | ||
|
|
26b864a314 | ||
|
|
f2fae9184f | ||
|
|
32db4a19d2 | ||
|
|
613f6de483 | ||
|
|
f89849218a | ||
|
|
05341be534 | ||
| 45b99d85ff | |||
| a0fdebd13e | |||
| fb1ff6e4fd | |||
| 6f64ed1032 | |||
| 91a5340b23 | |||
| 8883a9ee51 | |||
| 610ada505f | |||
| 236f484e10 | |||
|
|
3383bcaff3 | ||
|
|
83352dd284 | ||
| b27efd118b | |||
|
|
18fcb6bb97 | ||
| 5baa09f0c1 | |||
|
|
bfff55ab08 | ||
|
|
051922b4c2 | ||
| 9dd80be36d | |||
|
|
873905a288 | ||
|
|
f8066431d3 | ||
| 5c655dd84c | |||
| 00aefefc31 | |||
|
|
d865a60151 | ||
| 1eef5bb239 | |||
|
|
0457792d99 | ||
|
|
8c9f0ae922 | ||
|
|
44a8186830 | ||
|
|
d4698301ad | ||
|
|
b7d3d849eb | ||
|
|
cb33176e8b | ||
|
|
6edf466220 | ||
| 0d4452d0f5 | |||
| e02f74d77d | |||
| 47a8739db5 | |||
| 760e8b0491 | |||
| fe518a0d8f | |||
| 227849a14c | |||
| 9e2c23cf2d | |||
| acd241e31e | |||
| 9cfc98bb67 | |||
| 6a9407f15c | |||
| af79e26855 | |||
| 02a404b805 | |||
| f2e97df44c | |||
| 63a695dcc5 | |||
| 66cf0689e1 | |||
| c7b8187829 | |||
| 5cfc350c13 | |||
| a3ef66bbfb | |||
| 738728f647 | |||
| abbb4e2dff | |||
| c3fa8a6d33 | |||
| fb2b912f93 | |||
| 46c5c62e15 | |||
| 60fdbb8ac4 | |||
| 86bd5eaa07 | |||
| 57122cc2f9 | |||
| 91a8058a3a | |||
| 97836c5f4e | |||
| 1a8cfefa4d | |||
| 0e97a63103 | |||
| 24269cc774 | |||
| d960d94c0d | |||
| 663d63b009 | |||
| 7118631213 | |||
| ff34017a03 | |||
| 96a7a2acab | |||
| 71c830fc2e | |||
| 271e7d2157 | |||
| cf5e5a1d1e | |||
| 186d6931ac | |||
| 6ec686040c | |||
| 211cef298c | |||
| 8de41bdd99 | |||
| 7a5c9c7ef8 | |||
| 4dec85ee60 | |||
| 4622509356 | |||
| 30e44d6bf2 |
12
.github/workflows/packages_publishing.yml
vendored
12
.github/workflows/packages_publishing.yml
vendored
@@ -22,15 +22,15 @@ jobs:
|
|||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: API compatibility check
|
- name: API compatibility check
|
||||||
run: ./gradlew apiCheck
|
run: ./gradlew apiCheck
|
||||||
|
- name: Publish to GithubPackages
|
||||||
|
continue-on-error: true
|
||||||
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
|
env:
|
||||||
|
GITHUB_USER: ${{ github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Publish to Gitea
|
- name: Publish to Gitea
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
run: ./gradlew publishAllPublicationsToInmoNexusRepository
|
||||||
env:
|
env:
|
||||||
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
INMONEXUS_USER: ${{ secrets.INMONEXUS_USER }}
|
||||||
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
INMONEXUS_PASSWORD: ${{ secrets.INMONEXUS_PASSWORD }}
|
||||||
- name: Publish to GithubPackages
|
|
||||||
continue-on-error: true
|
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
|
||||||
env:
|
|
||||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
|
||||||
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.kotlin
|
||||||
out/*
|
out/*
|
||||||
*.iml
|
*.iml
|
||||||
target
|
target
|
||||||
|
|||||||
193
CHANGELOG.md
193
CHANGELOG.md
@@ -1,6 +1,197 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
## 13.1.0
|
## 18.2.3
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Add default middleware `ExceptionsThrottlerTelegramBotMiddleware`
|
||||||
|
* Make `TelegramBotMiddlewaresPipelinesHandler` to be default `TelegramBotPipelinesHandler`
|
||||||
|
* Make `DefaultKtorRequestsExecutor` now uses `runCatching` instead of `runCatchingSafely`
|
||||||
|
* `onRequestResultPresented` lambda now accepts non-nullable `result`
|
||||||
|
|
||||||
|
## 18.2.2
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `2.0.20` -> `2.0.21`
|
||||||
|
* `MicroUtils`: `0.22.4` -> `0.22.7`
|
||||||
|
* `Core`:
|
||||||
|
* Fixes in blockquotes serializations
|
||||||
|
* Now `RawMessageEntity` is public. It is still under `Warning` annotation and is subject of changes
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* Add `CommonMessageFilterExcludeCommand` to filter commands in messages
|
||||||
|
* Add `minus` operation for `SimpleFilter`s
|
||||||
|
|
||||||
|
## 18.2.1
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Serialization`: `1.7.2` -> `1.7.3`
|
||||||
|
* `Coroutines`: `1.8.1` -> `1.9.0`
|
||||||
|
* `MicroUtils`: `0.22.2` -> `0.22.4`
|
||||||
|
|
||||||
|
## 18.2.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS SUPPORT OF [BOTS API 7.10](https://core.telegram.org/bots/api-changelog#september-6-2024)**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Customize `GiveawayCreated` to use stars in some cases
|
||||||
|
* `GiveawayInfo` lost parameter `premiumMonths` because of it is no included by default
|
||||||
|
* `GiveawayPublicResults` lost parameter `publicWinners` because of its abcence in Telegram Bot API
|
||||||
|
* Fix `GiveawayPublicResults` to be correctly deserializable
|
||||||
|
* Fix `GiveawayPrivateResults` to be correctly deserializable
|
||||||
|
* Fixes in deserialization of updates with giveaways
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* Extension `buildBehaviourWithLongPolling` will not report absence of `/privacy` handling
|
||||||
|
* `WebApp`:
|
||||||
|
* `MainButton` has been deprecated in favor to `BottomButton`. Their functionality is equal
|
||||||
|
|
||||||
|
## 18.1.0
|
||||||
|
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* Add `createSubContextAndDoSynchronouslyWithUpdatesFilter` as old logic of `createSubContextAndDoWithUpdatesFilter`
|
||||||
|
* `createSubContextAndDoWithUpdatesFilter` has been renamed to `createSubContextAndDoAsynchronouslyWithUpdatesFilter`
|
||||||
|
|
||||||
|
## 18.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
This update contains solution for [issue #888](https://github.com/InsanusMokrassar/ktgbotapi/issues/888), made by
|
||||||
|
[@Nik-mmzd](https://github.com/Nik-mmzd)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Migration (step-by-step)**
|
||||||
|
|
||||||
|
Replace in a whole project:
|
||||||
|
|
||||||
|
1. `RestrictedChatMember` -> `RestrictedMemberChatMember`
|
||||||
|
2. `BannedChatMember` -> `RestrictedChatMember`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Changes:**
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `2.0.10` -> `2.0.20`
|
||||||
|
* `Serialization`: `1.7.1` -> `1.7.2`
|
||||||
|
* `MicroUtils`: `0.22.0` -> `0.22.2`
|
||||||
|
* `KSLog`: `1.3.5` -> `1.3.6`
|
||||||
|
* `Ktor`: `2.3.11` -> `2.3.12`
|
||||||
|
* `Core`:
|
||||||
|
* `RestrictedChatMember` has been renamed to `RestrictedMemberChatMember`
|
||||||
|
* `BannedChatMember` has been renamed to `RestrictedChatMember`
|
||||||
|
* `KickedChatMember` now implements `RestrictedChatMember` (due to rename)
|
||||||
|
* All `ChatMember`s now use `PreviewUser`s instead of `User`s
|
||||||
|
* `Utils`:
|
||||||
|
* Add a lot of extensions like `ChatMember.isMember`
|
||||||
|
* Add a lot of extensions like `ChatMemberUpdated.joinedChat`
|
||||||
|
|
||||||
|
## 17.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS SUPPORT OF BOTS API 7.9**
|
||||||
|
|
||||||
|
* Add support of subscriptions links handling
|
||||||
|
* Add support of info about sender chat. **It is important, that for channels will be actual `senderChat` instead of
|
||||||
|
`from` field due to `User` type of the last one**. You also may use extensions `Message.sender_chat` or `Any.withSenderChatMessageOrNull`
|
||||||
|
to access sender chat
|
||||||
|
* Add `Reaction.Paid`
|
||||||
|
|
||||||
|
Additional changes:
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Add top level interfaces `OptionallyWithUser` and `OptionallyFromUser`. Old `WithUser` and `FromUser` interfaces
|
||||||
|
extending them with following overrides of `user` and `from` fields
|
||||||
|
* `API`:
|
||||||
|
* Change order of delay and sending action in [SendActionDSL](tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt)
|
||||||
|
(thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)).
|
||||||
|
Besides, there has been changed way to create parallel sending of action and it must not lead to memory leaks anymore
|
||||||
|
|
||||||
|
## 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
|
## 13.0.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#may-6-2024)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#september-6-2024)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ plugins {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
|
|
||||||
}
|
}
|
||||||
if (it != rootProject.findProject("docs")) {
|
if (it != rootProject.findProject("docs")) {
|
||||||
tasks.whenTaskAdded { task ->
|
tasks.whenTaskAdded { task ->
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ plugins {
|
|||||||
|
|
||||||
project.description = "Full collection of all built-in tgbotapi tools"
|
project.description = "Full collection of all built-in tgbotapi tools"
|
||||||
|
|
||||||
apply from: "$mppProjectWithSerializationPresetPath"
|
apply from: "$mppProjectWithSerialization"
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
allprojects {
|
File templatesFolder = new File("$rootProject.projectDir.absolutePath${File.separatorChar}gradle${File.separatorChar}templates")
|
||||||
ext {
|
|
||||||
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle"
|
|
||||||
mppJsProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJsProject.gradle"
|
|
||||||
|
|
||||||
publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle"
|
Map properties = new HashMap<String, String>()
|
||||||
|
|
||||||
|
if (templatesFolder.exists() && templatesFolder.isDirectory()) {
|
||||||
|
templatesFolder.listFiles().each {
|
||||||
|
properties[it.name - ".gradle"] = it.absolutePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
ext {
|
||||||
|
properties.forEach { k, v ->
|
||||||
|
it[k] = v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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=13.1.0
|
library_version=18.2.3
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.9.23"
|
kotlin = "2.0.21"
|
||||||
kotlin-serialization = "1.6.3"
|
kotlin-serialization = "1.7.3"
|
||||||
kotlin-coroutines = "1.8.0"
|
kotlin-coroutines = "1.9.0"
|
||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.4.0"
|
korlibs = "5.4.0"
|
||||||
uuid = "0.8.4"
|
uuid = "0.8.4"
|
||||||
ktor = "2.3.10"
|
ktor = "2.3.12"
|
||||||
|
|
||||||
ksp = "1.9.23-1.0.20"
|
ksp = "2.0.21-1.0.25"
|
||||||
kotlin-poet = "1.16.0"
|
kotlin-poet = "1.18.1"
|
||||||
|
|
||||||
microutils = "0.20.45"
|
microutils = "0.22.7"
|
||||||
kslog = "1.3.3"
|
kslog = "1.3.6"
|
||||||
|
|
||||||
versions = "0.51.0"
|
versions = "0.51.0"
|
||||||
|
|
||||||
github-release-plugin = "2.5.2"
|
github-release-plugin = "2.5.2"
|
||||||
dokka = "1.9.20"
|
dokka = "1.9.20"
|
||||||
|
|
||||||
validator = "0.14.0"
|
validator = "0.16.3"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
project.version = "$version"
|
project.version = "$version"
|
||||||
project.group = "$group"
|
project.group = "$group"
|
||||||
|
|
||||||
apply from: "$publishGradlePath"
|
apply from: "$mpp_publish"
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
js (IR) {
|
js (IR) {
|
||||||
@@ -25,7 +25,6 @@ kotlin {
|
|||||||
jsTest {
|
jsTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.kotlin.test.js
|
implementation libs.kotlin.test.js
|
||||||
implementation libs.kotlin.test.junit
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,6 @@ kotlin {
|
|||||||
jsTest {
|
jsTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.kotlin.test.js
|
implementation libs.kotlin.test.js
|
||||||
implementation libs.kotlin.test.junit
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
all {
|
all {
|
||||||
@@ -38,14 +38,14 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
|
||||||
maven {
|
maven {
|
||||||
name = "GithubPackages"
|
name = "GithubPackages"
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
|
||||||
|
|
||||||
credentials {
|
credentials {
|
||||||
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
|
||||||
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
1
gradle/templates/mpp_publish.kpsb
Normal file
1
gradle/templates/mpp_publish.kpsb
Normal file
@@ -0,0 +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"}}}
|
||||||
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-8.10.2-bin.zip
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,8 @@ plugins {
|
|||||||
|
|
||||||
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"
|
||||||
|
|
||||||
apply from: "$mppProjectWithSerializationPresetPath"
|
apply from: "$mppProjectWithSerialization"
|
||||||
apply from: "$publishGradlePath"
|
apply from: "$mpp_publish"
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -20,5 +20,5 @@ kotlin {
|
|||||||
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
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]
|
||||||
*/
|
*/
|
||||||
data class BotBuilder internal constructor(
|
public 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 @@ 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]
|
||||||
*/
|
*/
|
||||||
fun buildBot(
|
public 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]
|
||||||
*/
|
*/
|
||||||
fun telegramBot(
|
public fun telegramBot(
|
||||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||||
client: HttpClient = HttpClient()
|
client: HttpClient = HttpClient()
|
||||||
): TelegramBot = telegramBot(urlsKeeper) {
|
): TelegramBot = telegramBot(urlsKeeper) {
|
||||||
@@ -23,11 +23,11 @@ fun telegramBot(
|
|||||||
* configure it with [clientConfig]
|
* configure it with [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun <T: HttpClientEngineConfig> telegramBot(
|
public 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 @@ inline fun <T: HttpClientEngineConfig> telegramBot(
|
|||||||
* configure [HttpClient] using [clientConfig]
|
* configure [HttpClient] using [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun telegramBot(
|
public 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 @@ inline fun telegramBot(
|
|||||||
* [clientConfig]
|
* [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun telegramBot(
|
public 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 @@ 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")
|
||||||
inline fun telegramBot(
|
public inline fun telegramBot(
|
||||||
token: String,
|
token: String,
|
||||||
apiUrl: String = telegramBotAPIDefaultUrl,
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
@@ -71,13 +71,13 @@ 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")
|
||||||
inline fun <T: HttpClientEngineConfig> telegramBot(
|
public 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 @@ inline fun <T: HttpClientEngineConfig> telegramBot(
|
|||||||
* configure [HttpClient] using [clientConfig]
|
* configure [HttpClient] using [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun telegramBot(
|
public 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 @@ inline fun telegramBot(
|
|||||||
* [clientConfig]
|
* [clientConfig]
|
||||||
*/
|
*/
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun telegramBot(
|
public 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")
|
||||||
suspend inline fun TelegramBot.close() = execute(Close)
|
public suspend inline fun TelegramBot.close(): Boolean = execute(Close)
|
||||||
|
|||||||
@@ -9,19 +9,19 @@ import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
public suspend fun TelegramBot.deleteMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
DeleteMessage(chatId, messageId)
|
DeleteMessage(chatId, messageId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
public suspend fun TelegramBot.deleteMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
) = deleteMessage(chat.id, messageId)
|
): Boolean = deleteMessage(chat.id, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
public suspend fun TelegramBot.deleteMessage(
|
||||||
message: AccessibleMessage
|
message: AccessibleMessage
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
||||||
@@ -34,20 +34,20 @@ suspend fun TelegramBot.deleteMessage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
) = deleteMessage(chatId, messageId)
|
): Boolean = deleteMessage(chatId, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId
|
messageId: MessageId
|
||||||
) = deleteMessage(chat, messageId)
|
): Boolean = deleteMessage(chat, messageId)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
message: AccessibleMessage
|
message: AccessibleMessage
|
||||||
) = deleteMessage(message)
|
): Boolean = deleteMessage(message)
|
||||||
|
|
||||||
suspend fun AccessibleMessage.delete(
|
public suspend fun AccessibleMessage.delete(
|
||||||
requestsExecutor: TelegramBot
|
requestsExecutor: TelegramBot
|
||||||
) = requestsExecutor.deleteMessage(this)
|
): Boolean = requestsExecutor.deleteMessage(this)
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
public suspend fun TelegramBot.deleteMessages(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageIds: List<MessageId>
|
messageIds: List<MessageId>
|
||||||
) = messageIds.chunked(deleteMessagesLimit.last).map {
|
): Boolean = messageIds.chunked(deleteMessagesLimit.last).map {
|
||||||
execute(
|
execute(
|
||||||
DeleteMessages(
|
DeleteMessages(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
@@ -19,17 +19,17 @@ suspend fun TelegramBot.deleteMessages(
|
|||||||
)
|
)
|
||||||
}.all { it }
|
}.all { it }
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
public suspend fun TelegramBot.deleteMessages(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageIds: Array<MessageId>
|
messageIds: Array<MessageId>
|
||||||
) = deleteMessages(
|
): Boolean = deleteMessages(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
messageIds = messageIds.toList()
|
messageIds = messageIds.toList()
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessages(
|
public suspend fun TelegramBot.deleteMessages(
|
||||||
messagesMetas: List<Message.MetaInfo>
|
messagesMetas: List<Message.MetaInfo>
|
||||||
) = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
): Boolean = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
|
||||||
deleteMessages(
|
deleteMessages(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
messageIds = messages.map { it.messageId }
|
messageIds = messages.map { it.messageId }
|
||||||
@@ -37,25 +37,25 @@ suspend fun TelegramBot.deleteMessages(
|
|||||||
}.all { it }
|
}.all { it }
|
||||||
|
|
||||||
@JvmName("deleteMessagesWithMessages")
|
@JvmName("deleteMessagesWithMessages")
|
||||||
suspend fun TelegramBot.deleteMessages(
|
public suspend fun TelegramBot.deleteMessages(
|
||||||
messages: List<AccessibleMessage>
|
messages: List<AccessibleMessage>
|
||||||
) = deleteMessages(messages.map { it.metaInfo })
|
): Boolean = deleteMessages(messages.map { it.metaInfo })
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageIds: List<MessageId>
|
messageIds: List<MessageId>
|
||||||
) = deleteMessages(chatId = chatId, messageIds = messageIds)
|
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageIds: Array<MessageId>
|
messageIds: Array<MessageId>
|
||||||
) = deleteMessages(chatId = chatId, messageIds = messageIds)
|
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
|
||||||
|
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
messagesMetas: List<Message.MetaInfo>
|
messagesMetas: List<Message.MetaInfo>
|
||||||
) = deleteMessages(messagesMetas)
|
): Boolean = deleteMessages(messagesMetas)
|
||||||
|
|
||||||
@JvmName("deleteWithMessages")
|
@JvmName("deleteWithMessages")
|
||||||
suspend fun TelegramBot.delete(
|
public suspend fun TelegramBot.delete(
|
||||||
messages: List<AccessibleMessage>
|
messages: List<AccessibleMessage>
|
||||||
) = deleteMessages(messages)
|
): Boolean = deleteMessages(messages)
|
||||||
|
|||||||
@@ -7,58 +7,59 @@ 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.AccessibleMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public 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
|
||||||
) = execute(
|
): PossiblyForwardedMessage = execute(
|
||||||
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public 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
|
||||||
) = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public 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
|
||||||
) = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public 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
|
||||||
) = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
|
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public suspend fun TelegramBot.forwardMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
public suspend fun TelegramBot.forwardMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
threadId: MessageThreadId? = toChat.id.threadId,
|
threadId: MessageThreadId? = toChat.id.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false
|
protectContent: Boolean = false
|
||||||
) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
public suspend fun TelegramBot.forwardMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageIds: List<MessageId>,
|
messageIds: List<MessageId>,
|
||||||
@@ -16,7 +16,7 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = messageIds.chunked(forwardMessagesLimit.last).flatMap {
|
): List<MessageId> = messageIds.chunked(forwardMessagesLimit.last).flatMap {
|
||||||
execute(
|
execute(
|
||||||
ForwardMessages(
|
ForwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
@@ -30,7 +30,7 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
public suspend fun TelegramBot.forwardMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageIds: Array<MessageId>,
|
messageIds: Array<MessageId>,
|
||||||
@@ -38,7 +38,7 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId = fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageIds = messageIds.toList(),
|
messageIds = messageIds.toList(),
|
||||||
@@ -48,14 +48,14 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessages(
|
public suspend fun TelegramBot.forwardMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) ->
|
): List<MessageId> = messagesMetas.groupBy { it.chatId }.flatMap { (chatId, messages) ->
|
||||||
forwardMessages(
|
forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId = chatId,
|
fromChatId = chatId,
|
||||||
@@ -68,14 +68,14 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JvmName("forwardMessagesWithMessages")
|
@JvmName("forwardMessagesWithMessages")
|
||||||
suspend fun TelegramBot.forwardMessages(
|
public suspend fun TelegramBot.forwardMessages(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messages: List<AccessibleMessage>,
|
messages: List<AccessibleMessage>,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
messagesMetas = messages.map { it.metaInfo },
|
messagesMetas = messages.map { it.metaInfo },
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
@@ -84,7 +84,7 @@ suspend fun TelegramBot.forwardMessages(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
public suspend fun TelegramBot.forward(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageIds: List<MessageId>,
|
messageIds: List<MessageId>,
|
||||||
@@ -92,7 +92,7 @@ suspend fun TelegramBot.forward(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId = fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageIds = messageIds,
|
messageIds = messageIds,
|
||||||
@@ -102,7 +102,7 @@ suspend fun TelegramBot.forward(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
public suspend fun TelegramBot.forward(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
messageIds: Array<MessageId>,
|
messageIds: Array<MessageId>,
|
||||||
@@ -110,7 +110,7 @@ suspend fun TelegramBot.forward(
|
|||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
fromChatId = fromChatId,
|
fromChatId = fromChatId,
|
||||||
messageIds = messageIds,
|
messageIds = messageIds,
|
||||||
@@ -120,14 +120,14 @@ suspend fun TelegramBot.forward(
|
|||||||
removeCaption = removeCaption
|
removeCaption = removeCaption
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forward(
|
public suspend fun TelegramBot.forward(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messagesMetas: List<Message.MetaInfo>,
|
messagesMetas: List<Message.MetaInfo>,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
messagesMetas = messagesMetas,
|
messagesMetas = messagesMetas,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
@@ -137,14 +137,14 @@ suspend fun TelegramBot.forward(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@JvmName("forwardWithMessages")
|
@JvmName("forwardWithMessages")
|
||||||
suspend fun TelegramBot.forward(
|
public suspend fun TelegramBot.forward(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messages: List<AccessibleMessage>,
|
messages: List<AccessibleMessage>,
|
||||||
threadId: MessageThreadId? = toChatId.threadId,
|
threadId: MessageThreadId? = toChatId.threadId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
removeCaption: Boolean = false
|
removeCaption: Boolean = false
|
||||||
) = forwardMessages(
|
): List<MessageId> = forwardMessages(
|
||||||
toChatId = toChatId,
|
toChatId = toChatId,
|
||||||
messages = messages,
|
messages = messages,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
suspend fun TelegramBot.getUpdates(
|
public suspend fun TelegramBot.getUpdates(
|
||||||
offset: UpdateId? = null,
|
offset: UpdateId? = null,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
) = execute(
|
): List<Update> = execute(
|
||||||
GetUpdates(
|
GetUpdates(
|
||||||
offset, limit, timeout, allowed_updates
|
offset, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.getUpdates(
|
public 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
|
||||||
) = getUpdates(
|
): List<Update> = getUpdates(
|
||||||
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,23 +4,24 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
import dev.inmo.tgbotapi.requests.GetUpdatesRaw
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
|
import kotlinx.serialization.json.JsonArray
|
||||||
|
|
||||||
suspend fun TelegramBot.getRawUpdates(
|
public suspend fun TelegramBot.getRawUpdates(
|
||||||
offset: UpdateId? = null,
|
offset: UpdateId? = null,
|
||||||
limit: Int = getUpdatesLimit.last,
|
limit: Int = getUpdatesLimit.last,
|
||||||
timeout: Seconds? = null,
|
timeout: Seconds? = null,
|
||||||
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||||
) = execute(
|
): JsonArray = execute(
|
||||||
GetUpdatesRaw(
|
GetUpdatesRaw(
|
||||||
offset, limit, timeout, allowed_updates
|
offset, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.getRawUpdates(
|
public suspend fun TelegramBot.getRawUpdates(
|
||||||
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
|
||||||
) = getRawUpdates(
|
): JsonArray = getRawUpdates(
|
||||||
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
lastUpdate.updateId + 1, limit, timeout, allowed_updates
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
|
||||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.abstracts.*
|
import dev.inmo.tgbotapi.abstracts.Headed
|
||||||
|
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
|
||||||
@@ -14,18 +17,22 @@ 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.*
|
import kotlinx.coroutines.CoroutineStart
|
||||||
|
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.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
|
||||||
data class EditLiveLocationInfo(
|
public 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,
|
||||||
@@ -38,7 +45,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.handleLiveLocation(
|
public suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<EditLiveLocationInfo>,
|
locationsFlow: Flow<EditLiveLocationInfo>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
@@ -46,15 +53,17 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
|
var currentLiveLocationMessage: ContentMessage<LiveLocationContent>? = null
|
||||||
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
|
||||||
null
|
null
|
||||||
} else {
|
} else {
|
||||||
CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
val scope = currentCoroutineContext().LinkedSupervisorScope()
|
||||||
while (isActive) {
|
scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
|
||||||
|
while (scope.isActive) {
|
||||||
delay(liveTimeMillis)
|
delay(liveTimeMillis)
|
||||||
// Remove previous location message info to resend live location message
|
// Remove previous location message info to resend live location message
|
||||||
currentLiveLocationMessage = null
|
currentLiveLocationMessage = null
|
||||||
@@ -81,6 +90,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
it.replyMarkup
|
it.replyMarkup
|
||||||
).also {
|
).also {
|
||||||
@@ -108,7 +118,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
*/
|
*/
|
||||||
@JvmName("handleLiveLocationWithLocation")
|
@JvmName("handleLiveLocationWithLocation")
|
||||||
@JsName("handleLiveLocationWithLocation")
|
@JsName("handleLiveLocationWithLocation")
|
||||||
suspend fun TelegramBot.handleLiveLocation(
|
public suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Location>,
|
locationsFlow: Flow<Location>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
@@ -116,12 +126,13 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map {
|
locationsFlow = locationsFlow.map {
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
it.latitude,
|
it.latitude,
|
||||||
it.longitude,
|
it.longitude,
|
||||||
@@ -131,13 +142,14 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
sentMessageFlow
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +159,7 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
*/
|
*/
|
||||||
@JvmName("handleLiveLocationWithLatLong")
|
@JvmName("handleLiveLocationWithLatLong")
|
||||||
@JsName("handleLiveLocationWithLatLong")
|
@JsName("handleLiveLocationWithLatLong")
|
||||||
suspend fun TelegramBot.handleLiveLocation(
|
public suspend fun TelegramBot.handleLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
locationsFlow: Flow<Pair<Double, Double>>,
|
locationsFlow: Flow<Pair<Double, Double>>,
|
||||||
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
|
||||||
@@ -155,23 +167,25 @@ suspend fun TelegramBot.handleLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
|
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
|
||||||
) {
|
) {
|
||||||
handleLiveLocation(
|
handleLiveLocation(
|
||||||
chatId,
|
chatId = chatId,
|
||||||
locationsFlow.map { (lat, long) ->
|
locationsFlow = locationsFlow.map { (lat, long) ->
|
||||||
EditLiveLocationInfo(
|
EditLiveLocationInfo(
|
||||||
lat,
|
lat,
|
||||||
long
|
long
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
liveTimeMillis,
|
liveTimeMillis = liveTimeMillis,
|
||||||
threadId,
|
threadId = threadId,
|
||||||
businessConnectionId,
|
businessConnectionId = businessConnectionId,
|
||||||
disableNotification,
|
disableNotification = disableNotification,
|
||||||
protectContent,
|
protectContent = protectContent,
|
||||||
replyParameters,
|
effectId = effectId,
|
||||||
sentMessageFlow
|
replyParameters = replyParameters,
|
||||||
|
sentMessageFlow = sentMessageFlow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
const val indefiniteLivePeriodDelayMillis = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
public const val indefiniteLivePeriodDelayMillis: Long = LiveLocation.INDEFINITE_LIVE_PERIOD * 1000L
|
||||||
const val defaultLivePeriodDelayMillis = indefiniteLivePeriodDelayMillis
|
public const val defaultLivePeriodDelayMillis: Long = indefiniteLivePeriodDelayMillis
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see startLiveLocation
|
* @see startLiveLocation
|
||||||
*/
|
*/
|
||||||
class LiveLocationProvider internal constructor(
|
public class LiveLocationProvider internal constructor(
|
||||||
private val requestsExecutor: TelegramBot,
|
private val requestsExecutor: TelegramBot,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
autoCloseTimeDelay: Double,
|
autoCloseTimeDelay: Double,
|
||||||
@@ -41,23 +41,23 @@ class LiveLocationProvider internal constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay)
|
private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay)
|
||||||
val leftUntilCloseMillis: TimeSpan
|
public val leftUntilCloseMillis: TimeSpan
|
||||||
get() = autoCloseTime - DateTime.now()
|
get() = autoCloseTime - DateTime.now()
|
||||||
|
|
||||||
var isClosed: Boolean = false
|
public var isClosed: Boolean = false
|
||||||
private set
|
private set
|
||||||
get() = field || leftUntilCloseMillis.millisecondsLong < 0L
|
get() = field || leftUntilCloseMillis.millisecondsLong < 0L
|
||||||
|
|
||||||
var message: ContentMessage<LocationContent> = initMessage
|
public var message: ContentMessage<LocationContent> = initMessage
|
||||||
private set
|
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
|
||||||
*/
|
*/
|
||||||
suspend fun updateLocation(
|
public suspend fun updateLocation(
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): LiveLocation {
|
): LiveLocation {
|
||||||
@@ -65,7 +65,7 @@ class LiveLocationProvider internal constructor(
|
|||||||
message = requestsExecutor.editLiveLocation(
|
message = requestsExecutor.editLiveLocation(
|
||||||
message,
|
message,
|
||||||
location,
|
location,
|
||||||
replyMarkup
|
replyMarkup = replyMarkup
|
||||||
)
|
)
|
||||||
return lastLocation
|
return lastLocation
|
||||||
} else {
|
} else {
|
||||||
@@ -86,7 +86,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
public suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -99,6 +99,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider {
|
): LiveLocationProvider {
|
||||||
@@ -116,6 +117,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -133,7 +135,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
public suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -146,6 +148,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -161,6 +164,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -169,7 +173,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
public suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -181,6 +185,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -196,6 +201,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -204,7 +210,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
public suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -216,6 +222,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
): LiveLocationProvider = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
@@ -231,6 +238,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
replyParameters,
|
replyParameters,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -239,7 +247,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: AccessibleMessage,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -252,9 +260,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
to.chat,
|
to.chat,
|
||||||
latitude,
|
latitude,
|
||||||
@@ -267,6 +276,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -275,7 +285,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
public suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: AccessibleMessage,
|
to: AccessibleMessage,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -287,9 +297,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
|
effectId: EffectId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
): LiveLocationProvider = startLiveLocation(
|
||||||
scope,
|
scope,
|
||||||
to.chat,
|
to.chat,
|
||||||
location,
|
location,
|
||||||
@@ -301,6 +312,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
businessConnectionId,
|
businessConnectionId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
protectContent,
|
protectContent,
|
||||||
|
effectId,
|
||||||
ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
|
ReplyParameters(to.metaInfo, 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
|
||||||
|
|
||||||
suspend inline fun TelegramBot.logOut() = execute(LogOut)
|
public suspend inline fun TelegramBot.logOut(): Boolean = execute(LogOut)
|
||||||
|
|||||||
@@ -3,48 +3,54 @@ package dev.inmo.tgbotapi.extensions.api
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.StopPoll
|
import dev.inmo.tgbotapi.requests.StopPoll
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
|
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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
public suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
): Poll = execute(
|
||||||
StopPoll(chatId, messageId, replyMarkup)
|
StopPoll(chatId, messageId, businessConnectionId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
public suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, messageId, replyMarkup)
|
): Poll = stopPoll(chat.id, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
public suspend fun TelegramBot.stopPoll(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
): Poll = stopPoll(chatId, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
public suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, message.messageId, replyMarkup)
|
): Poll = stopPoll(chat.id, message.messageId, businessConnectionId, replyMarkup)
|
||||||
|
|||||||
@@ -5,26 +5,26 @@ 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.CallbackQueryId
|
||||||
|
|
||||||
suspend fun TelegramBot.answerCallbackQuery(
|
public suspend fun TelegramBot.answerCallbackQuery(
|
||||||
callbackQueryId: CallbackQueryId,
|
callbackQueryId: CallbackQueryId,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
showAlert: Boolean? = null,
|
showAlert: Boolean? = null,
|
||||||
url: String? = null,
|
url: String? = null,
|
||||||
cachedTimeSeconds: Int? = null
|
cachedTimeSeconds: Int? = null
|
||||||
) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
|
): Boolean = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
|
||||||
|
|
||||||
suspend fun TelegramBot.answerCallbackQuery(
|
public 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
|
||||||
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
|
|
||||||
suspend fun TelegramBot.answer(
|
public 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
|
||||||
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
|
|||||||
@@ -7,36 +7,36 @@ import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQ
|
|||||||
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.InlineQueryId
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
public suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQueryID: InlineQueryId,
|
inlineQueryID: InlineQueryId,
|
||||||
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
|
button: InlineQueryResultsButton? = null
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, button)
|
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, button)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
public 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,
|
||||||
button: InlineQueryResultsButton? = null
|
button: InlineQueryResultsButton? = null
|
||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
||||||
|
|
||||||
suspend fun TelegramBot.answer(
|
public 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,
|
||||||
button: InlineQueryResultsButton? = null
|
button: InlineQueryResultsButton? = null
|
||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
public suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQueryID: InlineQueryId,
|
inlineQueryID: InlineQueryId,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
@@ -44,11 +44,11 @@ suspend fun TelegramBot.answerInlineQuery(
|
|||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
switchPmText: String?,
|
switchPmText: String?,
|
||||||
switchPmParameter: String?
|
switchPmParameter: String?
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerInlineQuery(
|
public suspend fun TelegramBot.answerInlineQuery(
|
||||||
inlineQuery: InlineQuery,
|
inlineQuery: InlineQuery,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
@@ -56,9 +56,9 @@ suspend fun TelegramBot.answerInlineQuery(
|
|||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
switchPmText: String?,
|
switchPmText: String?,
|
||||||
switchPmParameter: String?
|
switchPmParameter: String?
|
||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
|
|
||||||
suspend fun TelegramBot.answer(
|
public suspend fun TelegramBot.answer(
|
||||||
inlineQuery: InlineQuery,
|
inlineQuery: InlineQuery,
|
||||||
results: List<InlineQueryResult> = emptyList(),
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
cachedTime: Int? = null,
|
cachedTime: Int? = null,
|
||||||
@@ -66,4 +66,4 @@ suspend fun TelegramBot.answer(
|
|||||||
nextOffset: String? = null,
|
nextOffset: String? = null,
|
||||||
switchPmText: String?,
|
switchPmText: String?,
|
||||||
switchPmParameter: String?
|
switchPmParameter: String?
|
||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.answerWebAppQuery(
|
public suspend fun TelegramBot.answerWebAppQuery(
|
||||||
webAppQueryId: WebAppQueryId,
|
webAppQueryId: WebAppQueryId,
|
||||||
result: InlineQueryResult
|
result: InlineQueryResult
|
||||||
) = execute(AnswerWebAppQuery(webAppQueryId, result))
|
): SentWebAppMessage = execute(AnswerWebAppQuery(webAppQueryId, result))
|
||||||
|
|
||||||
suspend fun TelegramBot.answer(
|
public suspend fun TelegramBot.answer(
|
||||||
webAppQueryId: WebAppQueryId,
|
webAppQueryId: WebAppQueryId,
|
||||||
result: InlineQueryResult
|
result: InlineQueryResult
|
||||||
) = execute(AnswerWebAppQuery(webAppQueryId, result))
|
): SentWebAppMessage = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
||||||
id: PreCheckoutQueryId
|
id: PreCheckoutQueryId
|
||||||
) = execute(AnswerPreCheckoutQueryOk(id))
|
): Boolean = execute(AnswerPreCheckoutQueryOk(id))
|
||||||
suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
|
||||||
preCheckoutQuery: PreCheckoutQuery
|
preCheckoutQuery: PreCheckoutQuery
|
||||||
) = answerPreCheckoutQueryOk(preCheckoutQuery.id)
|
): Boolean = answerPreCheckoutQueryOk(preCheckoutQuery.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerPreCheckoutQueryError(
|
public suspend fun TelegramBot.answerPreCheckoutQueryError(
|
||||||
id: PreCheckoutQueryId,
|
id: PreCheckoutQueryId,
|
||||||
error: String
|
error: String
|
||||||
) = execute(AnswerPreCheckoutQueryError(id, error))
|
): Boolean = execute(AnswerPreCheckoutQueryError(id, error))
|
||||||
suspend fun TelegramBot.answerPreCheckoutQueryError(
|
public suspend fun TelegramBot.answerPreCheckoutQueryError(
|
||||||
preCheckoutQuery: PreCheckoutQuery,
|
preCheckoutQuery: PreCheckoutQuery,
|
||||||
error: String
|
error: String
|
||||||
) = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
|
): Boolean = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
|
||||||
|
|||||||
@@ -7,22 +7,22 @@ import dev.inmo.tgbotapi.types.ShippingQueryId
|
|||||||
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
import dev.inmo.tgbotapi.types.payments.ShippingOption
|
||||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||||
|
|
||||||
suspend fun TelegramBot.answerShippingQueryOk(
|
public suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
id: ShippingQueryId,
|
id: ShippingQueryId,
|
||||||
shippingOptions: List<ShippingOption>
|
shippingOptions: List<ShippingOption>
|
||||||
) = execute(AnswerShippingQueryOk(id, shippingOptions))
|
): Boolean = execute(AnswerShippingQueryOk(id, shippingOptions))
|
||||||
suspend fun TelegramBot.answerShippingQueryOk(
|
public suspend fun TelegramBot.answerShippingQueryOk(
|
||||||
shippingQuery: ShippingQuery,
|
shippingQuery: ShippingQuery,
|
||||||
shippingOptions: List<ShippingOption>
|
shippingOptions: List<ShippingOption>
|
||||||
) = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
): Boolean = answerShippingQueryOk(shippingQuery.id, shippingOptions)
|
||||||
|
|
||||||
suspend fun TelegramBot.answerShippingQueryError(
|
public suspend fun TelegramBot.answerShippingQueryError(
|
||||||
id: ShippingQueryId,
|
id: ShippingQueryId,
|
||||||
error: String
|
error: String
|
||||||
) = execute(AnswerShippingQueryError(id, error))
|
): Boolean = execute(AnswerShippingQueryError(id, error))
|
||||||
suspend fun TelegramBot.answerShippingQueryError(
|
public suspend fun TelegramBot.answerShippingQueryError(
|
||||||
shippingQuery: ShippingQuery,
|
shippingQuery: ShippingQuery,
|
||||||
error: String
|
error: String
|
||||||
) = answerShippingQueryError(shippingQuery.id, error)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.clearMyDefaultAdministratorRights(
|
public suspend fun TelegramBot.clearMyDefaultAdministratorRights(
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
) = execute(ClearMyDefaultAdministratorRights(forChannels))
|
): Boolean = execute(ClearMyDefaultAdministratorRights(forChannels))
|
||||||
|
|
||||||
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels() = clearMyDefaultAdministratorRights(forChannels = true)
|
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels(): Boolean = clearMyDefaultAdministratorRights(forChannels = true)
|
||||||
|
|
||||||
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups() = clearMyDefaultAdministratorRights(forChannels = false)
|
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups(): Boolean = clearMyDefaultAdministratorRights(forChannels = false)
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMyCommands(
|
public suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLang?
|
||||||
) = execute(DeleteMyCommands(scope, languageCode))
|
): Boolean = execute(DeleteMyCommands(scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMyCommands(
|
public suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
) = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
|
): Boolean = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getMe() = execute(GetMe)
|
public suspend fun TelegramBot.getMe(): ExtendedBot = execute(GetMe)
|
||||||
|
|||||||
@@ -3,15 +3,16 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||||
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
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
public suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(GetMyCommands(scope, languageCode))
|
): List<BotCommand> = execute(GetMyCommands(scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
public suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyCommands(scope, languageCode ?.let(::IetfLang))
|
): List<BotCommand> = getMyCommands(scope, languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDefaultAdministratorRights(
|
public suspend fun TelegramBot.getMyDefaultAdministratorRights(
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
) = execute(GetMyDefaultAdministratorRights(forChannels))
|
): AdministratorChatMember = execute(GetMyDefaultAdministratorRights(forChannels))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels() = getMyDefaultAdministratorRights(forChannels = true)
|
public suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = true)
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups() = getMyDefaultAdministratorRights(forChannels = false)
|
public suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups(): AdministratorChatMember = getMyDefaultAdministratorRights(forChannels = false)
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
import dev.inmo.tgbotapi.requests.bot.GetMyDescription
|
||||||
|
import dev.inmo.tgbotapi.types.BotDescription
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDescription(
|
public suspend fun TelegramBot.getMyDescription(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(GetMyDescription(languageCode))
|
): BotDescription = execute(GetMyDescription(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyDescription(
|
public suspend fun TelegramBot.getMyDescription(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyDescription(languageCode ?.let(::IetfLang))
|
): BotDescription = getMyDescription(languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.bot
|
|||||||
import dev.inmo.micro_utils.language_codes.IetfLang
|
import dev.inmo.micro_utils.language_codes.IetfLang
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
import dev.inmo.tgbotapi.requests.bot.GetMyName
|
||||||
|
import dev.inmo.tgbotapi.types.BotName
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyName(
|
public suspend fun TelegramBot.getMyName(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(GetMyName(languageCode))
|
): BotName = execute(GetMyName(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyName(
|
public suspend fun TelegramBot.getMyName(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyName(languageCode ?.let(::IetfLang))
|
): BotName = getMyName(languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ import dev.inmo.micro_utils.language_codes.IetfLang
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyShortDescription
|
import dev.inmo.tgbotapi.requests.bot.GetMyShortDescription
|
||||||
|
import dev.inmo.tgbotapi.types.BotShortDescription
|
||||||
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
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyShortDescription(
|
public suspend fun TelegramBot.getMyShortDescription(
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(GetMyShortDescription(languageCode))
|
): BotShortDescription = execute(GetMyShortDescription(languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.getMyShortDescription(
|
public suspend fun TelegramBot.getMyShortDescription(
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = getMyShortDescription(languageCode ?.let(::IetfLang))
|
): BotShortDescription = getMyShortDescription(languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -7,26 +7,26 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
public suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLang?
|
||||||
) = execute(SetMyCommands(commands, scope, languageCode))
|
): Boolean = execute(SetMyCommands(commands, scope, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
public suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: IetfLang?
|
languageCode: IetfLang?
|
||||||
) = setMyCommands(commands.toList(), scope, languageCode)
|
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
public suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
|
): Boolean = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
public suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String? = null
|
||||||
) = setMyCommands(commands.toList(), scope, languageCode)
|
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ 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.ChatCommonAdministratorRights
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
public suspend fun TelegramBot.setMyDefaultAdministratorRights(
|
||||||
rights: ChatCommonAdministratorRights,
|
rights: ChatCommonAdministratorRights,
|
||||||
forChannels: Boolean? = null
|
forChannels: Boolean? = null
|
||||||
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
): Boolean = execute(SetMyDefaultAdministratorRights(rights, forChannels))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatCommonAdministratorRights
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = true)
|
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = true)
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
|
||||||
rights: ChatCommonAdministratorRights
|
rights: ChatCommonAdministratorRights
|
||||||
) = setMyDefaultAdministratorRights(rights, forChannels = false)
|
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = false)
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.requests.bot.SetMyDescription
|
|||||||
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
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDescription(
|
public suspend fun TelegramBot.setMyDescription(
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(SetMyDescription(description, languageCode))
|
): Boolean = execute(SetMyDescription(description, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyDescription(
|
public suspend fun TelegramBot.setMyDescription(
|
||||||
description: String?,
|
description: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyDescription(description, languageCode ?.let(::IetfLang))
|
): Boolean = setMyDescription(description, languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import dev.inmo.tgbotapi.requests.bot.SetMyName
|
|||||||
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
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyName(
|
public suspend fun TelegramBot.setMyName(
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(SetMyName(name, languageCode))
|
): Boolean = execute(SetMyName(name, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyName(
|
public suspend fun TelegramBot.setMyName(
|
||||||
name: String?,
|
name: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyName(name, languageCode ?.let(::IetfLang))
|
): Boolean = setMyName(name, languageCode ?.let(::IetfLang))
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import dev.inmo.micro_utils.language_codes.IetfLang
|
|||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyShortDescription(
|
public suspend fun TelegramBot.setMyShortDescription(
|
||||||
shortDescription: String? = null,
|
shortDescription: String? = null,
|
||||||
languageCode: IetfLang? = null
|
languageCode: IetfLang? = null
|
||||||
) = execute(SetMyShortDescription(shortDescription, languageCode))
|
): Boolean = execute(SetMyShortDescription(shortDescription, languageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyShortDescription(
|
public suspend fun TelegramBot.setMyShortDescription(
|
||||||
shortDescription: String?,
|
shortDescription: String?,
|
||||||
languageCode: String?
|
languageCode: String?
|
||||||
) = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.exportChatInviteLink(
|
public suspend fun TelegramBot.exportChatInviteLink(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(ExportChatInviteLink(chatId))
|
): String = execute(ExportChatInviteLink(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.exportChatInviteLink(
|
public suspend fun TelegramBot.exportChatInviteLink(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = exportChatInviteLink(chat.id)
|
): String = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.leaveChat(
|
public suspend fun TelegramBot.leaveChat(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(LeaveChat(chatId))
|
): Boolean = execute(LeaveChat(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.leaveChat(
|
public suspend fun TelegramBot.leaveChat(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = leaveChat(chat.id)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.closeForumTopic(
|
public suspend fun TelegramBot.closeForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
CloseForumTopic(
|
CloseForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.closeForumTopic(
|
public suspend fun TelegramBot.closeForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = closeForumTopic(chat.id, messageThreadId)
|
): Boolean = closeForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
suspend fun TelegramBot.closeForumTopic(
|
public suspend fun TelegramBot.closeForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
) = closeForumTopic(chat.id, forumTopic.messageThreadId)
|
): Boolean = closeForumTopic(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
|
||||||
|
|
||||||
suspend fun TelegramBot.closeGeneralForumTopic(
|
public suspend fun TelegramBot.closeGeneralForumTopic(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
CloseGeneralForumTopic(chatId)
|
CloseGeneralForumTopic(chatId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.closeGeneralForumTopic(
|
public suspend fun TelegramBot.closeGeneralForumTopic(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = closeGeneralForumTopic(chat.id)
|
): Boolean = closeGeneralForumTopic(chat.id)
|
||||||
|
|||||||
@@ -4,15 +4,16 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.createForumTopic(
|
public suspend fun TelegramBot.createForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String,
|
name: String,
|
||||||
color: RGBColor,
|
color: RGBColor,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
) = execute(
|
): ForumTopic = execute(
|
||||||
CreateForumTopic(
|
CreateForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
name,
|
name,
|
||||||
@@ -21,9 +22,9 @@ suspend fun TelegramBot.createForumTopic(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.createForumTopic(
|
public suspend fun TelegramBot.createForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
name: String,
|
name: String,
|
||||||
color: RGBColor,
|
color: RGBColor,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
) = createForumTopic(chat.id, name, color, iconEmojiId)
|
): ForumTopic = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteForumTopic(
|
public suspend fun TelegramBot.deleteForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
DeleteForumTopic(
|
DeleteForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteForumTopic(
|
public suspend fun TelegramBot.deleteForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
) = deleteForumTopic(chatId, forumTopic.messageThreadId)
|
): Boolean = deleteForumTopic(chatId, forumTopic.messageThreadId)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteForumTopic(
|
public suspend fun TelegramBot.deleteForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = deleteForumTopic(chat.id, messageThreadId)
|
): Boolean = deleteForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteForumTopic(
|
public suspend fun TelegramBot.deleteForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
) = deleteForumTopic(chat.id, forumTopic.messageThreadId)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.editForumTopic(
|
public suspend fun TelegramBot.editForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId,
|
messageThreadId: MessageThreadId,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
EditForumTopic(
|
EditForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId,
|
messageThreadId,
|
||||||
@@ -22,15 +22,15 @@ suspend fun TelegramBot.editForumTopic(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.editForumTopic(
|
public suspend fun TelegramBot.editForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId,
|
messageThreadId: MessageThreadId,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
iconEmojiId: CustomEmojiId? = null
|
iconEmojiId: CustomEmojiId? = null
|
||||||
) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
|
): Boolean = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
|
||||||
|
|
||||||
suspend fun TelegramBot.editForumTopic(
|
public suspend fun TelegramBot.editForumTopic(
|
||||||
chatIdentifier: ChatIdentifier,
|
chatIdentifier: ChatIdentifier,
|
||||||
forumTopic: ForumTopic,
|
forumTopic: ForumTopic,
|
||||||
iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId
|
iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId
|
||||||
) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
|
): Boolean = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
|
||||||
|
|||||||
@@ -9,22 +9,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
|
||||||
|
|
||||||
suspend fun TelegramBot.editGeneralForumTopic(
|
public suspend fun TelegramBot.editGeneralForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String
|
name: String
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
EditGeneralForumTopic(
|
EditGeneralForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
name
|
name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.editGeneralForumTopic(
|
public suspend fun TelegramBot.editGeneralForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
name: String
|
name: String
|
||||||
) = editGeneralForumTopic(chat.id, name)
|
): Boolean = editGeneralForumTopic(chat.id, name)
|
||||||
|
|
||||||
suspend fun TelegramBot.editGeneralForumTopic(
|
public suspend fun TelegramBot.editGeneralForumTopic(
|
||||||
chatIdentifier: ChatIdentifier,
|
chatIdentifier: ChatIdentifier,
|
||||||
forumTopic: ForumTopic,
|
forumTopic: ForumTopic,
|
||||||
) = editGeneralForumTopic(chatIdentifier, forumTopic.name)
|
): Boolean = editGeneralForumTopic(chatIdentifier, forumTopic.name)
|
||||||
|
|||||||
@@ -9,12 +9,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
|
||||||
|
|
||||||
suspend fun TelegramBot.hideGeneralForumTopic(
|
public suspend fun TelegramBot.hideGeneralForumTopic(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
HideGeneralForumTopic(chatId)
|
HideGeneralForumTopic(chatId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.hideGeneralForumTopic(
|
public suspend fun TelegramBot.hideGeneralForumTopic(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = hideGeneralForumTopic(chat.id)
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.reopenForumTopic(
|
public suspend fun TelegramBot.reopenForumTopic(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
ReopenForumTopic(
|
ReopenForumTopic(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.reopenForumTopic(
|
public suspend fun TelegramBot.reopenForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = reopenForumTopic(chat.id, messageThreadId)
|
): Boolean = reopenForumTopic(chat.id, messageThreadId)
|
||||||
|
|
||||||
suspend fun TelegramBot.reopenForumTopic(
|
public suspend fun TelegramBot.reopenForumTopic(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
) = reopenForumTopic(chat.id, forumTopic.messageThreadId)
|
): Boolean = reopenForumTopic(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
|
||||||
|
|
||||||
suspend fun TelegramBot.reopenGeneralForumTopic(
|
public suspend fun TelegramBot.reopenGeneralForumTopic(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
ReopenGeneralForumTopic(chatId)
|
ReopenGeneralForumTopic(chatId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.reopenGeneralForumTopic(
|
public suspend fun TelegramBot.reopenGeneralForumTopic(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = reopenGeneralForumTopic(chat.id)
|
): Boolean = reopenGeneralForumTopic(chat.id)
|
||||||
|
|||||||
@@ -10,12 +10,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
|
||||||
|
|
||||||
suspend fun TelegramBot.unhideGeneralForumTopic(
|
public suspend fun TelegramBot.unhideGeneralForumTopic(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
UnhideGeneralForumTopic(chatId)
|
UnhideGeneralForumTopic(chatId)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.unhideGeneralForumTopic(
|
public suspend fun TelegramBot.unhideGeneralForumTopic(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = unhideGeneralForumTopic(chat.id)
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
UnpinAllForumTopicMessages(
|
UnpinAllForumTopicMessages(
|
||||||
chatId,
|
chatId,
|
||||||
messageThreadId
|
messageThreadId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageThreadId: MessageThreadId
|
messageThreadId: MessageThreadId
|
||||||
) = unpinAllForumTopicMessages(chat.id, messageThreadId)
|
): Boolean = unpinAllForumTopicMessages(chat.id, messageThreadId)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllForumTopicMessages(
|
public suspend fun TelegramBot.unpinAllForumTopicMessages(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
forumTopic: ForumTopic
|
forumTopic: ForumTopic
|
||||||
) = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
|
): Boolean = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
UnpinAllGeneralForumTopicMessages(
|
UnpinAllGeneralForumTopicMessages(
|
||||||
chatId
|
chatId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = unpinAllGeneralForumTopicMessages(chat.id)
|
): Boolean = unpinAllGeneralForumTopicMessages(chat.id)
|
||||||
|
|||||||
@@ -3,36 +3,16 @@ 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.ChannelChat
|
import dev.inmo.tgbotapi.types.chat.*
|
||||||
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
|
||||||
|
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(GetChat(chatId))
|
): ExtendedChat = execute(GetChat(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = getChat(chat.id)
|
): ExtendedChat = 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
|
||||||
@@ -41,9 +21,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = getChat(chat.id) as ExtendedPublicChat
|
): ExtendedPublicChat = getChat(chat.id) as ExtendedPublicChat
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,9 +33,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: ChannelChat
|
chat: ChannelChat
|
||||||
) = getChat(chat.id) as ExtendedChannelChat
|
): 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
|
||||||
@@ -64,9 +44,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: ChannelChatImpl
|
chat: ChannelChatImpl
|
||||||
) = getChat(chat.id) as ExtendedChannelChatImpl
|
): ExtendedChannelChatImpl = getChat(chat.id) as ExtendedChannelChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,9 +56,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: GroupChat
|
chat: GroupChat
|
||||||
) = getChat(chat.id) as ExtendedGroupChat
|
): 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
|
||||||
@@ -87,9 +67,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: GroupChatImpl
|
chat: GroupChatImpl
|
||||||
) = getChat(chat.id) as ExtendedGroupChatImpl
|
): ExtendedGroupChatImpl = getChat(chat.id) as ExtendedGroupChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,9 +79,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: SupergroupChat
|
chat: SupergroupChat
|
||||||
) = getChat(chat.id) as ExtendedSupergroupChat
|
): 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
|
||||||
@@ -110,9 +90,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: SupergroupChatImpl
|
chat: SupergroupChatImpl
|
||||||
) = getChat(chat.id) as ExtendedSupergroupChatImpl
|
): ExtendedSupergroupChatImpl = getChat(chat.id) as ExtendedSupergroupChatImpl
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,9 +102,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: PrivateChat
|
chat: PrivateChat
|
||||||
) = getChat(chat.id) as ExtendedPrivateChat
|
): 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
|
||||||
@@ -133,9 +113,9 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: PrivateChatImpl
|
chat: PrivateChatImpl
|
||||||
) = getChat(chat.id) as ExtendedPrivateChatImpl
|
): 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
|
||||||
@@ -144,6 +124,6 @@ suspend fun TelegramBot.getChat(
|
|||||||
* @throws ClassCastException
|
* @throws ClassCastException
|
||||||
*/
|
*/
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
suspend fun TelegramBot.getChat(
|
public suspend fun TelegramBot.getChat(
|
||||||
chat: CommonUser
|
chat: CommonUser
|
||||||
) = getChat(chat.id) as ExtendedUser
|
): ExtendedUser = getChat(chat.id) as ExtendedUser
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatAdministrators(
|
public suspend fun TelegramBot.getChatAdministrators(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(GetChatAdministrators(chatId))
|
): List<AdministratorChatMember> = execute(GetChatAdministrators(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatAdministrators(
|
public suspend fun TelegramBot.getChatAdministrators(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = getChatAdministrators(chat.id)
|
): List<AdministratorChatMember> = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMemberCount(
|
public suspend fun TelegramBot.getChatMemberCount(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(GetChatMemberCount(chatId))
|
): Int = execute(GetChatMemberCount(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMemberCount(
|
public suspend fun TelegramBot.getChatMemberCount(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = getChatMemberCount(chat.id)
|
): Int = getChatMemberCount(chat.id)
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMenuButton(
|
public suspend fun TelegramBot.getChatMenuButton(
|
||||||
chatId: IdChatIdentifier
|
chatId: IdChatIdentifier
|
||||||
) = execute(GetChatMenuButton(chatId))
|
): MenuButton = execute(GetChatMenuButton(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMenuButton(
|
public suspend fun TelegramBot.getChatMenuButton(
|
||||||
chat: PrivateChat
|
chat: PrivateChat
|
||||||
) = getChatMenuButton(chat.id)
|
): MenuButton = getChatMenuButton(chat.id)
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton)
|
public suspend fun TelegramBot.getDefaultChatMenuButton(): MenuButton = execute(GetDefaultChatMenuButton)
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getForumTopicIconStickers() = execute(GetForumTopicIconStickers)
|
public suspend fun TelegramBot.getForumTopicIconStickers(): List<Sticker> = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = execute(ApproveChatJoinRequest(chatId, userId))
|
): Boolean = execute(ApproveChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = approveChatJoinRequest(chat.id, userId)
|
): Boolean = approveChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
) = approveChatJoinRequest(chatId, user.id)
|
): Boolean = approveChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
) = approveChatJoinRequest(chat.id, user.id)
|
): Boolean = approveChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
) = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
): Boolean = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
suspend fun TelegramBot.approve(
|
public suspend fun TelegramBot.approve(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
) = approveChatJoinRequest(chatJoinRequest)
|
): Boolean = approveChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
suspend fun TelegramBot.approveChatJoinRequest(
|
public suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
) = approveChatJoinRequest(chatJoinRequestUpdate.data)
|
): Boolean = approveChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
|
|||||||
@@ -3,84 +3,151 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
import korlibs.time.DateTime
|
import korlibs.time.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.ChatIdentifier
|
import dev.inmo.tgbotapi.types.*
|
||||||
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
|
import korlibs.time.TimeSpan
|
||||||
|
import korlibs.time.days
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
|
): ChatInviteLinkUnlimited = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = createChatInviteLinkUnlimited(chat.id, name, expiration)
|
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null
|
name: String? = null
|
||||||
) = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
|
): ChatInviteLinkWithLimitedMembers = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
|
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
public suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
membersLimit: MembersLimit,
|
membersLimit: MembersLimit,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
|
): ChatInviteLinkWithJoinRequest = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
|
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
|
||||||
|
// Subscriptions
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
subscriptionPrice: UInt,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: TelegramDate? = null,
|
||||||
|
): ChatInviteLinkUnlimited = execute(CreateChatInviteLink.subscription(chatId, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp))
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
subscriptionPrice: UInt,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: TelegramDate? = null,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
subscriptionPrice: UInt,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: DateTime,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp.toTelegramDate())
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
subscriptionPrice: UInt,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: DateTime,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
subscriptionPrice: Int,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: TelegramDate? = null,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
subscriptionPrice: Int,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: TelegramDate? = null,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
subscriptionPrice: Int,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: DateTime,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.createChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
subscriptionPrice: Int,
|
||||||
|
subscriptionPeriod: TimeSpan = 30.days,
|
||||||
|
name: String? = null,
|
||||||
|
expirationUnixTimeStamp: DateTime,
|
||||||
|
): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = execute(DeclineChatJoinRequest(chatId, userId))
|
): Boolean = execute(DeclineChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = declineChatJoinRequest(chat.id, userId)
|
): Boolean = declineChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
) = declineChatJoinRequest(chatId, user.id)
|
): Boolean = declineChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
) = declineChatJoinRequest(chat.id, user.id)
|
): Boolean = declineChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
) = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
): Boolean = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
suspend fun TelegramBot.decline(
|
public suspend fun TelegramBot.decline(
|
||||||
chatJoinRequest: ChatJoinRequest
|
chatJoinRequest: ChatJoinRequest
|
||||||
) = declineChatJoinRequest(chatJoinRequest)
|
): Boolean = declineChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
suspend fun TelegramBot.declineChatJoinRequest(
|
public suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
) = declineChatJoinRequest(chatJoinRequestUpdate.data)
|
): Boolean = declineChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
|
|||||||
@@ -3,185 +3,208 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|||||||
import korlibs.time.DateTime
|
import korlibs.time.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.ChatIdentifier
|
import dev.inmo.tgbotapi.types.*
|
||||||
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
|
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
): ChatInviteLinkUnlimited = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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
|
||||||
) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
): ChatInviteLinkWithLimitedMembers = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
): ChatInviteLinkWithJoinRequest = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String,
|
previousLink: String,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
public suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkUnlimited = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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
|
||||||
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
public 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,
|
||||||
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithLimitedMembers = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null
|
expiration: TelegramDate? = null
|
||||||
) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
expiration: TelegramDate? = null,
|
expiration: TelegramDate? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink,
|
previousLink: ChatInviteLink,
|
||||||
expiration: DateTime,
|
expiration: DateTime,
|
||||||
name: String? = null,
|
name: String? = null,
|
||||||
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
|
||||||
|
// Subscriptions
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.editChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
name: String,
|
||||||
|
): ChatInviteLinkUnlimited = execute(EditChatInviteLink.subscription(chatId, previousLink, name))
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.editChatSubscriptionInviteLink(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String,
|
||||||
|
): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chatId, previousLink.inviteLink, name)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.editChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
name: String,
|
||||||
|
): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chat.id, previousLink, name)
|
||||||
|
|
||||||
|
public suspend fun TelegramBot.editChatSubscriptionInviteLink(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String,
|
||||||
|
): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chat.id, previousLink, name)
|
||||||
|
|||||||
@@ -4,24 +4,25 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.revokeChatInviteLink(
|
public suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: String
|
previousLink: String
|
||||||
) = execute(RevokeChatInviteLink(chatId, previousLink))
|
): SecondaryChatInviteLink = execute(RevokeChatInviteLink(chatId, previousLink))
|
||||||
|
|
||||||
suspend fun TelegramBot.revokeChatInviteLink(
|
public suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: String
|
previousLink: String
|
||||||
) = revokeChatInviteLink(chat.id, previousLink)
|
): SecondaryChatInviteLink = revokeChatInviteLink(chat.id, previousLink)
|
||||||
|
|
||||||
suspend fun TelegramBot.revokeChatInviteLink(
|
public suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
previousLink: ChatInviteLink
|
previousLink: ChatInviteLink
|
||||||
) = revokeChatInviteLink(chatId, previousLink.inviteLink)
|
): SecondaryChatInviteLink = revokeChatInviteLink(chatId, previousLink.inviteLink)
|
||||||
|
|
||||||
suspend fun TelegramBot.revokeChatInviteLink(
|
public suspend fun TelegramBot.revokeChatInviteLink(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
previousLink: ChatInviteLink
|
previousLink: ChatInviteLink
|
||||||
) = revokeChatInviteLink(chat, previousLink.inviteLink)
|
): SecondaryChatInviteLink = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatMember(
|
public suspend fun TelegramBot.banChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
) = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
|
): Boolean = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatMember(
|
public suspend fun TelegramBot.banChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
) = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
): Boolean = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatMember(
|
public suspend fun TelegramBot.banChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
) = banChatMember(chatId, user.id, untilDate, revokeMessages)
|
): Boolean = banChatMember(chatId, user.id, untilDate, revokeMessages)
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatMember(
|
public suspend fun TelegramBot.banChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
revokeMessages: Boolean? = null
|
revokeMessages: Boolean? = null
|
||||||
) = banChatMember(chat.id, user.id, untilDate, revokeMessages)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatSenderChat(
|
public suspend fun TelegramBot.banChatSenderChat(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
) = execute(BanChatSenderChat(chatId, senderChatId))
|
): Boolean = execute(BanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatSenderChat(
|
public suspend fun TelegramBot.banChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
) = banChatSenderChat(chat.id, senderChatId)
|
): Boolean = banChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatSenderChat(
|
public suspend fun TelegramBot.banChatSenderChat(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
senderChat: PublicChat
|
senderChat: PublicChat
|
||||||
) = banChatSenderChat(chatId, senderChat.id)
|
): Boolean = banChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.banChatSenderChat(
|
public suspend fun TelegramBot.banChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChat: PublicChat,
|
senderChat: PublicChat,
|
||||||
) = banChatSenderChat(chat.id, senderChat)
|
): Boolean = banChatSenderChat(chat.id, senderChat)
|
||||||
|
|||||||
@@ -7,23 +7,24 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMember(
|
public suspend fun TelegramBot.getChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = execute(GetChatMember(chatId, userId))
|
): ChatMember = execute(GetChatMember(chatId, userId))
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMember(
|
public suspend fun TelegramBot.getChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId
|
userId: UserId
|
||||||
) = getChatMember(chat.id, userId)
|
): ChatMember = getChatMember(chat.id, userId)
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMember(
|
public suspend fun TelegramBot.getChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User
|
user: User
|
||||||
) = getChatMember(chatId, user.id)
|
): ChatMember = getChatMember(chatId, user.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.getChatMember(
|
public suspend fun TelegramBot.getChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User
|
user: User
|
||||||
) = getChatMember(chat.id, user.id)
|
): ChatMember = getChatMember(chat.id, user.id)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -27,7 +27,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
PromoteChannelAdministrator(
|
PromoteChannelAdministrator(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
userId = userId,
|
userId = userId,
|
||||||
@@ -48,7 +48,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -65,7 +65,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChannelAdministrator(
|
): Boolean = promoteChannelAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -84,7 +84,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canDeleteStories = canDeleteStories
|
canDeleteStories = canDeleteStories
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -101,7 +101,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChannelAdministrator(
|
): Boolean = promoteChannelAdministrator(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -120,7 +120,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canDeleteStories = canDeleteStories
|
canDeleteStories = canDeleteStories
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChannelAdministrator(
|
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -137,7 +137,7 @@ suspend fun TelegramBot.promoteChannelAdministrator(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChannelAdministrator(
|
): Boolean = promoteChannelAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -21,7 +21,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
userId,
|
userId,
|
||||||
@@ -37,7 +37,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -49,7 +49,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
) = promoteChatAdministrator(
|
): Boolean = promoteChatAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate,
|
untilDate,
|
||||||
@@ -63,7 +63,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canManageChat
|
canManageChat
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -75,7 +75,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
) = promoteChatAdministrator(
|
): Boolean = promoteChatAdministrator(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate,
|
untilDate,
|
||||||
@@ -89,7 +89,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canManageChat
|
canManageChat
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatAdministrator(
|
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -101,7 +101,7 @@ suspend fun TelegramBot.promoteChatAdministrator(
|
|||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
) = promoteChatAdministrator(
|
): Boolean = promoteChatAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate,
|
untilDate,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ 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")
|
@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,
|
||||||
@@ -27,7 +27,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
userId = userId,
|
userId = userId,
|
||||||
@@ -51,7 +51,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
@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,
|
||||||
@@ -70,7 +70,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChatMember(
|
): Boolean = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -92,7 +92,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
@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,
|
||||||
@@ -111,7 +111,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChatMember(
|
): Boolean = promoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -133,7 +133,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Warning("This method is too common. Use it with caution")
|
@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,
|
||||||
@@ -152,7 +152,7 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canPostStories: Boolean? = null,
|
canPostStories: Boolean? = null,
|
||||||
canEditStories: Boolean? = null,
|
canEditStories: Boolean? = null,
|
||||||
canDeleteStories: Boolean? = null
|
canDeleteStories: Boolean? = null
|
||||||
) = promoteChatMember(
|
): Boolean = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -24,7 +24,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null,
|
||||||
) = execute(
|
): Boolean = execute(
|
||||||
PromoteSupergroupAdministrator(
|
PromoteSupergroupAdministrator(
|
||||||
chatId = chatId,
|
chatId = chatId,
|
||||||
userId = userId,
|
userId = userId,
|
||||||
@@ -42,7 +42,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -56,7 +56,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null,
|
||||||
) = promoteSupergroupAdministrator(
|
): Boolean = promoteSupergroupAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -72,7 +72,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageTopics = canManageTopics
|
canManageTopics = canManageTopics
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -86,7 +86,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null,
|
||||||
) = promoteSupergroupAdministrator(
|
): Boolean = promoteSupergroupAdministrator(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
@@ -102,7 +102,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageTopics = canManageTopics
|
canManageTopics = canManageTopics
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteSupergroupAdministrator(
|
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
untilDate: TelegramDate? = null,
|
untilDate: TelegramDate? = null,
|
||||||
@@ -116,7 +116,7 @@ suspend fun TelegramBot.promoteSupergroupAdministrator(
|
|||||||
canManageVideoChats: Boolean? = null,
|
canManageVideoChats: Boolean? = null,
|
||||||
canManageChat: Boolean? = null,
|
canManageChat: Boolean? = null,
|
||||||
canManageTopics: Boolean? = null,
|
canManageTopics: Boolean? = null,
|
||||||
) = promoteSupergroupAdministrator(
|
): Boolean = promoteSupergroupAdministrator(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
untilDate = untilDate,
|
untilDate = untilDate,
|
||||||
|
|||||||
@@ -10,35 +10,35 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.restrictChatMember(
|
public 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 }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions))
|
): Boolean = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions))
|
||||||
|
|
||||||
suspend fun TelegramBot.restrictChatMember(
|
public 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 }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions)
|
): Boolean = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions)
|
||||||
|
|
||||||
suspend fun TelegramBot.restrictChatMember(
|
public 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 }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions)
|
): Boolean = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions)
|
||||||
|
|
||||||
suspend fun TelegramBot.restrictChatMember(
|
public 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 }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions)
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
|
): Boolean = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
) = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
|
): Boolean = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
) = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
|
): Boolean = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
customTitle: String
|
customTitle: String
|
||||||
) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatMember(
|
public suspend fun TelegramBot.unbanChatMember(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
) = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
|
): Boolean = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatMember(
|
public suspend fun TelegramBot.unbanChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
) = unbanChatMember(chat.id, userId, onlyIfBanned)
|
): Boolean = unbanChatMember(chat.id, userId, onlyIfBanned)
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatMember(
|
public suspend fun TelegramBot.unbanChatMember(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
user: User,
|
user: User,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
) = unbanChatMember(chatId, user.id, onlyIfBanned)
|
): Boolean = unbanChatMember(chatId, user.id, onlyIfBanned)
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatMember(
|
public suspend fun TelegramBot.unbanChatMember(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
user: User,
|
user: User,
|
||||||
onlyIfBanned: Boolean? = null
|
onlyIfBanned: Boolean? = null
|
||||||
) = unbanChatMember(chat.id, user.id, onlyIfBanned)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatSenderChat(
|
public suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
) = execute(UnbanChatSenderChat(chatId, senderChatId))
|
): Boolean = execute(UnbanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatSenderChat(
|
public suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChatId: IdChatIdentifier
|
senderChatId: IdChatIdentifier
|
||||||
) = unbanChatSenderChat(chat.id, senderChatId)
|
): Boolean = unbanChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatSenderChat(
|
public suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
senderChat: PublicChat
|
senderChat: PublicChat
|
||||||
) = unbanChatSenderChat(chatId, senderChat.id)
|
): Boolean = unbanChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
suspend fun TelegramBot.unbanChatSenderChat(
|
public suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
senderChat: PublicChat,
|
senderChat: PublicChat,
|
||||||
) = unbanChatSenderChat(chat.id, senderChat)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteChatPhoto(
|
public suspend fun TelegramBot.deleteChatPhoto(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(DeleteChatPhoto(chatId))
|
): Boolean = execute(DeleteChatPhoto(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteChatPhoto(
|
public suspend fun TelegramBot.deleteChatPhoto(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = deleteChatPhoto(chat.id)
|
): Boolean = deleteChatPhoto(chat.id)
|
||||||
|
|||||||
@@ -4,22 +4,27 @@ 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.AccessibleMessage
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
public suspend fun TelegramBot.pinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = execute(PinChatMessage(chatId, messageId, disableNotification))
|
): Boolean = execute(PinChatMessage(chatId, messageId, businessConnectionId, disableNotification))
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
public suspend fun TelegramBot.pinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = pinChatMessage(chat.id, messageId, disableNotification)
|
): Boolean = pinChatMessage(chat.id, messageId, businessConnectionId, disableNotification)
|
||||||
|
|
||||||
suspend fun TelegramBot.pinChatMessage(
|
public suspend fun TelegramBot.pinChatMessage(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false
|
||||||
) = pinChatMessage(message.chat.id, message.messageId, disableNotification)
|
): Boolean = pinChatMessage(message.chat.id, message.messageId, businessConnectionId, 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatDescription(
|
public suspend fun TelegramBot.setChatDescription(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
description: String
|
description: String
|
||||||
) = execute(SetChatDescription(chatId, description))
|
): Boolean = execute(SetChatDescription(chatId, description))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatDescription(
|
public suspend fun TelegramBot.setChatDescription(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
description: String
|
description: String
|
||||||
) = setChatDescription(chat.id, description)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatMenuButton(
|
public suspend fun TelegramBot.setChatMenuButton(
|
||||||
chatId: IdChatIdentifier,
|
chatId: IdChatIdentifier,
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
) = execute(SetChatMenuButton(chatId, menuButton))
|
): Boolean = execute(SetChatMenuButton(chatId, menuButton))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatMenuButton(
|
public suspend fun TelegramBot.setChatMenuButton(
|
||||||
chat: PrivateChat,
|
chat: PrivateChat,
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
) = setChatMenuButton(chat.id, menuButton)
|
): Boolean = setChatMenuButton(chat.id, menuButton)
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
public suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
permissions: ChatPermissions,
|
permissions: ChatPermissions,
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = execute(SetChatPermissions(chatId, permissions, useIndependentChatPermissions))
|
): Boolean = execute(SetChatPermissions(chatId, permissions, useIndependentChatPermissions))
|
||||||
|
|
||||||
suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
public suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
permissions: ChatPermissions,
|
permissions: ChatPermissions,
|
||||||
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
|
||||||
) = setDefaultChatMembersPermissions(chat.id, permissions, useIndependentChatPermissions)
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatPhoto(
|
public suspend fun TelegramBot.setChatPhoto(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
photo: MultipartFile
|
photo: MultipartFile
|
||||||
) = execute(SetChatPhoto(chatId, photo))
|
): Boolean = execute(SetChatPhoto(chatId, photo))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatPhoto(
|
public suspend fun TelegramBot.setChatPhoto(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
photo: MultipartFile
|
photo: MultipartFile
|
||||||
) = setChatPhoto(chat.id, photo)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatTitle(
|
public suspend fun TelegramBot.setChatTitle(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
title: String
|
title: String
|
||||||
) = execute(SetChatTitle(chatId, title))
|
): Boolean = execute(SetChatTitle(chatId, title))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatTitle(
|
public suspend fun TelegramBot.setChatTitle(
|
||||||
chat: PublicChat,
|
chat: PublicChat,
|
||||||
title: String
|
title: String
|
||||||
) = setChatTitle(chat.id, title)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setDefaultChatMenuButton(
|
public suspend fun TelegramBot.setDefaultChatMenuButton(
|
||||||
menuButton: MenuButton
|
menuButton: MenuButton
|
||||||
) = execute(SetDefaultChatMenuButton(menuButton))
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllChatMessages(
|
public suspend fun TelegramBot.unpinAllChatMessages(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(UnpinAllChatMessages(chatId))
|
): Boolean = execute(UnpinAllChatMessages(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinAllChatMessages(
|
public suspend fun TelegramBot.unpinAllChatMessages(
|
||||||
chat: Chat
|
chat: Chat
|
||||||
) = unpinAllChatMessages(chat.id)
|
): Boolean = unpinAllChatMessages(chat.id)
|
||||||
|
|||||||
@@ -4,19 +4,24 @@ 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.AccessibleMessage
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
public suspend fun TelegramBot.unpinChatMessage(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId? = null
|
messageId: MessageId? = null,
|
||||||
) = execute(UnpinChatMessage(chatId, messageId))
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
): Boolean = execute(UnpinChatMessage(chatId, messageId, businessConnectionId))
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
public suspend fun TelegramBot.unpinChatMessage(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId? = null
|
messageId: MessageId? = null,
|
||||||
) = unpinChatMessage(chat.id, messageId)
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId
|
||||||
|
): Boolean = unpinChatMessage(chat.id, messageId, businessConnectionId)
|
||||||
|
|
||||||
suspend fun TelegramBot.unpinChatMessage(
|
public suspend fun TelegramBot.unpinChatMessage(
|
||||||
message: AccessibleMessage
|
message: AccessibleMessage,
|
||||||
) = unpinChatMessage(message.chat.id, message.messageId)
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
): 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
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteChatStickerSet(
|
public suspend fun TelegramBot.deleteChatStickerSet(
|
||||||
chatId: ChatIdentifier
|
chatId: ChatIdentifier
|
||||||
) = execute(DeleteChatStickerSet(chatId))
|
): Boolean = execute(DeleteChatStickerSet(chatId))
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteChatStickerSet(
|
public suspend fun TelegramBot.deleteChatStickerSet(
|
||||||
chat: SupergroupChat
|
chat: SupergroupChat
|
||||||
) = deleteChatStickerSet(chat.id)
|
): Boolean = 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
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatStickerSet(
|
public suspend fun TelegramBot.setChatStickerSet(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
stickerSetName: StickerSetName
|
stickerSetName: StickerSetName
|
||||||
) = execute(SetChatStickerSet(chatId, stickerSetName))
|
): Boolean = execute(SetChatStickerSet(chatId, stickerSetName))
|
||||||
|
|
||||||
suspend fun TelegramBot.setChatStickerSet(
|
public suspend fun TelegramBot.setChatStickerSet(
|
||||||
chat: SupergroupChat,
|
chat: SupergroupChat,
|
||||||
stickerSetName: StickerSetName
|
stickerSetName: StickerSetName
|
||||||
) = setChatStickerSet(chat.id, stickerSetName)
|
): Boolean = setChatStickerSet(chat.id, stickerSetName)
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
|
|||||||
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
|
||||||
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||||
@@ -25,32 +26,36 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun <T> TelegramBot.edit(
|
public suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, text, parseMode, replyMarkup)
|
return editMessageCaption(message, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun <T> TelegramBot.edit(
|
public suspend fun <T> TelegramBot.edit(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message, entities, replyMarkup)
|
return editMessageCaption(message, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -59,14 +64,15 @@ suspend fun TelegramBot.edit(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
): ContentMessage<LiveLocationContent> = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -75,14 +81,15 @@ suspend fun TelegramBot.edit(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
@@ -90,222 +97,242 @@ suspend fun TelegramBot.edit(
|
|||||||
horizontalAccuracy: Meters? = null,
|
horizontalAccuracy: Meters? = null,
|
||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
): ContentMessage<LiveLocationContent> = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(
|
): ContentMessage<LiveLocationContent> = editLiveLocation(
|
||||||
chatId, messageId, location, replyMarkup
|
chatId, messageId, location, businessConnectionId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat, messageId, location, replyMarkup)
|
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message, location, replyMarkup)
|
): ContentMessage<LiveLocationContent> = editLiveLocation(message, location, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chatId, messageId, media, replyMarkup)
|
): ContentMessage<MediaContent> = editMessageMedia(chatId, messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat, messageId, media, replyMarkup)
|
): ContentMessage<MediaContent> = editMessageMedia(chat, messageId, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<MediaContent>,
|
message: ContentMessage<MediaContent>,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(message, media, replyMarkup)
|
): ContentMessage<MediaContent> = editMessageMedia(message, media, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
|
): ContentMessage<MessageContent> = editMessageReplyMarkup(chatId, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
|
): ContentMessage<MessageContent> = editMessageReplyMarkup(chat, messageId, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(message, replyMarkup)
|
): ContentMessage<MessageContent> = editMessageReplyMarkup(message, businessConnectionId, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public 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,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = editMessageText(chatId, messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chatId, messageId, entities, linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = editMessageText(chatId, messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(chatId, messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(chatId, messageId, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = edit(message.chat.id, message.messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message.chat.id, message.messageId, text, parseMode, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = edit(message.chat.id, message.messageId, entities, linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message.chat.id, message.messageId, entities, businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
public suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
public suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(message, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): ContentMessage<TextContent> = edit(message, buildEntities(separator, builderBody), businessConnectionId, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
|
|||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||||
import dev.inmo.tgbotapi.types.media.TelegramMedia
|
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.message.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
|
||||||
@@ -19,7 +19,7 @@ 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
@@ -27,17 +27,17 @@ suspend fun TelegramBot.edit(
|
|||||||
heading: Degrees? = null,
|
heading: Degrees? = null,
|
||||||
proximityAlertRadius: Meters? = null,
|
proximityAlertRadius: Meters? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
): Boolean = editLiveLocation(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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(
|
): Boolean = editLiveLocation(
|
||||||
messageId, location, replyMarkup
|
messageId, location, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -45,64 +45,68 @@ suspend fun TelegramBot.edit(
|
|||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
media: TelegramMedia,
|
media: TelegramFreeMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(messageId, media, replyMarkup)
|
): Boolean = editMessageMedia(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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(messageId, replyMarkup)
|
): Boolean = editMessageReplyMarkup(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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
): Boolean = editMessageText(messageId, text, parseMode, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(messageId, entities, linkPreviewOptions, replyMarkup)
|
): Boolean = editMessageText(messageId, entities, showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
separator: TextSource? = null,
|
separator: TextSource? = null,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): Boolean = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.edit(
|
public suspend fun TelegramBot.edit(
|
||||||
messageId: InlineMessageId,
|
messageId: InlineMessageId,
|
||||||
separator: String,
|
separator: String,
|
||||||
|
showCaptionAboveMedia: Boolean = false,
|
||||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null,
|
replyMarkup: InlineKeyboardMarkup? = null,
|
||||||
builderBody: EntitiesBuilderBody
|
builderBody: EntitiesBuilderBody
|
||||||
) = edit(messageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
): Boolean = edit(messageId, buildEntities(separator, builderBody), showCaptionAboveMedia, linkPreviewOptions, replyMarkup)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
@@ -19,83 +21,89 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
|||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
): ContentMessage<MediaContent> = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, text, parseMode, showCaptionAboveMedia, replyMarkup)
|
): ContentMessage<MediaContent> = editMessageCaption(chat.id, messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
public suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(
|
): ContentMessage<MediaContent> = execute(
|
||||||
EditChatMessageCaption(chatId, messageId, entities, showCaptionAboveMedia, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageId,
|
messageId: MessageId,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, entities, showCaptionAboveMedia, replyMarkup)
|
): ContentMessage<MediaContent> = editMessageCaption(chat.id, messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
public suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup) as ContentMessage<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,11 +111,12 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
|
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
public suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: AccessibleMessage,
|
message: AccessibleMessage,
|
||||||
entities: List<TextSource>,
|
entities: TextSourcesList,
|
||||||
|
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
|
||||||
showCaptionAboveMedia: Boolean = false,
|
showCaptionAboveMedia: Boolean = false,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
|
||||||
return editMessageCaption(message.chat.id, message.messageId, entities, showCaptionAboveMedia, replyMarkup)
|
return editMessageCaption(message.chat.id, message.messageId, entities, businessConnectionId, showCaptionAboveMedia, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,19 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
* as a builder for that
|
* as a builder for that
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup))
|
): Boolean = execute(EditInlineMessageCaption(inlineMessageId, 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
|
||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
public suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageId,
|
inlineMessageId: InlineMessageId,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))
|
): Boolean = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user