mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-21 13:45:50 +00:00
Compare commits
254 Commits
0.35.7
...
602f15c206
| Author | SHA1 | Date | |
|---|---|---|---|
| 602f15c206 | |||
| c2f40534e6 | |||
| 5693d4d808 | |||
| 9fe55aa6ef | |||
| 8f817f1492 | |||
| 0fd146655d | |||
| 94e5f74a90 | |||
| b9bffbb71b | |||
| 5ec5c3bdfd | |||
| a5ed2a82bb | |||
| 1b7dd11e75 | |||
| 8d0307fb7f | |||
| c500f0a281 | |||
| b3abeaa5ae | |||
| 8930a66134 | |||
| 76a2a2ca74 | |||
| 7dff8af460 | |||
| 5261ab1cf0 | |||
| f45c653fca | |||
| 5e03098ca8 | |||
| 2a3d8e6e73 | |||
| 8c3dac7932 | |||
| 83fb7f7bcb | |||
| 459414e7dd | |||
| 508d51f5a9 | |||
| 36f22579b2 | |||
| d3d5f7f2e6 | |||
| 1369680419 | |||
| f6e819be62 | |||
| 553da0a3ee | |||
| bace2724da | |||
| be710612b5 | |||
| ea19c10f41 | |||
| 1b88881c62 | |||
| be62c4fe37 | |||
| d3499cdde1 | |||
| 01d04f9d2b | |||
| d290992e40 | |||
| 867bdb8bd7 | |||
| 5f0a67187f | |||
| d9638849e2 | |||
| 5568720b5b | |||
| c0c591fe08 | |||
| 3c1f8421c9 | |||
| 35b20d102c | |||
| 70e6dc8fc9 | |||
| 4f0de376ab | |||
| 10c52c695c | |||
| 2d2c745527 | |||
| 1238843bde | |||
| 1ebaa1c387 | |||
| b2bc47ec04 | |||
| 514620b2bd | |||
| 054f06e18b | |||
| 00d467d091 | |||
| 6426ed6571 | |||
| fba6707f44 | |||
| 0c2fe6bce7 | |||
| eee9fe439f | |||
| 3547c09383 | |||
| 956f02d26d | |||
| 468fc0a49b | |||
| 441f3cee3d | |||
| 1ea79b9f7f | |||
| 094f88867d | |||
| 85a8a8eedc | |||
| 28fce0b4c1 | |||
| 2f5fdcdca0 | |||
| 21799d7e4a | |||
| ca409db0ee | |||
| 33c8ee0803 | |||
| 0c0ec22348 | |||
| 24bffbbd97 | |||
| a615d1c4fd | |||
| a76b7977b3 | |||
| 6004879aef | |||
| 98ff2558e9 | |||
| 61c00b38b1 | |||
| 2096671147 | |||
| 094d58f59f | |||
| 578a66b758 | |||
| b5bb40576b | |||
| 953638ddf5 | |||
| 1c9ca7a493 | |||
| c220412b02 | |||
| 41852dde7c | |||
| 3150cd6a37 | |||
| 07de18efd8 | |||
| 9552550198 | |||
| e1c94f772d | |||
| fbed81a1b3 | |||
| b61912d99a | |||
| 5efe74171d | |||
| 393981560c | |||
| 73b355df55 | |||
| 86885e7698 | |||
| 4d9be1a995 | |||
| 596176ee93 | |||
| 2348434048 | |||
| 5c6a430f38 | |||
| 148791ad68 | |||
| 5c5a19c91a | |||
| bd60c4f411 | |||
| e5a36225f8 | |||
| bd2c13c178 | |||
| 6f1f94299b | |||
| 72b8231eab | |||
| 323e5fb391 | |||
| dca5bb40e3 | |||
| c21975a150 | |||
| 8675833b99 | |||
| faf669c035 | |||
| 2f3a683fa0 | |||
| 2a617b5c4d | |||
|
|
aa1e7eea1d | ||
| 22eac5414c | |||
| 8206aefbb6 | |||
| fb8cfed382 | |||
| 2de22a08a3 | |||
| e8022a2ded | |||
| d6cef5984b | |||
| 49bea1bcef | |||
| 85a4459072 | |||
| ce74631580 | |||
| 1e5ce6bb5c | |||
| dc89e914a1 | |||
| ee815c7335 | |||
| 69f4033807 | |||
| 0581587adf | |||
| 23f93075a4 | |||
| 6c3425d5f9 | |||
| d285590348 | |||
| 2e0ad6dd3c | |||
| 96a5e55894 | |||
| 4e3b085cdb | |||
| 8baa601af7 | |||
|
|
facd732fa8 | ||
| e19561367e | |||
| 249efeee7e | |||
| b8cc2421b6 | |||
| 2fa1a064ec | |||
| 63e864741e | |||
| e4f35c0eba | |||
| 944fe6d820 | |||
| 8ea50f36aa | |||
| 17308a6d99 | |||
| 6eabea2529 | |||
| ffe9166fee | |||
| f1be3e2819 | |||
| c4c016c438 | |||
| a85e7d7387 | |||
| fc59ab0cdd | |||
| 9ed7ded967 | |||
| a76a7ae630 | |||
| 4715eb424f | |||
| c24d536d4c | |||
| c969d88bf0 | |||
| 44e9dc9253 | |||
| 10c62bf2c7 | |||
| 20b1645935 | |||
| c5bf9ab1a2 | |||
| cd6d108a9a | |||
| 5369a85faa | |||
| 45a895f32f | |||
| 8c1d7203d2 | |||
| 7394a6e94b | |||
| a962838012 | |||
|
|
a5cc80a1eb | ||
| 064b6222e6 | |||
|
|
8d97057d2c | ||
|
|
78f006e280 | ||
| db956a803c | |||
| aeb131b2f4 | |||
| 6d80c2bddc | |||
| 6e32d4e863 | |||
| 6b62070447 | |||
| ad8710db92 | |||
| f385101e22 | |||
| 15386a63f9 | |||
| 576b25190a | |||
| dd979d8626 | |||
| e60eb68b67 | |||
| 91212eaa3a | |||
| 65c1f018ac | |||
| 5b13d3dded | |||
|
|
2447d3e51f | ||
|
|
4203a0fdfe | ||
| ddd32a81c0 | |||
| db7a42fa9b | |||
| 5e2df1cb4a | |||
| 21c0e375f5 | |||
| 4ac01d0104 | |||
| 9c15410c4e | |||
| c5ff0dbc54 | |||
| 19d221fc29 | |||
| 179a724d20 | |||
| ad9bc36f8c | |||
| 5a192b00d4 | |||
| 2a33b22afb | |||
| db1e01688d | |||
| 22e71354dd | |||
| 2e560db865 | |||
| 016fc81b71 | |||
| b6e72c2399 | |||
| e1e2b93269 | |||
| 834e31906a | |||
| 5831cc6d37 | |||
| 0cce72de8d | |||
| 3919359f79 | |||
| e51a4b7702 | |||
| 702c1bc1ff | |||
| 6557e8af10 | |||
| edcebb03c0 | |||
| 9a3fc19992 | |||
| 7f9faa69c8 | |||
| 5b98c5f821 | |||
| 40bd8d0987 | |||
| 2aa6497374 | |||
| b9cb7b62fa | |||
| 04679beb52 | |||
| 64e9289afb | |||
| d4f24ee0cd | |||
| 3e5d939ea5 | |||
| 24f91e4aee | |||
| fe169fafaf | |||
| aeb6fad409 | |||
| 94ad758814 | |||
| 5f01e26377 | |||
| f82ac0ce9d | |||
| c8491765e9 | |||
| 53a3e11836 | |||
| fcccbe3252 | |||
| 584bf06109 | |||
| ef0083079e | |||
| 0d01e9bc78 | |||
| 89aef3d77b | |||
| 24c47b00d4 | |||
| a046a72392 | |||
| a5a530c9bd | |||
| 9cf82a3564 | |||
| 46cc37be62 | |||
| 1fbaf396aa | |||
| 76985501f5 | |||
| 8d8bcfba01 | |||
| e0f3957249 | |||
| 3f1b018808 | |||
| 7af5ab17b7 | |||
| 0fec35f0dc | |||
| ee81f49a75 | |||
| 807952201b | |||
| 5d6ba0f59e | |||
| 3a61b522ab | |||
| 83304023a6 | |||
| f62e13aaca |
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1,5 +1,3 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
patreon: InsanusMokrassar
|
custom: ['https://www.tinkoff.ru/rm/ovsyannikov.aleksey113/ObMJ712472']
|
||||||
|
|
||||||
custom: ['https://paypal.me/InsanusMokrassar?locale.x=ru_RU']
|
|
||||||
|
|||||||
8
.github/labeler.yml
vendored
8
.github/labeler.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
api: "TelegramBotAPI-extensions-api/**"
|
api: "TelegramBotAPI-api/**"
|
||||||
utils: "TelegramBotAPI-extensions-utils/**"
|
utils: "TelegramBotAPI-utils/**"
|
||||||
core: "TelegramBotAPI/**" # currently not work
|
behaviour-builder: "TelegramBotAPI-behaviour_builder/**"
|
||||||
|
behaviour-builder_fsm: "TelegramBotAPI-behaviour_builder-fsm/**"
|
||||||
|
core: "TelegramBotAPI-core/**" # currently not work
|
||||||
|
|
||||||
code: "**/*.kt"
|
code: "**/*.kt"
|
||||||
gradle: "**/*.gradle"
|
gradle: "**/*.gradle"
|
||||||
|
|||||||
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -1,12 +0,0 @@
|
|||||||
name: Build
|
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Build
|
|
||||||
run: ./gradlew build
|
|
||||||
2
.github/workflows/kdocs.yml
vendored
2
.github/workflows/kdocs.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 11
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew dokkaHtml
|
run: ./gradlew dokkaHtml
|
||||||
- name: Publish KDocs
|
- name: Publish KDocs
|
||||||
|
|||||||
1
.github/workflows/label.yml
vendored
1
.github/workflows/label.yml
vendored
@@ -12,6 +12,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor == github.repository_owner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v2
|
- uses: actions/labeler@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
7
.github/workflows/packages_publishing.yml
vendored
7
.github/workflows/packages_publishing.yml
vendored
@@ -7,15 +7,18 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 11
|
||||||
- name: Rewrite version
|
- name: Rewrite version
|
||||||
run: |
|
run: |
|
||||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||||
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
|
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
|
||||||
rm gradle.properties
|
rm gradle.properties
|
||||||
mv gradle.properties.tmp gradle.properties
|
mv gradle.properties.tmp gradle.properties
|
||||||
|
- name: Build
|
||||||
|
run: ./gradlew build
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication
|
continue-on-error: true
|
||||||
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
|
||||||
env:
|
env:
|
||||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
GITHUBPACKAGES_USER: ${{ github.actor }}
|
||||||
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,4 +10,5 @@ build/
|
|||||||
out/
|
out/
|
||||||
|
|
||||||
local.properties
|
local.properties
|
||||||
|
kotlin-js-store/
|
||||||
secret.gradle
|
secret.gradle
|
||||||
|
|||||||
336
CHANGELOG.md
336
CHANGELOG.md
@@ -1,5 +1,341 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 0.38.11
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.16` -> `0.9.17`
|
||||||
|
* `Klock`: `2.6.3` -> `2.7.0`
|
||||||
|
* `Core`:
|
||||||
|
* Fixes in `TextSourcesList` creating in from `RawMessageEntities`
|
||||||
|
* Old ways to create keyboards (`matrix` and `row`) have been deprecated
|
||||||
|
* `API`:
|
||||||
|
* Add ability to `reply` with `Poll`
|
||||||
|
* Add ability to `reply` with any `MessageContent`
|
||||||
|
* Add ability to `reply` with any `TelegramMediaFile`
|
||||||
|
|
||||||
|
## 0.38.10
|
||||||
|
|
||||||
|
* `API`:
|
||||||
|
* All `with*Action` extensions got a contracts which declare that `block` will be called once
|
||||||
|
* Add several extensions `TelegramBot#sendPhoto` with `PhotoSize`
|
||||||
|
* Add several extensions `TelegramBot#reply` with `PhotoSize`
|
||||||
|
|
||||||
|
## 0.38.9
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* New function `MessageContent.Companion#serializationModule`
|
||||||
|
* Now it is possible to create `TelegramBot` (`RequestsExecutor`) with several bots under the hood and opportunity
|
||||||
|
for bots requests load balancing or fault-fix via sending of the requests via another bot
|
||||||
|
* `API`:
|
||||||
|
* Add replies which will use another message as a source for reply (`copyMessage`)
|
||||||
|
|
||||||
|
## 0.38.8
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.12` -> `0.9.16`
|
||||||
|
* `Klock`: `2.6.2` -> `2.6.3`
|
||||||
|
* `Ktor`: `1.6.7` -> `1.6.8`
|
||||||
|
* `BehaviourBuilder`:
|
||||||
|
* Fixes in `onMediaGroup` and dependent functions
|
||||||
|
* Add several new extensions for `SimpleFilter`:
|
||||||
|
* `SimpleFilter#listAll`
|
||||||
|
* `SimpleFilter#listAny`
|
||||||
|
* `SimpleFilter#listNone`
|
||||||
|
|
||||||
|
## 0.38.7
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.9` -> `0.9.12`
|
||||||
|
* `Klock`: `2.5.2` -> `2.6.2`
|
||||||
|
* `Core`:
|
||||||
|
* `SimplePollOption#votes` now is `0` by default
|
||||||
|
* New function `PollOption.Companion#simple`
|
||||||
|
|
||||||
|
## 0.38.6
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.6` -> `0.9.9`
|
||||||
|
* `Klock`: `2.4.13` -> `2.5.2`
|
||||||
|
* `Core`:
|
||||||
|
* New member of `MentionTextSource` - `username`
|
||||||
|
|
||||||
|
## 0.38.5
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.5` -> `0.9.6`
|
||||||
|
* `Core`:
|
||||||
|
* `Username` got new property `usernameWithoutAt` which will return `username` without leading `@`
|
||||||
|
* `Utils`:
|
||||||
|
* Several new functions for working with deep links:
|
||||||
|
* `makeUsernameDeepLinkPrefix`
|
||||||
|
* `makeTelegramDeepLink`
|
||||||
|
* `makeDeepLink`
|
||||||
|
|
||||||
|
## 0.38.4
|
||||||
|
|
||||||
|
__This update contains including of [Telegram Bot API 5.7](https://core.telegram.org/bots/api-changelog#january-31-2022)__
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Support of new fields `Sticker`
|
||||||
|
* Support of new fields `StickerSet`
|
||||||
|
* Support of new fields in creating of sticker set and sticker
|
||||||
|
* `Utils`:
|
||||||
|
* Rename `PathedFile` to avoid clash with core file (fix of [#529](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/529))
|
||||||
|
|
||||||
|
## 0.38.3
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.1` -> `0.9.2`
|
||||||
|
* `Klock`: `2.4.10` -> `2.4.12`
|
||||||
|
* `UUID`: `0.3.1` -> `0.4.0`
|
||||||
|
* `API`
|
||||||
|
* New extensions `TelegramBot#send*` for media groups with contents
|
||||||
|
|
||||||
|
## 0.38.2
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.9.0` -> `0.9.1`
|
||||||
|
* `API`
|
||||||
|
* New extensions `TelegramBot#copyMessages` for media groups
|
||||||
|
|
||||||
|
## 0.38.1
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* `MessageCallbackQuery` (and all implementers as well) has changed the type of `message`: now it is `ContentMessage<MessageContent>` instead of `Message`
|
||||||
|
* New type `ForwardFromPublicChatInfo` as extender of `ForwardInfo`:
|
||||||
|
* `ForwardFromChannelInfo` now extends `ForwardFromPublicChatInfo`
|
||||||
|
* `ForwardFromSupergroupInfo` now extends `ForwardFromPublicChatInfo`
|
||||||
|
* New type of events: `UserLoggedIn`
|
||||||
|
* `Utils`:
|
||||||
|
* ([#511](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/511)) New extensions properties (raw fields as in original API) for several types have been added:
|
||||||
|
* `Message`
|
||||||
|
* `CallbackQuery`
|
||||||
|
* `ChosenInlineResult`
|
||||||
|
* `InlineQuery`
|
||||||
|
* `Poll`
|
||||||
|
|
||||||
|
## 0.38.0
|
||||||
|
|
||||||
|
_This update contains [Telegram Bot API 5.6](https://core.telegram.org/bots/api-changelog#december-30-2021) implementation_
|
||||||
|
|
||||||
|
_This update contains migration onto Kotlin 1.6_
|
||||||
|
|
||||||
|
_This update has changed constructors of all `CommonMessage` implementations_
|
||||||
|
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `1.5.31` -> `1.6.10`
|
||||||
|
* `Coroutines`: `1.5.2` -> `1.6.0`
|
||||||
|
* `Serialization`: `1.3.1` -> `1.3.2`
|
||||||
|
* `Klock`: `2.4.8` -> `2.4.10`
|
||||||
|
* `Ktor`: `1.6.5` -> `1.6.7`
|
||||||
|
* `MicroUtils`: `0.8.7` -> `0.9.0`
|
||||||
|
* `Core`:
|
||||||
|
* Add `SpoilerTextSource` (as part of `Telegram Bot API 5.6` update)
|
||||||
|
* Add support of `protect_content` as a field `protectContent` in all send message requests and parameter in all
|
||||||
|
functions related to that requests (as part of `Telegram Bot API 5.6` update)
|
||||||
|
* **ALL IMPLEMENTERS OF `CommonMessage` HAS CHANGED THEIR CONSTRUCTOR: NOW THEY GET `hasProtectedContent` instead of
|
||||||
|
`forwardable` (inversed) field**
|
||||||
|
* `ChannelContentMessageImpl`
|
||||||
|
* `ChannelMediaGroupMessage`
|
||||||
|
* `CommonMediaGroupMessage`
|
||||||
|
* `GroupContentMessage` implementers
|
||||||
|
* `ConnectedFromChannelGroupContentMessageImpl`
|
||||||
|
* `UnconnectedFromChannelGroupContentMessageImpl`
|
||||||
|
* `AnonymousGroupContentMessageImpl`
|
||||||
|
* `CommonGroupContentMessageImpl`
|
||||||
|
* `PrivateContentMessageImpl`
|
||||||
|
|
||||||
|
## 0.37.4
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.8.7` -> `0.8.9`
|
||||||
|
* `Core`:
|
||||||
|
* New `SupergroupEvent` subtype: `MigratedToSupergroup`. This event is sent when a group is converted to a supergroup while bot is in the group.
|
||||||
|
* Helper extenstion functions on `ChatEvent` to cast it to `MigratedToSupergroup`.
|
||||||
|
|
||||||
|
## 0.37.3 Hotfix of 0.37.2
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Fixes in hierarchy (and creating) of messages from channels
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
`0.37.2` changelog:
|
||||||
|
|
||||||
|
_This update contains [Telegram Bot API 5.5](https://core.telegram.org/bots/api-changelog#december-7-2021) implementation_
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.8.2` -> `0.8.7`
|
||||||
|
* `Core`:
|
||||||
|
* New request type: `ChatSenderRequest`
|
||||||
|
* New request `BanChatSenderChat`
|
||||||
|
* New request `UnbanChatSenderChat`
|
||||||
|
* `ExtendedPrivateChat` got new properties: `hasPrivateForwards` and `allowCreateUserIdLink` (same as `hasPrivateForwards`)
|
||||||
|
* All `ContentMessage` got field `forwardable` (old constructors marked as `Deprecated`)
|
||||||
|
* `FromChannelGroupContentMessage` has been divided for two interfaces (and corresponding classes):
|
||||||
|
* `ConnectedFromChannelGroupContentMessage` (and `ConnectedFromChannelGroupContentMessageImpl`) for connected to the group channels messages
|
||||||
|
* `UnconnectedFromChannelGroupContentMessage` (and `UnconnectedFromChannelGroupContentMessageImpl`) for unconnected channels
|
||||||
|
* `API`:
|
||||||
|
* New extensions `TelegramBot#banChatSenderChat`
|
||||||
|
* New extensions `TelegramBot#unbanChatSenderChat`
|
||||||
|
* `Utils`:
|
||||||
|
* Fix of `EntitiesBuilder#linkln`
|
||||||
|
|
||||||
|
## 0.37.2 Telegram Bot API 5.5
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.8.2` -> `0.8.7`
|
||||||
|
* `Core`:
|
||||||
|
* New request type: `ChatSenderRequest`
|
||||||
|
* New request `BanChatSenderChat`
|
||||||
|
* New request `UnbanChatSenderChat`
|
||||||
|
* `ExtendedPrivateChat` got new properties: `hasPrivateForwards` and `allowCreateUserIdLink` (same as `hasPrivateForwards`)
|
||||||
|
* All `ContentMessage` got field `forwardable` (old constructors marked as `Deprecated`)
|
||||||
|
* `ChannelContentMessage` has been divided for two interfaces (and corresponding classes):
|
||||||
|
* `ConnectedChannelContentMessage` (and `ConnectedChannelContentMessageImpl`) for connected to the group channels messages
|
||||||
|
* `UnconnectedChannelContentMessage` (and `UnconnectedChannelContentMessageImpl`) for unconnected channels
|
||||||
|
* `API`:
|
||||||
|
* New extensions `TelegramBot#banChatSenderChat`
|
||||||
|
* New extensions `TelegramBot#unbanChatSenderChat`
|
||||||
|
* `Utils`:
|
||||||
|
* Fix of `EntitiesBuilder#linkln`
|
||||||
|
|
||||||
|
## 0.37.1
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Serialization`: `1.3.0` -> `1.3.1`
|
||||||
|
* `Klock`: `2.4.7` -> `2.4.8`
|
||||||
|
* `MicroUtils`: `0.8.1` -> `0.8.2`
|
||||||
|
|
||||||
|
## 0.37.0 Telegram Bot API 5.4
|
||||||
|
|
||||||
|
**ALL DEPRECATIONS WERE REMOVED**
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Klock`: `2.4.6` -> `2.4.7`
|
||||||
|
* `Ktor`: `1.6.4` -> `1.6.5`
|
||||||
|
* `MicroUtils`: `0.7.3` -> `0.8.1`
|
||||||
|
* `Core`:
|
||||||
|
* Replacement of simple `CreateChatInviteLink` and `EditChatInviteLink` with several new:
|
||||||
|
* `CreateChatInviteLinkSimple`
|
||||||
|
* `CreateChatInviteLinkWithLimitedMembers`
|
||||||
|
* `CreateChatInviteLinkWithJoinRequest`
|
||||||
|
* `EditChatInviteLinkSimple`
|
||||||
|
* `EditChatInviteLinkWithLimitedMembers`
|
||||||
|
* `EditChatInviteLinkWithJoinRequest`
|
||||||
|
* New `BotAction`: `ChooseStickerAction`
|
||||||
|
* Now requester will throw exceptions related to responses decoding directly instead of wrapping in
|
||||||
|
`RequestException`
|
||||||
|
*
|
||||||
|
* `BehaviourBuilder FSM`:
|
||||||
|
* **Incompatible changes** (now generics are used in state machines)
|
||||||
|
* `strictlyOn` and `onStateOrSubstate` now are part of `BehaviourContextWithFSMBuilder`
|
||||||
|
|
||||||
|
## 0.36.1
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.7.2` -> `0.7.3`
|
||||||
|
* `API`:
|
||||||
|
* Fix `getMyCommands` overloads conflict when no arguments provided
|
||||||
|
* `Utils`:
|
||||||
|
* `buildEntities` DSL now have parameter `separator` to specify `TextSource` that will be inserted between other sources
|
||||||
|
|
||||||
|
## 0.36.0
|
||||||
|
|
||||||
|
**ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED**
|
||||||
|
**ALL EXTENSION PACKAGES HAS BEEN RENAMES**. Old packages are still available, but will be removed in next major update:
|
||||||
|
|
||||||
|
* `tgbotapi.extensions.api` -> `tgbotape.api`
|
||||||
|
* `tgbotapi.extensions.utils` -> `tgbotape.utils`
|
||||||
|
* `tgbotapi.extensions.behaviour_builder` -> `tgbotape.behaviour_builder`
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Serialization`: `1.2.2` -> `1.3.0`
|
||||||
|
* `MicroUtils`: `0.5.28` -> `0.7.2`
|
||||||
|
* `Klock`: `2.4.3` -> `2.4.6`
|
||||||
|
* `Ktor`: `1.6.3` -> `1.6.4`
|
||||||
|
* `Core`:
|
||||||
|
* `PrivateContentMessageImpl#paymentInfo` now is deprecated and will always be null
|
||||||
|
* `PayInlineKeyboardButton#pay` now is deprecated
|
||||||
|
* `RowBuilder` and `MatrixBuilder` now are open and available for extending
|
||||||
|
* `MatrixBuilder#matrix` will return read-only new list instead of original internal `mutMatrix`
|
||||||
|
* Introduced new type of events `SuccessfulPaymentEvent` instead of putting of payment inside of message
|
||||||
|
* New type of events union: `PublicChatEvent`. `CommonEvent` is still union of any `ChatEvent`
|
||||||
|
* New `AbstractFlowsUpdatesFilter` with default `lazy` realization for all typed flows
|
||||||
|
* `FlowsUpdatesFilter` fun now have `onBufferOverflow` and `upstreamUpdatesFlow` as incoming params
|
||||||
|
* `DefaultFlowsUpdatesFilter` now use additional `upstreamUpdatesFlow` as source of updates
|
||||||
|
* `Utils`:
|
||||||
|
* Two new dsl:
|
||||||
|
* `inlineKeyboard` for creating `InlineKeyboardMarkup`
|
||||||
|
* `replyKeyboard` for creating `ReplyKeyboardMarkup`
|
||||||
|
* Cast helpers for `Message` (thanks to [madhead](https://github.com/madhead)):
|
||||||
|
* `asPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage`, returns `null` if the message is not of that type
|
||||||
|
* `requirePossiblyReplyMessage`: casts a `Message` to `PossiblyReplyMessage`, fails if the message is not of that type
|
||||||
|
* `whenPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage` and runs the given block of code with it, if the cast is successful
|
||||||
|
* New type `WithUser` for unioning of all types with `user`
|
||||||
|
* `FromUser` now extends `WithUser`
|
||||||
|
* Cast helpers for type `WithUser`: `asWithUser`, `whenWithUser`, `requireWithUser`
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* New expecters and waiters:
|
||||||
|
* `waitShippingQueries`/`onShippingQuery`
|
||||||
|
* `waitPreCheckoutQueries`/`onPreCheckoutQuery`
|
||||||
|
* `waitChosenInlineResult`/`onChosenInlineResult`
|
||||||
|
* `waitPollUpdates`/`onPollUpdates`
|
||||||
|
* `Behaviour Builder FSM extension`:
|
||||||
|
* See [Difference between old Behaviour Builder and new one with FSM](https://telegra.ph/Difference-between-old-Behaviour-Builder-and-new-one-with-FSM-10-18)
|
||||||
|
|
||||||
|
## 0.35.9
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `1.5.30` -> `1.5.31`
|
||||||
|
* `Klock`: `2.4.1` -> `2.4.2`
|
||||||
|
* `MicroUtils`: `0.5.25` -> `0.5.28`
|
||||||
|
* `Core`:
|
||||||
|
* New `BotAction` implementation - `CustomBotAction`
|
||||||
|
* `LocationContent` has been divided to two different types: `LiveLocationContent` and `StaticLocationContent`
|
||||||
|
* `API`:
|
||||||
|
* Two new extensions: `TelegramBot#answer` with `CallbackQuery` and `InlineQuery`
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* All triggers have been changed to use two filters: filter for in subcontext data and filter for incoming data
|
||||||
|
* New waiters for edited content
|
||||||
|
* New extension `BehaviourContext#followLocation`
|
||||||
|
* New factory-functions:
|
||||||
|
* `BehaviourContextReceiver`
|
||||||
|
* `BehaviourContextAndTypeReceiver`
|
||||||
|
* `BehaviourContextAndTwoTypesReceiver`
|
||||||
|
* Old API for triggers with the flags like `includeFilterByChatInBehaviourSubContext` have been deprecated
|
||||||
|
|
||||||
|
## 0.35.8
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.5.24` -> `0.5.25`
|
||||||
|
* `UUID`: `0.3.0` -> `0.3.1`
|
||||||
|
* `Core`:
|
||||||
|
* `MultipartRequestCallFactory` now will use file name as multipart `filename` parameter instead of generated file id
|
||||||
|
* New extension `MPPFile#asMultipartFile`
|
||||||
|
* `API`
|
||||||
|
* Fixes in `TelegramBot#withAction`
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* New extensions `BehaviourContext#commandWithArgs` and `BehaviourContext#onCommandWithArgs`
|
||||||
|
|
||||||
## 0.35.7
|
## 0.35.7
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -1,27 +1,11 @@
|
|||||||
[Participate in our common survey ☺](https://forms.gle/q6Xf8K3fD1pPsYUw9)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#january-31-2022)
|
||||||
|
|
||||||
# TelegramBotAPI
|
| [](https://github.com/KotlinBy/awesome-kotlin) [](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) [](https://t.me/InMoTelegramBotAPI) |
|
||||||
|
|:---:|
|
||||||
- [TelegramBotAPI](#telegrambotapi)
|
| [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) [](https://tgbotapi.inmo.dev/index.html) [](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
||||||
* [Examples](#examples)
|
|
||||||
+ [Most common example](#most-common-example)
|
|
||||||
+ [Handling only last messages](#handling-only-last-messages)
|
|
||||||
+ [Build a little bit more complex behaviour](#build-a-little-bit-more-complex-behaviour)
|
|
||||||
+ [More examples](#more-examples)
|
|
||||||
|
|
||||||
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
|
|
||||||
|
|
||||||
Hello! This is a set of libraries for working with Telegram Bot API.
|
Hello! This is a set of libraries for working with Telegram Bot API.
|
||||||
|
|
||||||
| Common info | [](https://github.com/KotlinBy/awesome-kotlin) [](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [Small survey](https://forms.gle/2Hex2ynbHWHhi1KY7)|
|
|
||||||
| -------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| Useful links | [](https://t.me/InMoTelegramBotAPI) [](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [](https://tgbotapi.inmo.dev/index.html) [Examples](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/), [Mini tutorial](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|
|
||||||
| TelegramBotAPI Core status | [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.core) |
|
|
||||||
| TelegramBotAPI API Extensions status | [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api) |
|
|
||||||
| TelegramBotAPI Util Extensions status | [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.utils) |
|
|
||||||
| TelegramBotAPI Behaviour Builder Extensions status | [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.behaviour_builder) |
|
|
||||||
| TelegramBotAPI All status | [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) |
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
There are several things you need to do to launch examples below:
|
There are several things you need to do to launch examples below:
|
||||||
@@ -44,7 +28,7 @@ Other configuration examples:
|
|||||||
suspend fun main() {
|
suspend fun main() {
|
||||||
val bot = telegramBot(TOKEN)
|
val bot = telegramBot(TOKEN)
|
||||||
|
|
||||||
bot.buildBehaviour {
|
bot.buildBehaviourWithLongPolling {
|
||||||
println(getMe())
|
println(getMe())
|
||||||
|
|
||||||
onCommand("start") {
|
onCommand("start") {
|
||||||
@@ -85,7 +69,7 @@ and maybe some updates it got after launch)
|
|||||||
suspend fun main() {
|
suspend fun main() {
|
||||||
val bot = telegramBot(TOKEN)
|
val bot = telegramBot(TOKEN)
|
||||||
|
|
||||||
bot.buildBehaviour {
|
bot.buildBehaviourWithLongPolling {
|
||||||
println(getMe())
|
println(getMe())
|
||||||
|
|
||||||
val nameReplyMarkup = ReplyKeyboardMarkup(
|
val nameReplyMarkup = ReplyKeyboardMarkup(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,20 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20">
|
|
||||||
<linearGradient id="b" x2="0" y2="100%">
|
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
|
||||||
</linearGradient>
|
|
||||||
<clipPath id="a">
|
|
||||||
<rect width="104" height="20" rx="3" fill="#fff"/>
|
|
||||||
</clipPath>
|
|
||||||
<g clip-path="url(#a)">
|
|
||||||
<path fill="#555" d="M0 0h65v20H0z"/>
|
|
||||||
<path fill="#007ec6" d="M35 0h69v20H35z"/>
|
|
||||||
<path fill="url(#b)" d="M0 0h104v20H0z"/>
|
|
||||||
</g>
|
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
|
||||||
<text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Talk</text>
|
|
||||||
<text x="175" y="140" transform="scale(.1)">Talk</text>
|
|
||||||
<text x="690" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Telegram</text>
|
|
||||||
<text x="690" y="140" transform="scale(.1)">Telegram</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1018 B |
@@ -1,20 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20">
|
|
||||||
<linearGradient id="b" x2="0" y2="100%">
|
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
|
||||||
</linearGradient>
|
|
||||||
<clipPath id="a">
|
|
||||||
<rect width="104" height="20" rx="3" fill="#fff"/>
|
|
||||||
</clipPath>
|
|
||||||
<g clip-path="url(#a)">
|
|
||||||
<path fill="#555" d="M0 0h65v20H0z"/>
|
|
||||||
<path fill="#007ec6" d="M45 0h69v20H45z"/>
|
|
||||||
<path fill="url(#b)" d="M0 0h104v20H0z"/>
|
|
||||||
</g>
|
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
|
||||||
<text x="225" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Open</text>
|
|
||||||
<text x="225" y="140" transform="scale(.1)">Open</text>
|
|
||||||
<text x="740" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">KDocs</text>
|
|
||||||
<text x="740" y="140" transform="scale(.1)">KDocs</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1012 B |
@@ -1,20 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20">
|
|
||||||
<linearGradient id="b" x2="0" y2="100%">
|
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
|
||||||
</linearGradient>
|
|
||||||
<clipPath id="a">
|
|
||||||
<rect width="104" height="20" rx="3" fill="#fff"/>
|
|
||||||
</clipPath>
|
|
||||||
<g clip-path="url(#a)">
|
|
||||||
<path fill="#555" d="M0 0h65v20H0z"/>
|
|
||||||
<path fill="#007ec6" d="M35 0h69v20H35z"/>
|
|
||||||
<path fill="url(#b)" d="M0 0h104v20H0z"/>
|
|
||||||
</g>
|
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
|
||||||
<text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Bot</text>
|
|
||||||
<text x="175" y="140" transform="scale(.1)">Bot</text>
|
|
||||||
<text x="690" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Template</text>
|
|
||||||
<text x="690" y="140" transform="scale(.1)">Template</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1016 B |
@@ -1,7 +1,6 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://plugins.gradle.org/m2/" }
|
maven { url "https://plugins.gradle.org/m2/" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,12 +19,17 @@ plugins {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm {
|
||||||
|
compilations.main {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
js(IR) {
|
js(IR) {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
@@ -93,3 +97,8 @@ Object callback = {
|
|||||||
|
|
||||||
tasks.dokkaGfm(callback)
|
tasks.dokkaGfm(callback)
|
||||||
tasks.dokkaHtml(callback)
|
tasks.dokkaHtml(callback)
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
dokka_version=1.5.0
|
|
||||||
|
|
||||||
org.gradle.jvmargs=-Xmx1024m
|
org.gradle.jvmargs=-Xmx1024m
|
||||||
|
|||||||
@@ -5,18 +5,21 @@ kotlin.js.generate.externals=true
|
|||||||
kotlin.incremental=true
|
kotlin.incremental=true
|
||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
kotlin_version=1.5.30
|
kotlin_version=1.6.10
|
||||||
kotlin_coroutines_version=1.5.2
|
kotlin_coroutines_version=1.6.0
|
||||||
kotlin_serialisation_runtime_version=1.2.2
|
kotlin_serialisation_runtime_version=1.3.2
|
||||||
klock_version=2.4.1
|
klock_version=2.7.0
|
||||||
uuid_version=0.3.0
|
uuid_version=0.4.0
|
||||||
ktor_version=1.6.3
|
ktor_version=1.6.8
|
||||||
|
|
||||||
micro_utils_version=0.5.24
|
micro_utils_version=0.9.17
|
||||||
|
|
||||||
javax_activation_version=1.1.1
|
javax_activation_version=1.1.1
|
||||||
|
|
||||||
|
|
||||||
|
dokka_version=1.6.10
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=0.35.7
|
library_version=0.38.11
|
||||||
|
|
||||||
github_release_plugin_version=2.2.12
|
github_release_plugin_version=2.2.12
|
||||||
|
|||||||
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-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'signing'
|
|
||||||
|
|
||||||
task javadocsJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
classifier = 'javadoc'
|
classifier = 'javadoc'
|
||||||
@@ -10,8 +9,8 @@ publishing {
|
|||||||
artifact javadocsJar
|
artifact javadocsJar
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
description = "This project just include all subproject of TelegramBotAPI"
|
description = "${project.description}"
|
||||||
name = "Telegram Bot API"
|
name = "${project.name}"
|
||||||
url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI"
|
url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI"
|
||||||
|
|
||||||
scm {
|
scm {
|
||||||
@@ -62,8 +61,19 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||||
useGpgCmd()
|
apply plugin: 'signing'
|
||||||
sign publishing.publications
|
|
||||||
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
|
|
||||||
|
sign publishing.publications
|
||||||
|
}
|
||||||
|
|
||||||
|
task signAll {
|
||||||
|
tasks.withType(Sign).forEach {
|
||||||
|
dependsOn(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
1
publish.kpsb
Normal file
1
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/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||||
97
readmes/exceptions_handling.md
Normal file
97
readmes/exceptions_handling.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# Exceptions handling
|
||||||
|
|
||||||
|
Unfortunatelly, exceptions handling in this library is a bit difficult in some places, but that have at least two reasons: flexibility and usability.
|
||||||
|
|
||||||
|
## "In place" handling
|
||||||
|
|
||||||
|
In case you know, where exceptions are happening, you may use several tools for exceptions catching:
|
||||||
|
|
||||||
|
* Catching with result
|
||||||
|
* Catching with callback
|
||||||
|
|
||||||
|
### Catching with result
|
||||||
|
|
||||||
|
If you prefer to receive `Result` objects instead of some weird callbacks, you may use the next syntax:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
safelyWithResult {
|
||||||
|
// do something
|
||||||
|
}.onSuccess { // will be called if everything is right
|
||||||
|
// handle success
|
||||||
|
}.onFailure { // will be called if something went wrong
|
||||||
|
// handle error
|
||||||
|
it.printStackTrace()
|
||||||
|
}.getOrThrow() // will return value or throw exception
|
||||||
|
```
|
||||||
|
|
||||||
|
### Catching with callback
|
||||||
|
|
||||||
|
Also there is more simple (in some cases) way to handle exceptions with callbacks:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
safely(
|
||||||
|
{
|
||||||
|
// handle error
|
||||||
|
it.printStackTrace()
|
||||||
|
null // return value
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
// do something
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bonus: different types of handling
|
||||||
|
|
||||||
|
There are two types of handling:
|
||||||
|
|
||||||
|
* Just safely - when you are using something to obviously retrieve value or throw exception. When handling callback has been skipped, it will throw exception by default. For example:
|
||||||
|
```kotlin
|
||||||
|
safely(
|
||||||
|
{
|
||||||
|
it.printStackTrace()
|
||||||
|
"error"
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
error("Hi :)") // emulate exception throwing
|
||||||
|
"ok"
|
||||||
|
} // result will be with type String
|
||||||
|
```
|
||||||
|
* Safely without exceptions - almost the same as `safely`, but this type by default allow to return nullable value (when exception was thrown) instead of just throwing (as with `safely`):
|
||||||
|
```kotlin
|
||||||
|
safelyWithouExceptions {
|
||||||
|
// do something
|
||||||
|
} // will returns nullable result type
|
||||||
|
```
|
||||||
|
|
||||||
|
## Global exceptions handling
|
||||||
|
|
||||||
|
The most simple way to configure exceptions handling is to change `CoroutineContext` when you are creating your `CoroutineScope` for bot processing:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
val bot = telegramBot("TOKEN")
|
||||||
|
|
||||||
|
bot.buildBehaviour (
|
||||||
|
scope = scope,
|
||||||
|
defaultExceptionsHandler = {
|
||||||
|
it.printStackTrace()
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
val bot = telegramBotWithBehaviour (
|
||||||
|
"TOKEN",
|
||||||
|
scope = scope,
|
||||||
|
defaultExceptionsHandler = {
|
||||||
|
it.printStackTrace()
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Here we have used `ContextSafelyExceptionHandler` class. It will pass default handling of exceptions and will call the block in most cases when something inside of your bot logic has thrown exception.
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 16 KiB |
@@ -8,13 +8,17 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
jcenter()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include ":tgbotapi.core"
|
include ":tgbotapi.core"
|
||||||
|
include ":tgbotapi.api"
|
||||||
|
include ":tgbotapi.utils"
|
||||||
|
include ":tgbotapi.behaviour_builder"
|
||||||
|
include ":tgbotapi.behaviour_builder.fsm"
|
||||||
include ":tgbotapi.extensions.api"
|
include ":tgbotapi.extensions.api"
|
||||||
include ":tgbotapi.extensions.utils"
|
include ":tgbotapi.extensions.utils"
|
||||||
include ":tgbotapi.extensions.behaviour_builder"
|
include ":tgbotapi.extensions.behaviour_builder"
|
||||||
|
include ":tgbotapi.extensions.behaviour_builder.fsm"
|
||||||
include ":tgbotapi"
|
include ":tgbotapi"
|
||||||
include ":docs"
|
include ":docs"
|
||||||
|
|||||||
@@ -1,18 +1,6 @@
|
|||||||
# TelegramBotAPI extensions
|
# TelegramBotAPI API extensions
|
||||||
|
|
||||||
[](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api)
|
[](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api)
|
||||||
|
|
||||||
- [TelegramBotAPI extensions](#telegrambotapi-extensions)
|
|
||||||
* [What is it?](#what-is-it)
|
|
||||||
* [Compatibility](#compatibility)
|
|
||||||
* [How to implement library?](#how-to-implement-library)
|
|
||||||
+ [Maven](#maven)
|
|
||||||
+ [Gradle](#gradle)
|
|
||||||
* [Example of usage and comparison with `TelegramBotAPI`](#example-of-usage-and-comparison-with-telegrambotapi)
|
|
||||||
* [Updates](#updates)
|
|
||||||
+ [Alternative way](#alternative-way)
|
|
||||||
|
|
||||||
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
|
|
||||||
|
|
||||||
## What is it?
|
## What is it?
|
||||||
|
|
||||||
@@ -28,10 +16,9 @@ This library always compatible with original `tgbotapi.core` library version
|
|||||||
|
|
||||||
Common ways to implement this library are presented here. In some cases it will require additional steps
|
Common ways to implement this library are presented here. In some cases it will require additional steps
|
||||||
like inserting of additional libraries (like `kotlin stdlib`). In the examples will be used variable
|
like inserting of additional libraries (like `kotlin stdlib`). In the examples will be used variable
|
||||||
`telegrambotapi-extensions-api.version`, which must be set up by developer. Available versions are presented on
|
`telegrambotapi-extensions-api.version`, which must be set up by developer.
|
||||||
[bintray](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api), next version is last published:
|
|
||||||
|
|
||||||
[ ](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/_latestVersion)
|
[](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api)
|
||||||
|
|
||||||
### Maven
|
### Maven
|
||||||
|
|
||||||
@@ -40,7 +27,7 @@ Dependency config presented here:
|
|||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.inmo</groupId>
|
<groupId>dev.inmo</groupId>
|
||||||
<artifactId>tgbotapi.extensions.api</artifactId>
|
<artifactId>tgbotapi.api</artifactId>
|
||||||
<version>${telegrambotapi-extensions-api.version}</version>
|
<version>${telegrambotapi-extensions-api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
@@ -49,18 +36,18 @@ Dependency config presented here:
|
|||||||
|
|
||||||
To use last versions you will need to add one line in repositories block of your `build.gradle`:
|
To use last versions you will need to add one line in repositories block of your `build.gradle`:
|
||||||
|
|
||||||
`jcenter()` or `mavenCentral()`
|
`mavenCentral()`
|
||||||
|
|
||||||
And add next line to your dependencies block:
|
And add next line to your dependencies block:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation "dev.inmo:tgbotapi.extensions.api:$telegrambotapi_extensions_api_version"
|
implementation "dev.inmo:tgbotapi.api:$telegrambotapi_extensions_api_version"
|
||||||
```
|
```
|
||||||
|
|
||||||
or for old gradle:
|
or for old gradle:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
compile "dev.inmo:tgbotapi.extensions.api:$telegrambotapi_extensions_api_version"
|
compile "dev.inmo:tgbotapi.api:$telegrambotapi_extensions_api_version"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example of usage and comparison with `TelegramBotAPI`
|
## Example of usage and comparison with `TelegramBotAPI`
|
||||||
@@ -82,7 +69,7 @@ val bot = telegramBot("IT IS YOUR TOKEN") {
|
|||||||
|
|
||||||
In all examples supposed that you have created bot.
|
In all examples supposed that you have created bot.
|
||||||
|
|
||||||
| tgbotapi.core | tgbotapi.extensions.api |
|
| tgbotapi.core | tgbotapi.api |
|
||||||
|---------------------|-------------------------------|
|
|---------------------|-------------------------------|
|
||||||
| bot.execute(GetMe) | bot.getMe() |
|
| bot.execute(GetMe) | bot.getMe() |
|
||||||
| bot.execute(SendTextMessage(someChatId, text)) | bot.sendTextMessage(chat, text) |
|
| bot.execute(SendTextMessage(someChatId, text)) | bot.sendTextMessage(chat, text) |
|
||||||
@@ -90,8 +77,8 @@ In all examples supposed that you have created bot.
|
|||||||
## Updates
|
## Updates
|
||||||
|
|
||||||
**Currently, these paragraphs almost outdated due to the fact that extensions for listening of updates and webhooks were
|
**Currently, these paragraphs almost outdated due to the fact that extensions for listening of updates and webhooks were
|
||||||
replaced into `tgbotapi.extensions.utils`. But, most part of information below is correct with small fixes and
|
replaced into `tgbotapi.utils`. But, most part of information below is correct with small fixes and
|
||||||
adding of `tgbotapi.extensions.utils` dependency.**
|
adding of `tgbotapi.utils` dependency.**
|
||||||
|
|
||||||
Usually, it is more comfortable to use filter object to get separated types of updates:
|
Usually, it is more comfortable to use filter object to get separated types of updates:
|
||||||
|
|
||||||
56
tgbotapi.api/build.gradle
Normal file
56
tgbotapi.api/build.gradle
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "org.jetbrains.kotlin.multiplatform"
|
||||||
|
id "org.jetbrains.kotlin.plugin.serialization"
|
||||||
|
}
|
||||||
|
|
||||||
|
project.version = "$library_version"
|
||||||
|
project.group = "$library_group"
|
||||||
|
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
|
||||||
|
|
||||||
|
apply from: "../publish.gradle"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm {
|
||||||
|
compilations.main {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
js(IR) {
|
||||||
|
browser()
|
||||||
|
nodejs()
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('stdlib')
|
||||||
|
api project(":tgbotapi.core")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
@@ -11,40 +11,46 @@ suspend fun TelegramBot.forwardMessage(
|
|||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
ForwardMessage(fromChatId, toChatId, messageId, disableNotification)
|
ForwardMessage(fromChatId, toChatId, messageId, disableNotification, protectContent)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification)
|
protectContent: Boolean = false
|
||||||
|
) = forwardMessage(fromChat.id, toChatId, messageId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification)
|
protectContent: Boolean = false
|
||||||
|
) = forwardMessage(fromChatId, toChat.id, messageId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification)
|
protectContent: Boolean = false
|
||||||
|
) = forwardMessage(fromChat.id, toChat.id, messageId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: Message,
|
message: Message,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification)
|
protectContent: Boolean = false
|
||||||
|
) = forwardMessage(message.chat, toChatId, message.messageId, disableNotification, protectContent)
|
||||||
|
|
||||||
suspend fun TelegramBot.forwardMessage(
|
suspend fun TelegramBot.forwardMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
disableNotification: Boolean = false
|
disableNotification: Boolean = false,
|
||||||
) = forwardMessage(message.chat, toChat, message.messageId, disableNotification)
|
protectContent: Boolean = false
|
||||||
|
) = forwardMessage(message.chat, toChat, message.messageId, disableNotification, protectContent)
|
||||||
@@ -48,6 +48,10 @@ class LiveLocationProvider internal constructor(
|
|||||||
val lastLocation: LiveLocation
|
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]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun updateLocation(
|
suspend fun updateLocation(
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -73,6 +77,10 @@ class LiveLocationProvider internal constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -83,6 +91,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
@@ -98,6 +107,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -112,6 +122,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
@@ -122,6 +136,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
@@ -135,11 +150,16 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
@@ -149,6 +169,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
@@ -162,11 +183,16 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.startLiveLocation(
|
suspend fun TelegramBot.startLiveLocation(
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
@@ -176,6 +202,7 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
@@ -189,11 +216,16 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: Message,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
@@ -204,6 +236,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -216,11 +249,16 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithLiveLocation(
|
suspend inline fun TelegramBot.replyWithLiveLocation(
|
||||||
to: Message,
|
to: Message,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
@@ -230,6 +268,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading: Degrees? = null,
|
initHeading: Degrees? = null,
|
||||||
initProximityAlertRadius: Meters? = null,
|
initProximityAlertRadius: Meters? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = startLiveLocation(
|
) = startLiveLocation(
|
||||||
@@ -241,6 +280,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
initHeading,
|
initHeading,
|
||||||
initProximityAlertRadius,
|
initProximityAlertRadius,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -7,6 +7,10 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -15,18 +19,30 @@ suspend fun TelegramBot.stopPoll(
|
|||||||
StopPoll(chatId, messageId, replyMarkup)
|
StopPoll(chatId, messageId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chat.id, messageId, replyMarkup)
|
) = stopPoll(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chatId: ChatId,
|
chatId: ChatId,
|
||||||
message: Message,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopPoll(chatId, message.messageId, replyMarkup)
|
) = stopPoll(chatId, message.messageId, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopPoll(
|
suspend fun TelegramBot.stopPoll(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
@@ -20,3 +20,11 @@ suspend fun TelegramBot.answerCallbackQuery(
|
|||||||
url: String? = null,
|
url: String? = null,
|
||||||
cachedTimeSeconds: Int? = null
|
cachedTimeSeconds: Int? = null
|
||||||
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.answer(
|
||||||
|
callbackQuery: CallbackQuery,
|
||||||
|
text: String? = null,
|
||||||
|
showAlert: Boolean? = null,
|
||||||
|
url: String? = null,
|
||||||
|
cachedTimeSeconds: Int? = null
|
||||||
|
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
|
||||||
@@ -27,3 +27,13 @@ suspend fun TelegramBot.answerInlineQuery(
|
|||||||
switchPmText: String? = null,
|
switchPmText: String? = null,
|
||||||
switchPmParameter: String? = null
|
switchPmParameter: String? = null
|
||||||
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.answer(
|
||||||
|
inlineQuery: InlineQuery,
|
||||||
|
results: List<InlineQueryResult> = emptyList(),
|
||||||
|
cachedTime: Int? = null,
|
||||||
|
isPersonal: Boolean? = null,
|
||||||
|
nextOffset: String? = null,
|
||||||
|
switchPmText: String? = null,
|
||||||
|
switchPmParameter: String? = null
|
||||||
|
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
|
||||||
@@ -13,5 +13,5 @@ suspend fun TelegramBot.getMyCommands(
|
|||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: String?
|
||||||
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
@@ -12,13 +12,3 @@ suspend fun TelegramBot.getChatMemberCount(
|
|||||||
suspend fun TelegramBot.getChatMemberCount(
|
suspend fun TelegramBot.getChatMemberCount(
|
||||||
chat: PublicChat
|
chat: PublicChat
|
||||||
) = getChatMemberCount(chat.id)
|
) = getChatMemberCount(chat.id)
|
||||||
|
|
||||||
@Deprecated("Renamed", ReplaceWith("getChatMemberCount", "dev.inmo.tgbotapi.extensions.api.chat.get.getChatMemberCount"))
|
|
||||||
suspend fun TelegramBot.getChatMembersCount(
|
|
||||||
chatId: ChatIdentifier
|
|
||||||
) = getChatMemberCount(chatId)
|
|
||||||
|
|
||||||
@Deprecated("Renamed", ReplaceWith("getChatMemberCount", "dev.inmo.tgbotapi.extensions.api.chat.get.getChatMemberCount"))
|
|
||||||
suspend fun TelegramBot.getChatMembersCount(
|
|
||||||
chat: PublicChat
|
|
||||||
) = getChatMemberCount(chat)
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
userId: UserId
|
||||||
|
) = execute(ApproveChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
userId: UserId
|
||||||
|
) = approveChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
user: User
|
||||||
|
) = approveChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
user: User
|
||||||
|
) = approveChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chatJoinRequest: ChatJoinRequest
|
||||||
|
) = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approve(
|
||||||
|
chatJoinRequest: ChatJoinRequest
|
||||||
|
) = approveChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.approveChatJoinRequest(
|
||||||
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
|
) = approveChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = createChatInviteLinkUnlimited(chat.id, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null
|
||||||
|
) = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.invite_links.DeclineChatJoinRequest
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
userId: UserId
|
||||||
|
) = execute(DeclineChatJoinRequest(chatId, userId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
userId: UserId
|
||||||
|
) = declineChatJoinRequest(chat.id, userId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
user: User
|
||||||
|
) = declineChatJoinRequest(chatId, user.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
user: User
|
||||||
|
) = declineChatJoinRequest(chat.id, user.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chatJoinRequest: ChatJoinRequest
|
||||||
|
) = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.decline(
|
||||||
|
chatJoinRequest: ChatJoinRequest
|
||||||
|
) = declineChatJoinRequest(chatJoinRequest)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.declineChatJoinRequest(
|
||||||
|
chatJoinRequestUpdate: ChatJoinRequestUpdate
|
||||||
|
) = declineChatJoinRequest(chatJoinRequestUpdate.data)
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: String,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: String,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
membersLimit: MembersLimit,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
name: String? = null,
|
||||||
|
expiration: TelegramDate? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
||||||
|
|
||||||
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
||||||
|
chat: PublicChat,
|
||||||
|
previousLink: ChatInviteLink,
|
||||||
|
expiration: DateTime,
|
||||||
|
name: String? = null,
|
||||||
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatMember(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
userId: UserId,
|
||||||
|
untilDate: TelegramDate? = null,
|
||||||
|
revokeMessages: Boolean? = null
|
||||||
|
) = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatMember(
|
||||||
|
chat: PublicChat,
|
||||||
|
userId: UserId,
|
||||||
|
untilDate: TelegramDate? = null,
|
||||||
|
revokeMessages: Boolean? = null
|
||||||
|
) = banChatMember(chat.id, userId, untilDate, revokeMessages)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatMember(
|
||||||
|
chatId: ChatId,
|
||||||
|
user: User,
|
||||||
|
untilDate: TelegramDate? = null,
|
||||||
|
revokeMessages: Boolean? = null
|
||||||
|
) = banChatMember(chatId, user.id, untilDate, revokeMessages)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatMember(
|
||||||
|
chat: PublicChat,
|
||||||
|
user: User,
|
||||||
|
untilDate: TelegramDate? = null,
|
||||||
|
revokeMessages: Boolean? = null
|
||||||
|
) = banChatMember(chat.id, user.id, untilDate, revokeMessages)
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
senderChatId: ChatId
|
||||||
|
) = execute(BanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
|
chat: PublicChat,
|
||||||
|
senderChatId: ChatId
|
||||||
|
) = banChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
|
chatId: ChatId,
|
||||||
|
senderChat: PublicChat
|
||||||
|
) = banChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.banChatSenderChat(
|
||||||
|
chat: PublicChat,
|
||||||
|
senderChat: PublicChat,
|
||||||
|
) = banChatSenderChat(chat.id, senderChat)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.chat.members.*
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
senderChatId: ChatId
|
||||||
|
) = execute(UnbanChatSenderChat(chatId, senderChatId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
|
chat: PublicChat,
|
||||||
|
senderChatId: ChatId
|
||||||
|
) = unbanChatSenderChat(chat.id, senderChatId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
|
chatId: ChatId,
|
||||||
|
senderChat: PublicChat
|
||||||
|
) = unbanChatSenderChat(chatId, senderChat.id)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.unbanChatSenderChat(
|
||||||
|
chat: PublicChat,
|
||||||
|
senderChat: PublicChat,
|
||||||
|
) = unbanChatSenderChat(chat.id, senderChat)
|
||||||
@@ -9,6 +9,10 @@ import dev.inmo.tgbotapi.types.location.LiveLocation
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -24,6 +28,10 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -35,6 +43,10 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -45,6 +57,10 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -56,6 +72,10 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -63,6 +83,10 @@ suspend fun TelegramBot.editLiveLocation(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editLiveLocation(
|
suspend fun TelegramBot.editLiveLocation(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
location: LiveLocation,
|
location: LiveLocation,
|
||||||
@@ -9,6 +9,10 @@ import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -19,12 +23,20 @@ suspend fun TelegramBot.stopLiveLocation(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = stopLiveLocation(chat.id, messageId, replyMarkup)
|
) = stopLiveLocation(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
message: ContentMessage<LocationContent>,
|
message: ContentMessage<LocationContent>,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -5,6 +5,10 @@ import dev.inmo.tgbotapi.requests.edit.LiveLocation.StopInlineMessageLiveLocatio
|
|||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.stopLiveLocation(
|
suspend fun TelegramBot.stopLiveLocation(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -8,6 +8,10 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -16,12 +20,20 @@ suspend fun TelegramBot.editMessageReplyMarkup(
|
|||||||
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup)
|
EditChatMessageReplyMarkup(chatId, messageId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup)
|
) = editMessageReplyMarkup(chat.id, messageId, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
message: Message,
|
message: Message,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -5,6 +5,10 @@ import dev.inmo.tgbotapi.requests.edit.ReplyMarkup.EditInlineMessageReplyMarkup
|
|||||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageReplyMarkup(
|
suspend fun TelegramBot.editMessageReplyMarkup(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
@@ -13,6 +13,10 @@ import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -23,6 +27,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -31,6 +39,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
text: String,
|
text: String,
|
||||||
@@ -40,6 +52,10 @@ suspend fun <T> TelegramBot.editMessageCaption(
|
|||||||
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup)
|
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -49,6 +65,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
|
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -56,6 +76,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun <T> TelegramBot.editMessageCaption(
|
suspend fun <T> TelegramBot.editMessageCaption(
|
||||||
message: ContentMessage<T>,
|
message: ContentMessage<T>,
|
||||||
entities: List<TextSource>,
|
entities: List<TextSource>,
|
||||||
@@ -7,6 +7,10 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
|||||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
@@ -14,6 +18,10 @@ suspend fun TelegramBot.editMessageCaption(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup))
|
) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
@@ -10,6 +10,10 @@ import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -19,6 +23,10 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
EditChatMessageMedia(chatId, messageId, media, replyMarkup)
|
EditChatMessageMedia(chatId, messageId, media, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -26,6 +34,10 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageMedia(chat.id, messageId, media, replyMarkup)
|
) = editMessageMedia(chat.id, messageId, media, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageMedia(
|
suspend fun TelegramBot.editMessageMedia(
|
||||||
message: ContentMessage<out MediaContent>,
|
message: ContentMessage<out MediaContent>,
|
||||||
media: InputMedia,
|
media: InputMedia,
|
||||||
@@ -6,6 +6,10 @@ import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
|||||||
import dev.inmo.tgbotapi.types.InputMedia.InputMedia
|
import dev.inmo.tgbotapi.types.InputMedia.InputMedia
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
suspend fun TelegramBot.editMessageCaption(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
media: InputMedia,
|
media: InputMedia,
|
||||||
@@ -11,6 +11,10 @@ import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -22,6 +26,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
EditChatMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -31,6 +39,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
) = editMessageText(chat.id, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
text: String,
|
text: String,
|
||||||
@@ -39,6 +51,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
) = editMessageText(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -49,6 +65,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
EditChatMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
@@ -57,6 +77,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
) = editMessageText(chat.id, messageId, entities, disableWebPagePreview, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
message: ContentMessage<TextContent>,
|
message: ContentMessage<TextContent>,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
@@ -7,6 +7,10 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
|||||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
text: String,
|
text: String,
|
||||||
@@ -15,6 +19,10 @@ suspend fun TelegramBot.editMessageText(
|
|||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, disableWebPagePreview, replyMarkup))
|
) = execute(EditInlineMessageText(inlineMessageId, text, parseMode, disableWebPagePreview, replyMarkup))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.editMessageText(
|
suspend fun TelegramBot.editMessageText(
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
inlineMessageId: InlineMessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
@@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.files
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.get.getFileAdditionalInfo
|
import dev.inmo.tgbotapi.extensions.api.get.getFileAdditionalInfo
|
||||||
import dev.inmo.tgbotapi.requests.DownloadFileStream
|
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
import dev.inmo.tgbotapi.types.files.PathedFile
|
import dev.inmo.tgbotapi.types.files.PathedFile
|
||||||
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
||||||
@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.get
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
import dev.inmo.tgbotapi.requests.get.GetStickerSet
|
||||||
import dev.inmo.tgbotapi.types.files.Sticker
|
import dev.inmo.tgbotapi.types.files.sticker.Sticker
|
||||||
|
|
||||||
suspend fun TelegramBot.getStickerSet(
|
suspend fun TelegramBot.getStickerSet(
|
||||||
name: String
|
name: String
|
||||||
@@ -10,6 +10,10 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|||||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
@@ -17,13 +21,18 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(fromChatId, toChatId, messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
CopyMessage(fromChatId, toChatId, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
@@ -31,11 +40,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, toChatId, messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, toChatId, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
@@ -43,11 +57,16 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, toChat.id, messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
@@ -55,96 +74,137 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, toChat.id, messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: Message,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, toChatId, message.messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, toChatId, message.messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, toChat, message.messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, toChat, message.messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
CopyMessage(fromChatId, toChatId, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
CopyMessage(fromChatId, toChatId, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChatId: ChatIdentifier,
|
fromChatId: ChatIdentifier,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
fromChat: Chat,
|
fromChat: Chat,
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
messageId: MessageIdentifier,
|
messageId: MessageIdentifier,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, toChat.id, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChatId: ChatIdentifier,
|
toChatId: ChatIdentifier,
|
||||||
message: Message,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, toChatId, message.messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, toChatId, message.messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.copyMessage(
|
suspend inline fun TelegramBot.copyMessage(
|
||||||
toChat: Chat,
|
toChat: Chat,
|
||||||
message: Message,
|
message: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(message.chat, toChat, message.messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, toChat, message.messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.send.media.sendMediaGroup
|
||||||
|
import dev.inmo.tgbotapi.requests.send.CopyMessage
|
||||||
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.InputMedia.*
|
||||||
|
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||||
|
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||||
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||||
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||||
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent
|
||||||
|
import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.MediaGroupUpdate
|
||||||
|
import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.SentMediaGroupUpdate
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
): List<MediaGroupMessage<MediaGroupContent>> {
|
||||||
|
val first = messages.first().content.toMediaGroupMemberInputMedia().let {
|
||||||
|
if (text != null) {
|
||||||
|
when (it) {
|
||||||
|
is InputMediaAudio -> it.copy(text = text, parseMode = parseMode)
|
||||||
|
is InputMediaDocument -> it.copy(text = text, parseMode = parseMode)
|
||||||
|
is InputMediaPhoto -> it.copy(text = text, parseMode = parseMode)
|
||||||
|
is InputMediaVideo -> it.copy(text = text, parseMode = parseMode)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sendMediaGroup(
|
||||||
|
toChatId,
|
||||||
|
listOf(first) + messages.drop(1).map {
|
||||||
|
it.content.toMediaGroupMemberInputMedia()
|
||||||
|
},
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: Chat,
|
||||||
|
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat.id, messages, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: ChatIdentifier,
|
||||||
|
update: SentMediaGroupUpdate,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat, update.data, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: Chat,
|
||||||
|
update: SentMediaGroupUpdate,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat.id, update, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChatId: ChatIdentifier,
|
||||||
|
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
): List<MediaGroupMessage<MediaGroupContent>> {
|
||||||
|
val first = messages.first().content.toMediaGroupMemberInputMedia().let {
|
||||||
|
when (it) {
|
||||||
|
is InputMediaAudio -> InputMediaAudio(it.file, entities, it.duration, it.performer, it.title, it.thumb)
|
||||||
|
is InputMediaDocument -> InputMediaDocument(it.file, entities, it.thumb, it.disableContentTypeDetection)
|
||||||
|
is InputMediaPhoto -> InputMediaPhoto(it.file, entities)
|
||||||
|
is InputMediaVideo -> InputMediaVideo(it.file, entities, it.width, it.height, it.duration, it.thumb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sendMediaGroup(
|
||||||
|
toChatId,
|
||||||
|
listOf(first) + messages.drop(1).map {
|
||||||
|
it.content.toMediaGroupMemberInputMedia()
|
||||||
|
},
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
replyToMessageId,
|
||||||
|
allowSendingWithoutReply
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: Chat,
|
||||||
|
messages: List<MediaGroupMessage<MediaGroupContent>>,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat.id, messages, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: ChatIdentifier,
|
||||||
|
update: SentMediaGroupUpdate,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat, update.data, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send media group via [sendMediaGroup] extension with edited [entities] of first [messages] element. Other elements
|
||||||
|
* will be copied as they are
|
||||||
|
*/
|
||||||
|
suspend inline fun TelegramBot.copyMessages(
|
||||||
|
toChat: Chat,
|
||||||
|
update: SentMediaGroupUpdate,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
|
allowSendingWithoutReply: Boolean? = null
|
||||||
|
) = copyMessages(toChat.id, update, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply)
|
||||||
@@ -14,11 +14,17 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
|||||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||||
import dev.inmo.tgbotapi.types.files.*
|
import dev.inmo.tgbotapi.types.files.*
|
||||||
|
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
||||||
|
import dev.inmo.tgbotapi.types.files.sticker.Sticker
|
||||||
import dev.inmo.tgbotapi.types.games.Game
|
import dev.inmo.tgbotapi.types.games.Game
|
||||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.*
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent
|
||||||
|
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
@@ -28,12 +34,17 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
|||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
phoneNumber: String,
|
phoneNumber: String,
|
||||||
firstName: String,
|
firstName: String,
|
||||||
lastName: String? = null,
|
lastName: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
@@ -42,21 +53,28 @@ suspend inline fun TelegramBot.reply(
|
|||||||
firstName,
|
firstName,
|
||||||
lastName,
|
lastName,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendContact(
|
) = sendContact(
|
||||||
to.chat,
|
to.chat,
|
||||||
contact,
|
contact,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -65,49 +83,75 @@ suspend inline fun TelegramBot.reply(
|
|||||||
|
|
||||||
// Dice
|
// Dice
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.replyWithDice(
|
suspend inline fun TelegramBot.replyWithDice(
|
||||||
to: Message,
|
to: Message,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(to.chat, animationType, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(to.chat, animationType, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
animationType: DiceAnimationType,
|
animationType: DiceAnimationType,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = replyWithDice(to, animationType, disableNotification, allowSendingWithoutReply, replyMarkup)
|
) = replyWithDice(to, animationType, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
longitude: Double,
|
longitude: Double,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
to.chat,
|
to.chat,
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
allowSendingWithoutReply,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(
|
) = sendLocation(
|
||||||
to.chat,
|
to.chat,
|
||||||
location,
|
location,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
allowSendingWithoutReply,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
@@ -115,12 +159,17 @@ suspend inline fun TelegramBot.reply(
|
|||||||
|
|
||||||
// Text message
|
// Text message
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
text: String,
|
text: String,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(
|
) = sendTextMessage(
|
||||||
@@ -129,16 +178,22 @@ suspend inline fun TelegramBot.reply(
|
|||||||
parseMode,
|
parseMode,
|
||||||
disableWebPagePreview,
|
disableWebPagePreview,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableWebPagePreview: Boolean? = null,
|
disableWebPagePreview: Boolean? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendTextMessage(
|
) = sendTextMessage(
|
||||||
@@ -146,6 +201,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
entities,
|
entities,
|
||||||
disableWebPagePreview,
|
disableWebPagePreview,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -154,6 +210,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
|
|
||||||
// Venue
|
// Venue
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -165,6 +225,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -178,6 +239,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
@@ -193,6 +255,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
googlePlaceId: GooglePlaceId? = null,
|
googlePlaceId: GooglePlaceId? = null,
|
||||||
googlePlaceType: GooglePlaceType? = null,
|
googlePlaceType: GooglePlaceType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
@@ -206,6 +269,7 @@ suspend inline fun TelegramBot.reply(
|
|||||||
googlePlaceId = googlePlaceId,
|
googlePlaceId = googlePlaceId,
|
||||||
googlePlaceType = googlePlaceType,
|
googlePlaceType = googlePlaceType,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
@@ -215,12 +279,14 @@ suspend inline fun TelegramBot.reply(
|
|||||||
to: Message,
|
to: Message,
|
||||||
venue: Venue,
|
venue: Venue,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVenue(
|
) = sendVenue(
|
||||||
chat = to.chat,
|
chat = to.chat,
|
||||||
venue = venue,
|
venue = venue,
|
||||||
disableNotification = disableNotification,
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
replyToMessageId = to.messageId,
|
replyToMessageId = to.messageId,
|
||||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
replyMarkup = replyMarkup
|
replyMarkup = replyMarkup
|
||||||
@@ -233,29 +299,32 @@ suspend inline fun TelegramBot.replyWithGame(
|
|||||||
to: Message,
|
to: Message,
|
||||||
gameShortName: String,
|
gameShortName: String,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
to.chat, gameShortName, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup
|
to.chat, gameShortName, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithGame(
|
suspend inline fun TelegramBot.replyWithGame(
|
||||||
to: Message,
|
to: Message,
|
||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendGame(
|
) = sendGame(
|
||||||
to.chat, game.title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup
|
to.chat, game.title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
game: Game,
|
game: Game,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = replyWithGame(to, game, disableNotification, allowSendingWithoutReply, replyMarkup)
|
) = replyWithGame(to, game, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
@@ -270,6 +339,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
@@ -282,6 +352,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -296,9 +367,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(to.chat, animation, text, parseMode, duration, width, height, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(to.chat, animation, text, parseMode, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithAnimation(
|
suspend inline fun TelegramBot.replyWithAnimation(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -309,6 +381,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
@@ -320,6 +393,7 @@ suspend inline fun TelegramBot.replyWithAnimation(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
to.messageId,
|
to.messageId,
|
||||||
allowSendingWithoutReply,
|
allowSendingWithoutReply,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -333,9 +407,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(to.chat, animation, entities, duration, width, height, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAnimation(to.chat, animation, entities, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
@@ -350,9 +425,10 @@ suspend inline fun TelegramBot.replyWithAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -361,9 +437,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, text, parseMode, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, text, parseMode, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithAudio(
|
suspend inline fun TelegramBot.replyWithAudio(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -374,9 +451,10 @@ suspend inline fun TelegramBot.replyWithAudio(
|
|||||||
performer: String? = null,
|
performer: String? = null,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -384,9 +462,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(to.chat, audio, entities, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(to.chat, audio, entities, title, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Documents
|
// Documents
|
||||||
@@ -398,10 +477,11 @@ suspend inline fun TelegramBot.replyWithDocument(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, thumb, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, thumb, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -409,10 +489,11 @@ suspend inline fun TelegramBot.reply(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithDocument(
|
suspend inline fun TelegramBot.replyWithDocument(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -420,20 +501,22 @@ suspend inline fun TelegramBot.replyWithDocument(
|
|||||||
thumb: InputFile? = null,
|
thumb: InputFile? = null,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, thumb, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, thumb, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
document: DocumentFile,
|
document: DocumentFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(to.chat, document, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
) = sendDocument(to.chat, document, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection)
|
||||||
|
|
||||||
|
|
||||||
// Media Group
|
// Media Group
|
||||||
@@ -443,29 +526,33 @@ suspend inline fun TelegramBot.replyWithMediaGroup(
|
|||||||
to: Message,
|
to: Message,
|
||||||
media: List<MediaGroupMemberInputMedia>,
|
media: List<MediaGroupMemberInputMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendMediaGroup(to.chat, media, disableNotification, to.messageId, allowSendingWithoutReply)
|
) = sendMediaGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithPlaylist(
|
suspend inline fun TelegramBot.replyWithPlaylist(
|
||||||
to: Message,
|
to: Message,
|
||||||
media: List<AudioMediaGroupMemberInputMedia>,
|
media: List<AudioMediaGroupMemberInputMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendPlaylist(to.chat, media, disableNotification, to.messageId, allowSendingWithoutReply)
|
) = sendPlaylist(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithDocuments(
|
suspend inline fun TelegramBot.replyWithDocuments(
|
||||||
to: Message,
|
to: Message,
|
||||||
media: List<DocumentMediaGroupMemberInputMedia>,
|
media: List<DocumentMediaGroupMemberInputMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendDocumentsGroup(to.chat, media, disableNotification, to.messageId, allowSendingWithoutReply)
|
) = sendDocumentsGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithGallery(
|
suspend inline fun TelegramBot.replyWithGallery(
|
||||||
to: Message,
|
to: Message,
|
||||||
media: List<VisualMediaGroupMemberInputMedia>,
|
media: List<VisualMediaGroupMemberInputMedia>,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null
|
allowSendingWithoutReply: Boolean? = null
|
||||||
) = sendVisualMediaGroup(to.chat, media, disableNotification, to.messageId, allowSendingWithoutReply)
|
) = sendVisualMediaGroup(to.chat, media, disableNotification, protectContent, to.messageId, allowSendingWithoutReply)
|
||||||
|
|
||||||
|
|
||||||
// Photo
|
// Photo
|
||||||
@@ -476,9 +563,10 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, fileId, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, fileId, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -486,9 +574,21 @@ suspend inline fun TelegramBot.reply(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photo, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photo, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
photoSize: PhotoSize,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendPhoto(to.chat, photoSize, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithPhoto(
|
suspend inline fun TelegramBot.replyWithPhoto(
|
||||||
@@ -496,18 +596,30 @@ suspend inline fun TelegramBot.replyWithPhoto(
|
|||||||
fileId: InputFile,
|
fileId: InputFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, fileId, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, fileId, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
photo: Photo,
|
photo: Photo,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendPhoto(to.chat, photo, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendPhoto(to.chat, photo, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
photoSize: PhotoSize,
|
||||||
|
entities: TextSourcesList,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendPhoto(to.chat, photoSize, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Sticker
|
// Sticker
|
||||||
@@ -516,17 +628,19 @@ suspend inline fun TelegramBot.replyWithSticker(
|
|||||||
to: Message,
|
to: Message,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(to.chat, sticker, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(to.chat, sticker, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
sticker: Sticker,
|
sticker: Sticker,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendSticker(to.chat, sticker, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendSticker(to.chat, sticker, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Videos
|
// Videos
|
||||||
@@ -541,9 +655,10 @@ suspend inline fun TelegramBot.replyWithVideo(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, thumb, text, parseMode, duration, width, height, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, thumb, text, parseMode, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -551,9 +666,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithVideo(
|
suspend inline fun TelegramBot.replyWithVideo(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -564,18 +680,20 @@ suspend inline fun TelegramBot.replyWithVideo(
|
|||||||
width: Int? = null,
|
width: Int? = null,
|
||||||
height: Int? = null,
|
height: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, thumb, entities, duration, width, height, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, thumb, entities, duration, width, height, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
video: VideoFile,
|
video: VideoFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(to.chat, video, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(to.chat, video, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// VideoNotes
|
// VideoNotes
|
||||||
@@ -587,17 +705,19 @@ suspend inline fun TelegramBot.replyWithVideoNote(
|
|||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
size: Int? = null,
|
size: Int? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(to.chat, videoNote, thumb, duration, size, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(to.chat, videoNote, thumb, duration, size, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
videoNote: VideoNoteFile,
|
videoNote: VideoNoteFile,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(to.chat, videoNote, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideoNote(to.chat, videoNote, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Voice
|
// Voice
|
||||||
@@ -609,9 +729,10 @@ suspend inline fun TelegramBot.replyWithVoice(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, text, parseMode, duration, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, text, parseMode, duration, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -619,9 +740,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
text: String? = null,
|
text: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, text, parseMode, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
suspend inline fun TelegramBot.replyWithVoice(
|
suspend inline fun TelegramBot.replyWithVoice(
|
||||||
@@ -630,22 +752,28 @@ suspend inline fun TelegramBot.replyWithVoice(
|
|||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
duration: Long? = null,
|
duration: Long? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, entities, duration, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, entities, duration, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
voice: VoiceFile,
|
voice: VoiceFile,
|
||||||
entities: TextSourcesList,
|
entities: TextSourcesList,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVoice(to.chat, voice, entities, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVoice(to.chat, voice, entities, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Invoice
|
// Invoice
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||||
|
* as a builder for that
|
||||||
|
*/
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
title: String,
|
title: String,
|
||||||
@@ -666,9 +794,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
shouldSendEmailToProvider: Boolean = false,
|
shouldSendEmailToProvider: Boolean = false,
|
||||||
priceDependOnShipAddress: Boolean = false,
|
priceDependOnShipAddress: Boolean = false,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
// Polls
|
// Polls
|
||||||
@@ -682,9 +811,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -696,9 +826,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -711,9 +842,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -727,9 +859,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
parseMode: ParseMode? = null,
|
parseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -741,9 +874,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
suspend inline fun TelegramBot.reply(
|
suspend inline fun TelegramBot.reply(
|
||||||
to: Message,
|
to: Message,
|
||||||
@@ -756,6 +890,184 @@ suspend inline fun TelegramBot.reply(
|
|||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
poll: Poll,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
question: String = poll.question,
|
||||||
|
options: List<String> = poll.options.map { it.text },
|
||||||
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = when (poll) {
|
||||||
|
is RegularPoll -> reply(
|
||||||
|
to = to,
|
||||||
|
poll = poll,
|
||||||
|
isClosed = isClosed,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
allowMultipleAnswers = isAnonymous,
|
||||||
|
closeInfo = closeInfo,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is UnknownPollType -> error("Unable to send poll with unknown type ($poll)")
|
||||||
|
is QuizPoll -> reply(
|
||||||
|
to = to,
|
||||||
|
quizPoll = poll,
|
||||||
|
entities = poll.textSources,
|
||||||
|
isClosed = isClosed,
|
||||||
|
question = question,
|
||||||
|
options = options,
|
||||||
|
isAnonymous = isAnonymous,
|
||||||
|
closeInfo = closeInfo,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
fromChatId: ChatIdentifier,
|
||||||
|
messageId: MessageIdentifier,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = copyMessage(fromChatId, to.chat.id, messageId, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
fromChat: Chat,
|
||||||
|
messageId: MessageIdentifier,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = reply(to, fromChat.id, messageId, text, parseMode, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
suspend inline fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
copy: Message,
|
||||||
|
text: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = reply(to, copy.chat.id, copy.messageId, text, parseMode, disableNotification, protectContent, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
content: MessageContent,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) {
|
||||||
|
execute(
|
||||||
|
content.createResend(
|
||||||
|
to.chat.id,
|
||||||
|
disableNotification,
|
||||||
|
protectContent,
|
||||||
|
to.messageId,
|
||||||
|
allowSendingWithoutReply,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun TelegramBot.reply(
|
||||||
|
to: Message,
|
||||||
|
mediaFile: TelegramMediaFile,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) {
|
||||||
|
when (mediaFile) {
|
||||||
|
is AudioFile -> reply(
|
||||||
|
to = to,
|
||||||
|
audio = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is AnimationFile -> reply(
|
||||||
|
to = to,
|
||||||
|
animation = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is VoiceFile -> reply(
|
||||||
|
to = to,
|
||||||
|
voice = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is VideoFile -> reply(
|
||||||
|
to = to,
|
||||||
|
video = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is VideoNoteFile -> reply(
|
||||||
|
to = to,
|
||||||
|
videoNote = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is DocumentFile -> reply(
|
||||||
|
to = to,
|
||||||
|
document = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
is Sticker -> reply(
|
||||||
|
to = to,
|
||||||
|
sticker = mediaFile,
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
else -> reply(
|
||||||
|
to = to,
|
||||||
|
document = mediaFile.asDocumentFile(),
|
||||||
|
disableNotification = disableNotification,
|
||||||
|
protectContent = protectContent,
|
||||||
|
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||||
|
replyMarkup = replyMarkup
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -100,3 +100,7 @@ suspend fun TelegramBot.sendActionUploadVideoNote(
|
|||||||
chat: Chat
|
chat: Chat
|
||||||
) = sendBotAction(chat, UploadVideoNoteAction)
|
) = sendBotAction(chat, UploadVideoNoteAction)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.sendActionChooseStickerAction(
|
||||||
|
chat: Chat
|
||||||
|
) = sendBotAction(chat, ChooseStickerAction)
|
||||||
|
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.coroutines.safelyWithResult
|
||||||
|
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||||
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.actions.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
|
import kotlinx.coroutines.*
|
||||||
|
import kotlin.contracts.*
|
||||||
|
import kotlin.coroutines.coroutineContext
|
||||||
|
|
||||||
|
private const val refreshTime: MilliSeconds = (botActionActualityTime - 1) * 1000L
|
||||||
|
typealias TelegramBotActionCallback<T> = suspend TelegramBot.() -> T
|
||||||
|
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withAction(
|
||||||
|
actionRequest: SendAction,
|
||||||
|
block: TelegramBotActionCallback<T>
|
||||||
|
): T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
val botActionJob = CoroutineScope(coroutineContext).launch {
|
||||||
|
while (isActive) {
|
||||||
|
delay(refreshTime)
|
||||||
|
safelyWithoutExceptions {
|
||||||
|
execute(actionRequest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val result = safelyWithResult { block() }
|
||||||
|
botActionJob.cancel()
|
||||||
|
return result.getOrThrow()
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withAction(
|
||||||
|
chatId: ChatId,
|
||||||
|
action: BotAction,
|
||||||
|
block: TelegramBotActionCallback<T>
|
||||||
|
): T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(
|
||||||
|
SendAction(chatId, action),
|
||||||
|
block
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withAction(
|
||||||
|
chat: Chat,
|
||||||
|
action: BotAction,
|
||||||
|
block: TelegramBotActionCallback<T>
|
||||||
|
): T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(
|
||||||
|
chat.id,
|
||||||
|
action,
|
||||||
|
block
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withTypingAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, TypingAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, UploadPhotoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, RecordVideoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, UploadVideoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, RecordVoiceAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, UploadVoiceAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, UploadDocumentAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withFindLocationAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, FindLocationAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, RecordVideoNoteAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, UploadVideoNoteAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: ChatId, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chatId, ChooseStickerAction, block)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, TypingAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, UploadPhotoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, RecordVideoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, UploadVideoAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, RecordVoiceAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, UploadVoiceAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, UploadDocumentAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, FindLocationAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, RecordVideoNoteAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, UploadVideoNoteAction, block)
|
||||||
|
}
|
||||||
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, block: TelegramBotActionCallback<T>) : T {
|
||||||
|
contract {
|
||||||
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
|
return withAction(chat, ChooseStickerAction, block)
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user