mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-17 12:30:20 +00:00
Compare commits
194 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| ae1fb25336 | |||
| 4e3ea6cd80 | |||
| 148203eabf | |||
| 4465b573ca | |||
| f0dda60630 | |||
| 47135a1b65 | |||
| d8f830c60f | |||
| 226b8dee21 | |||
| a109771d20 | |||
| c028434f30 | |||
| d5c6ce32bb | |||
| d92cac5e07 | |||
| 9b21b5290c | |||
| 13ca63d27d | |||
| ad917dda1b | |||
| 7b1344e9c8 | |||
| c4fbd2f1c6 | |||
| c90bcea42c | |||
| e75c93d626 | |||
| 58dcbe8751 | |||
| 17806cde25 | |||
| f147a3d620 | |||
| 9eb6008a73 | |||
| f7d2c8bbd2 | |||
| f42cf78969 | |||
| 9a14932511 | |||
| 149ecf175b | |||
| 2049fea82a | |||
| 40d94cca70 | |||
| c8ad68ea69 | |||
| c66d64adbc | |||
| b475976ff1 | |||
| ea8db5b851 | |||
| af2fabf1ca | |||
| abc0457a36 | |||
| 8dbdbdee13 | |||
| 0c31379ff5 | |||
| 3b3cf81aaa | |||
| 1642075a75 | |||
| 760c9f2916 | |||
| 219238cf19 | |||
| 762087fc09 | |||
| 142fae1ede | |||
| 95abc72bf3 | |||
| 1d37a7446c | |||
| 7d35114b5d | |||
| 75f4226772 | |||
| 96d980cb8a | |||
| ed077ae1bc | |||
| 9540797ffc | |||
| 217b01994e | |||
| 6b89c94ef1 | |||
| e25ce57f6a | |||
| 530394fd15 | |||
| 3e891d50fd | |||
| adf5fd6288 | |||
| e7a2dc51aa | |||
| 399793243b | |||
| 3801025ff1 |
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
|
|
||||||
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:
|
||||||
|
|||||||
6
.github/workflows/packages_publishing.yml
vendored
6
.github/workflows/packages_publishing.yml
vendored
@@ -8,13 +8,19 @@ jobs:
|
|||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
|
- name: Fix android 31.0.0 dx
|
||||||
|
continue-on-error: true
|
||||||
|
run: cd /usr/local/lib/android/sdk/build-tools/31.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar
|
||||||
- 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
|
||||||
|
continue-on-error: true
|
||||||
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication
|
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication
|
||||||
env:
|
env:
|
||||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
GITHUBPACKAGES_USER: ${{ github.actor }}
|
||||||
|
|||||||
214
CHANGELOG.md
214
CHANGELOG.md
@@ -1,5 +1,219 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Kotlin`: `1.5.21` -> `1.5.30`
|
||||||
|
* `Klock`: `2.3.3` -> `2.4.1`
|
||||||
|
* `Ktor`: `1.6.2` -> `1.6.3`
|
||||||
|
* `Coroutines`: `1.5.1` -> `1.5.2`
|
||||||
|
* `MicroUtils`: `0.5.21` -> `0.5.24`
|
||||||
|
|
||||||
|
## 0.35.6
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Klock`: `2.3.1` -> `2.3.3`
|
||||||
|
* `MicroUtils`: `0.5.19` -> `0.5.21`
|
||||||
|
* `Core`:
|
||||||
|
* All `FlowsUpdatesFilter` flows have been renamed and updated
|
||||||
|
* `Utils`:
|
||||||
|
* Extensions `allSentMessagesFlow` and `allSentMediaGroupsFlow` have been deprecated
|
||||||
|
|
||||||
|
## 0.35.5
|
||||||
|
|
||||||
|
**MIME TYPES FOR REQUESTS HAVE BEEN DEPRECATED DUE TO REDUNDANCY OF MIME TYPES IN FILES SENDING**
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Several new extensions `ByteReadChannel#asStorageFile` and `ByteReadChannelAllocator#asStorageFile`
|
||||||
|
* Several new extensions `ByteArray#asMultipartFile`, `ByteReadChannel#asMultipartFile` and
|
||||||
|
`ByteReadChannelAllocator#asMultipartFile`
|
||||||
|
* New extension `StorageFile#asMultipartFile`
|
||||||
|
* `API`:
|
||||||
|
* New extensions `TelegramBot#downloadFile` for writing of incoming bytes to the file
|
||||||
|
* New extensions `TelegramBot#downloadFileStream` and `TelegramBot#downloadFileStreamAllocator` for getting of input
|
||||||
|
streams instead of whole bytes arrays
|
||||||
|
* Old extensions `TelegramBot#downloadFile` has been replaced to the new package. Migration: replace in your project
|
||||||
|
`import dev.inmo.tgbotapi.extensions.api.downloadFile` with `import dev.inmo.tgbotapi.extensions.api.files.downloadFile`
|
||||||
|
* `PathedFile#filename` extension has been deprecated, and new property `PathedFile#fileName` has been included
|
||||||
|
directly in `PathedFile`
|
||||||
|
* `Utils`:
|
||||||
|
* Add several functions `convertToStorageFile` and extensions `TelegramBot#convertToStorageFile`
|
||||||
|
|
||||||
|
## 0.35.4 Hotfix
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `MicroUtils`: `0.5.18` -> `0.5.19`
|
||||||
|
|
||||||
|
## 0.35.3
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Version`:
|
||||||
|
* `Klock`: `2.2.0` -> `2.3.1`
|
||||||
|
* `Ktor`: `1.6.1` -> `1.6.2`
|
||||||
|
* `MicroUtils`: `0.5.16` -> `0.5.18`
|
||||||
|
* `Core`:
|
||||||
|
* **`SimpleRequestCallFactory` and `MultipartRequestCallFactory` became a classes instead of objects to avoid
|
||||||
|
collisions in different bots**
|
||||||
|
* Support of strongly-typed ietf language codes has been added
|
||||||
|
* `API`:
|
||||||
|
* New extension `TelegramBot#downloadFile` for any `MediaContent`
|
||||||
|
* `Behaviour Builder`:
|
||||||
|
* New provider `defaultCoroutineScopeProvider`
|
||||||
|
* Now it is not necessary to provide `CoroutineScope` to `TelegramBot#buildBehaviour`
|
||||||
|
extension
|
||||||
|
* New `TelegramBot#buildBehaviour` extension with `FlowUpdatesFilter` and `CoroutineScope` with
|
||||||
|
default `CoroutineScope`
|
||||||
|
* New typealias `SimpleFilter` for unifying triggers filter signatures
|
||||||
|
* All waiters got real filters (`SimpleFilter`) and rename old filters as mappers
|
||||||
|
* New extensions for `Any`: `as`/`when`/`require` for `WithOptionalLanguageCode` and `WithLanguageCode`
|
||||||
|
|
||||||
## 0.35.2
|
## 0.35.2
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -1,18 +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#december-7-2021)
|
||||||
|
|
||||||
# TelegramBotAPI
|
| [](https://github.com/KotlinBy/awesome-kotlin) [](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [](https://forms.gle/2Hex2ynbHWHhi1KY7) [](https://t.me/InMoTelegramBotAPI) |
|
||||||
|
|:---:|
|
||||||
|
| [](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) |
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
1
TelegramBotAPI.drawio
Normal file
1
TelegramBotAPI.drawio
Normal file
File diff suppressed because one or more lines are too long
@@ -1,311 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<minder version="1.11.3">
|
|
||||||
<theme name="default" label="Default" index="-1"/>
|
|
||||||
<styles>
|
|
||||||
<style level="0" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="1" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="2" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="3" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="4" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="5" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="6" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="7" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="8" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="9" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<style level="10" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
</styles>
|
|
||||||
<drawarea x="-950.47548925255796" y="-49.650554065281653" scale="0.5"/>
|
|
||||||
<images/>
|
|
||||||
<nodes>
|
|
||||||
<node id="0" posx="1378.798161778599" posy="159.04571601189673" width="472" height="168" side="top" fold="false" treesize="743" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="439" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1394.798161778599" posy="175.04571601189673" maxwidth="488.96484375">
|
|
||||||
<text data="tgbotapi.core Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api"/>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
<nodes>
|
|
||||||
<node id="1" posx="1411.798161778599" posy="427.04571601189673" width="406" height="145" side="bottom" fold="false" treesize="743" color="#68b723" colorroot="true" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="none" nodewidth="394" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1427.798161778599" posy="443.04571601189673" maxwidth="419.451171875">
|
|
||||||
<text data="TelegramBotAPI extensions Family of projects which are fully based on TelegramBotAPI and extend its functionality"/>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
<nodes>
|
|
||||||
<node id="2" posx="1247.298161778599" posy="672.04571601189673" width="296" height="191" side="bottom" fold="false" treesize="296" color="#68b723" colorroot="true" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="203" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1263.298161778599" posy="688.04571601189673" maxwidth="295.90315755208337">
|
|
||||||
<text data="tgbotapi.extensions.api Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier"/>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
</node>
|
|
||||||
<node id="3" posx="1609.298161778599" posy="672.04571601189673" width="307" height="168" side="bottom" fold="false" treesize="439" color="#68b723" colorroot="true" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="286" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1625.298161778599" posy="688.04571601189673" maxwidth="299.252197265625">
|
|
||||||
<text data="tgbotapi.extensions.utils Extensions project with utils things which will make easier different operations"/>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
<nodes>
|
|
||||||
<node id="4" posx="1543.298161778599" posy="940.04571601189673" width="439" height="122" side="bottom" fold="false" treesize="439" color="#68b723" colorroot="false" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="387" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1559.298161778599" posy="956.04571601189673" maxwidth="408.97932942708348">
|
|
||||||
<text data="tgbotapi.extensions.behaviour_builder Extension project for building bot behaviour via special dsl"/>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
</node>
|
|
||||||
</nodes>
|
|
||||||
</node>
|
|
||||||
</nodes>
|
|
||||||
</node>
|
|
||||||
</nodes>
|
|
||||||
</node>
|
|
||||||
<node id="5" posx="1391.8445078072455" posy="1155.6062730594231" width="461" height="236" side="bottom" fold="false" treesize="461" layout="Downwards" group="false">
|
|
||||||
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="430" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
|
|
||||||
<nodename posx="1407.8445078072455" posy="1171.6062730594231" maxwidth="453.885498046875">
|
|
||||||
<text data="tgbotapi Here included all available TelegramBotAPI libraries: * tgbotapi.core * tgbotapi.extensions.api * tgbotapi.extensions.utils * tgbotapi.extensions.behaviour_builder">
|
|
||||||
<color>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="67" end="68" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="84" end="85" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="111" end="112" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
<range start="139" end="140" extra="rgb(255,0,0)"/>
|
|
||||||
</color>
|
|
||||||
</text>
|
|
||||||
</nodename>
|
|
||||||
<nodenote></nodenote>
|
|
||||||
</node>
|
|
||||||
</nodes>
|
|
||||||
<groups/>
|
|
||||||
<connections>
|
|
||||||
<connection from_id="2" to_id="5" drag_x="1475.8213347929195" drag_y="1014.8259945356604" color="#777777">
|
|
||||||
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<title></title>
|
|
||||||
<note></note>
|
|
||||||
</connection>
|
|
||||||
<connection from_id="4" to_id="5" drag_x="1691.5447998046875" drag_y="1107.00439453125" color="#777777">
|
|
||||||
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<title></title>
|
|
||||||
<note></note>
|
|
||||||
</connection>
|
|
||||||
<connection from_id="3" to_id="5" drag_x="1483.48876953125" drag_y="896.18115234375">
|
|
||||||
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
|
|
||||||
<title></title>
|
|
||||||
<note></note>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
<stickers/>
|
|
||||||
</minder>
|
|
||||||
@@ -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,3 @@
|
|||||||
dokka_version=1.4.32
|
dokka_version=1.5.31
|
||||||
|
|
||||||
org.gradle.jvmargs=-Xmx1024m
|
org.gradle.jvmargs=-Xmx1024m
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ kotlin.js.generate.externals=true
|
|||||||
kotlin.incremental=true
|
kotlin.incremental=true
|
||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
kotlin_version=1.5.21
|
kotlin_version=1.5.31
|
||||||
kotlin_coroutines_version=1.5.1
|
kotlin_coroutines_version=1.5.2
|
||||||
kotlin_serialisation_runtime_version=1.2.2
|
kotlin_serialisation_runtime_version=1.3.1
|
||||||
klock_version=2.2.0
|
klock_version=2.4.8
|
||||||
uuid_version=0.3.0
|
uuid_version=0.3.1
|
||||||
ktor_version=1.6.1
|
ktor_version=1.6.5
|
||||||
|
|
||||||
micro_utils_version=0.5.16
|
micro_utils_version=0.8.7
|
||||||
|
|
||||||
javax_activation_version=1.1.1
|
javax_activation_version=1.1.1
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=0.35.2
|
library_version=0.37.2
|
||||||
|
|
||||||
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.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 89 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,7 +1,6 @@
|
|||||||
# TelegramBotAPI extensions
|
# TelegramBotAPI API extensions
|
||||||
|
|
||||||
[ ](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/_latestVersion)
|
[](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api)
|
||||||
[](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api)
|
|
||||||
|
|
||||||
## What is it?
|
## What is it?
|
||||||
|
|
||||||
@@ -17,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
|
||||||
|
|
||||||
@@ -29,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>
|
||||||
```
|
```
|
||||||
@@ -38,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`
|
||||||
@@ -71,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) |
|
||||||
@@ -79,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:
|
||||||
|
|
||||||
55
tgbotapi.api/build.gradle
Normal file
55
tgbotapi.api/build.gradle
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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"
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
1
tgbotapi.api/mpp_publish_template.kpsb
Normal file
1
tgbotapi.api/mpp_publish_template.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":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"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/"}]}}
|
||||||
69
tgbotapi.api/publish.gradle
Normal file
69
tgbotapi.api/publish.gradle
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
apply plugin: 'maven-publish'
|
||||||
|
apply plugin: 'signing'
|
||||||
|
|
||||||
|
task javadocsJar(type: Jar) {
|
||||||
|
classifier = 'javadoc'
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications.all {
|
||||||
|
artifact javadocsJar
|
||||||
|
|
||||||
|
pom {
|
||||||
|
description = "API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference"
|
||||||
|
name = "Telegram Bot API Extensions for API"
|
||||||
|
url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api"
|
||||||
|
|
||||||
|
scm {
|
||||||
|
developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git"
|
||||||
|
url = "https://github.com/insanusmokrassar/TelegramBotAPI.git"
|
||||||
|
}
|
||||||
|
|
||||||
|
developers {
|
||||||
|
|
||||||
|
developer {
|
||||||
|
id = "InsanusMokrassar"
|
||||||
|
name = "Ovsiannikov Aleksei"
|
||||||
|
email = "ovsyannikov.alexey95@gmail.com"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
licenses {
|
||||||
|
|
||||||
|
license {
|
||||||
|
name = "Apache Software License 2.0"
|
||||||
|
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
||||||
|
maven {
|
||||||
|
name = "GithubPackages"
|
||||||
|
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
|
||||||
|
credentials {
|
||||||
|
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
||||||
|
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
|
maven {
|
||||||
|
name = "sonatype"
|
||||||
|
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
credentials {
|
||||||
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
|
sign publishing.publications
|
||||||
|
}
|
||||||
@@ -21,6 +21,10 @@ import kotlinx.coroutines.launch
|
|||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
|
||||||
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see startLiveLocation
|
||||||
|
*/
|
||||||
class LiveLocationProvider internal constructor(
|
class LiveLocationProvider internal constructor(
|
||||||
private val requestsExecutor: TelegramBot,
|
private val requestsExecutor: TelegramBot,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
@@ -44,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
|
||||||
@@ -69,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,
|
||||||
@@ -108,6 +120,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,
|
||||||
@@ -136,6 +152,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
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,
|
||||||
@@ -163,6 +183,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
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,
|
||||||
@@ -190,6 +214,10 @@ suspend fun TelegramBot.startLiveLocation(
|
|||||||
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,
|
||||||
@@ -217,6 +245,10 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
|
|||||||
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,
|
||||||
@@ -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)
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
@@ -7,5 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.deleteMyCommands(
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: IetfLanguageCode?
|
||||||
) = execute(DeleteMyCommands(scope, languageCode))
|
) = execute(DeleteMyCommands(scope, languageCode))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.deleteMyCommands(
|
||||||
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
|
languageCode: String? = null
|
||||||
|
) = deleteMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||||
@@ -7,5 +8,10 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
|
|
||||||
suspend fun TelegramBot.getMyCommands(
|
suspend fun TelegramBot.getMyCommands(
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: IetfLanguageCode? = null
|
||||||
) = execute(GetMyCommands(scope, languageCode))
|
) = execute(GetMyCommands(scope, languageCode))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getMyCommands(
|
||||||
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
|
languageCode: String?
|
||||||
|
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.bot
|
package dev.inmo.tgbotapi.extensions.api.bot
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
@@ -9,9 +10,21 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
|
|||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
commands: List<BotCommand>,
|
commands: List<BotCommand>,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
languageCode: String? = null
|
languageCode: IetfLanguageCode?
|
||||||
) = execute(SetMyCommands(commands, scope, languageCode))
|
) = execute(SetMyCommands(commands, scope, languageCode))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.setMyCommands(
|
||||||
|
vararg commands: BotCommand,
|
||||||
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
|
languageCode: IetfLanguageCode?
|
||||||
|
) = setMyCommands(commands.toList(), scope, languageCode)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.setMyCommands(
|
||||||
|
commands: List<BotCommand>,
|
||||||
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
|
languageCode: String? = null
|
||||||
|
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLanguageCode))
|
||||||
|
|
||||||
suspend fun TelegramBot.setMyCommands(
|
suspend fun TelegramBot.setMyCommands(
|
||||||
vararg commands: BotCommand,
|
vararg commands: BotCommand,
|
||||||
scope: BotCommandScope = BotCommandScopeDefault,
|
scope: BotCommandScope = BotCommandScopeDefault,
|
||||||
@@ -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,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
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
|
||||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.DownloadFile
|
|||||||
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
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
suspend fun TelegramBot.downloadFile(
|
suspend fun TelegramBot.downloadFile(
|
||||||
filePath: String
|
filePath: String
|
||||||
@@ -15,8 +16,8 @@ suspend fun TelegramBot.downloadFile(
|
|||||||
|
|
||||||
suspend fun TelegramBot.downloadFile(
|
suspend fun TelegramBot.downloadFile(
|
||||||
pathedFile: PathedFile
|
pathedFile: PathedFile
|
||||||
): ByteArray = execute(
|
): ByteArray = downloadFile(
|
||||||
DownloadFile(pathedFile.filePath)
|
pathedFile.filePath
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.downloadFile(
|
suspend fun TelegramBot.downloadFile(
|
||||||
@@ -30,3 +31,9 @@ suspend fun TelegramBot.downloadFile(
|
|||||||
): ByteArray = downloadFile(
|
): ByteArray = downloadFile(
|
||||||
getFileAdditionalInfo(file)
|
getFileAdditionalInfo(file)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFile(
|
||||||
|
file: MediaContent
|
||||||
|
): ByteArray = downloadFile(
|
||||||
|
getFileAdditionalInfo(file.media)
|
||||||
|
)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.files
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
import dev.inmo.tgbotapi.extensions.api.get.getFileAdditionalInfo
|
||||||
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
|
import dev.inmo.tgbotapi.types.files.PathedFile
|
||||||
|
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStream(
|
||||||
|
filePath: String
|
||||||
|
) = downloadFileStreamAllocator(filePath).invoke()
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStream(
|
||||||
|
pathedFile: PathedFile
|
||||||
|
) = downloadFileStream(pathedFile.filePath)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStream(
|
||||||
|
fileId: FileId
|
||||||
|
) = downloadFileStream(getFileAdditionalInfo(fileId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStream(
|
||||||
|
file: TelegramMediaFile
|
||||||
|
) = downloadFileStream(getFileAdditionalInfo(file))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStream(
|
||||||
|
file: MediaContent
|
||||||
|
) = downloadFileStream(getFileAdditionalInfo(file.media))
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package dev.inmo.tgbotapi.extensions.api.files
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
|
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.types.files.PathedFile
|
||||||
|
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStreamAllocator(
|
||||||
|
filePath: String
|
||||||
|
) = execute(DownloadFileStream(filePath))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStreamAllocator(
|
||||||
|
pathedFile: PathedFile
|
||||||
|
) = downloadFileStreamAllocator(pathedFile.filePath)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStreamAllocator(
|
||||||
|
fileId: FileId
|
||||||
|
) = downloadFileStreamAllocator(getFileAdditionalInfo(fileId))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStreamAllocator(
|
||||||
|
file: TelegramMediaFile
|
||||||
|
) = downloadFileStreamAllocator(getFileAdditionalInfo(file))
|
||||||
|
|
||||||
|
suspend fun TelegramBot.downloadFileStreamAllocator(
|
||||||
|
file: MediaContent
|
||||||
|
) = downloadFileStreamAllocator(getFileAdditionalInfo(file.media))
|
||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||||
import dev.inmo.tgbotapi.requests.get.GetFile
|
import dev.inmo.tgbotapi.requests.get.GetFile
|
||||||
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||||
|
|
||||||
suspend fun TelegramBot.getFileAdditionalInfo(
|
suspend fun TelegramBot.getFileAdditionalInfo(
|
||||||
fileId: FileId
|
fileId: FileId
|
||||||
@@ -14,3 +15,7 @@ suspend fun TelegramBot.getFileAdditionalInfo(
|
|||||||
suspend fun TelegramBot.getFileAdditionalInfo(
|
suspend fun TelegramBot.getFileAdditionalInfo(
|
||||||
file: TelegramMediaFile
|
file: TelegramMediaFile
|
||||||
) = getFileAdditionalInfo(file.fileId)
|
) = getFileAdditionalInfo(file.fileId)
|
||||||
|
|
||||||
|
suspend fun TelegramBot.getFileAdditionalInfo(
|
||||||
|
content: MediaContent
|
||||||
|
) = getFileAdditionalInfo(content.media)
|
||||||
@@ -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,
|
||||||
@@ -24,6 +28,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
CopyMessage(fromChatId, toChatId, messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
CopyMessage(fromChatId, toChatId, messageId, text, parseMode, disableNotification, 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,
|
||||||
@@ -36,6 +44,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -48,6 +60,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -60,6 +76,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -71,6 +91,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -83,6 +107,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
) = copyMessage(message.chat, toChat, message.messageId, text, parseMode, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(message.chat, toChat, message.messageId, text, parseMode, disableNotification, 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,
|
||||||
@@ -96,6 +124,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
CopyMessage(fromChatId, toChatId, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
CopyMessage(fromChatId, toChatId, messageId, entities, disableNotification, 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,
|
||||||
@@ -107,6 +139,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, 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,
|
||||||
@@ -118,6 +154,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, 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,
|
||||||
@@ -129,6 +169,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -139,6 +183,10 @@ suspend inline fun TelegramBot.copyMessage(
|
|||||||
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, 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,
|
||||||
@@ -28,6 +28,10 @@ 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,
|
||||||
@@ -47,6 +51,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
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,
|
||||||
@@ -65,6 +73,10 @@ 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,
|
||||||
@@ -73,6 +85,10 @@ suspend inline fun TelegramBot.replyWithDice(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(to.chat, animationType, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
|
) = sendDice(to.chat, animationType, disableNotification, 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,
|
||||||
@@ -84,6 +100,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
|
|
||||||
// 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,
|
||||||
@@ -99,6 +119,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
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,
|
||||||
@@ -115,6 +139,10 @@ 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,
|
||||||
@@ -134,6 +162,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
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,
|
||||||
@@ -154,6 +186,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,
|
||||||
@@ -646,6 +682,10 @@ suspend inline fun TelegramBot.reply(
|
|||||||
|
|
||||||
// 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,
|
||||||
@@ -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)
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.send
|
package dev.inmo.tgbotapi.extensions.api.send
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.safely
|
import dev.inmo.micro_utils.coroutines.safelyWithResult
|
||||||
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.send.SendAction
|
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||||
@@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.*
|
|||||||
import dev.inmo.tgbotapi.types.actions.*
|
import dev.inmo.tgbotapi.types.actions.*
|
||||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
import kotlin.coroutines.coroutineContext
|
||||||
|
|
||||||
private const val refreshTime: MilliSeconds = (botActionActualityTime - 1) * 1000L
|
private const val refreshTime: MilliSeconds = (botActionActualityTime - 1) * 1000L
|
||||||
typealias TelegramBotActionCallback<T> = suspend TelegramBot.() -> T
|
typealias TelegramBotActionCallback<T> = suspend TelegramBot.() -> T
|
||||||
@@ -16,8 +17,7 @@ suspend fun <T> TelegramBot.withAction(
|
|||||||
actionRequest: SendAction,
|
actionRequest: SendAction,
|
||||||
block: TelegramBotActionCallback<T>
|
block: TelegramBotActionCallback<T>
|
||||||
): T {
|
): T {
|
||||||
val botActionJob = supervisorScope {
|
val botActionJob = CoroutineScope(coroutineContext).launch {
|
||||||
launch {
|
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
delay(refreshTime)
|
delay(refreshTime)
|
||||||
safelyWithoutExceptions {
|
safelyWithoutExceptions {
|
||||||
@@ -25,12 +25,9 @@ suspend fun <T> TelegramBot.withAction(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
val result = safelyWithResult { block() }
|
||||||
return try {
|
|
||||||
safely { block() }
|
|
||||||
} finally {
|
|
||||||
botActionJob.cancel()
|
botActionJob.cancel()
|
||||||
}
|
return result.getOrThrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun <T> TelegramBot.withAction(
|
suspend fun <T> TelegramBot.withAction(
|
||||||
@@ -62,6 +59,7 @@ suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: ChatId, block: Tele
|
|||||||
suspend fun <T> TelegramBot.withFindLocationAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, FindLocationAction, block)
|
suspend fun <T> TelegramBot.withFindLocationAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, FindLocationAction, block)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, RecordVideoNoteAction, block)
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, RecordVideoNoteAction, block)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadVideoNoteAction, block)
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadVideoNoteAction, block)
|
||||||
|
suspend fun <T> TelegramBot.withChooseStickerAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, ChooseStickerAction, block)
|
||||||
|
|
||||||
|
|
||||||
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, TypingAction, block)
|
suspend fun <T> TelegramBot.withTypingAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, TypingAction, block)
|
||||||
@@ -74,3 +72,4 @@ suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, block: Telegram
|
|||||||
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, FindLocationAction, block)
|
suspend fun <T> TelegramBot.withFindLocationAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, FindLocationAction, block)
|
||||||
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, RecordVideoNoteAction, block)
|
suspend fun <T> TelegramBot.withRecordVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, RecordVideoNoteAction, block)
|
||||||
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadVideoNoteAction, block)
|
suspend fun <T> TelegramBot.withUploadVideoNoteAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadVideoNoteAction, block)
|
||||||
|
suspend fun <T> TelegramBot.withChooseStickerAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, ChooseStickerAction, block)
|
||||||
@@ -6,6 +6,10 @@ import dev.inmo.tgbotapi.types.*
|
|||||||
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.chat.abstracts.Chat
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
phoneNumber: String,
|
phoneNumber: String,
|
||||||
@@ -21,6 +25,10 @@ suspend fun TelegramBot.sendContact(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
@@ -34,6 +42,10 @@ suspend fun TelegramBot.sendContact(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
phoneNumber: String,
|
phoneNumber: String,
|
||||||
@@ -47,6 +59,10 @@ suspend fun TelegramBot.sendContact(
|
|||||||
chat.id, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chat.id, phoneNumber, firstName, lastName, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.sendContact(
|
suspend fun TelegramBot.sendContact(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
contact: Contact,
|
contact: Contact,
|
||||||
@@ -8,6 +8,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.dice.DiceAnimationType
|
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendDice(
|
suspend fun TelegramBot.sendDice(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
@@ -19,6 +23,10 @@ suspend fun TelegramBot.sendDice(
|
|||||||
SendDice(chatId, animationType, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
SendDice(chatId, animationType, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
suspend fun TelegramBot.sendDice(
|
suspend fun TelegramBot.sendDice(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
animationType: DiceAnimationType? = null,
|
animationType: DiceAnimationType? = null,
|
||||||
@@ -8,6 +8,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.location.StaticLocation
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -26,6 +30,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -41,6 +49,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
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.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -57,6 +69,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
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.sendLocation(
|
suspend fun TelegramBot.sendLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -72,6 +88,10 @@ suspend fun TelegramBot.sendLocation(
|
|||||||
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.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -81,6 +101,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, latitude, longitude, disableNotification, replyToMessageId, replyMarkup)
|
) = sendLocation(chatId, latitude, longitude, disableNotification, replyToMessageId, 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.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
@@ -89,6 +113,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chatId, location.latitude, location.longitude, disableNotification, replyToMessageId, replyMarkup)
|
) = sendLocation(chatId, location.latitude, location.longitude, disableNotification, replyToMessageId, 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.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
latitude: Double,
|
latitude: Double,
|
||||||
@@ -98,6 +126,10 @@ suspend fun TelegramBot.sendStaticLocation(
|
|||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendLocation(chat.id, latitude, longitude, disableNotification, replyToMessageId, replyMarkup)
|
) = sendLocation(chat.id, latitude, longitude, disableNotification, replyToMessageId, 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.sendStaticLocation(
|
suspend fun TelegramBot.sendStaticLocation(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
location: StaticLocation,
|
location: StaticLocation,
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user