mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-09-02 14:19:16 +00:00
Compare commits
42 Commits
renovate/k
...
37.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b1304ef10d | |||
| 3ca3e571b5 | |||
| af09ef4c29 | |||
| d43de9623d | |||
| 0cac885dfc | |||
| 9fcb267ee2 | |||
| 3bdfdb57b5 | |||
| f4a41c047d | |||
| f8e70c5cc7 | |||
| d972cc5b8d | |||
| 61c4e7af17 | |||
| 93a4bf1da0 | |||
| f86bb6662e | |||
| 2e69bc6954 | |||
| efd4667ffa | |||
| 752689447b | |||
| 1ec5e02e0a | |||
| b23ec8bc01 | |||
| 78e1acc260 | |||
| 36e38f2b01 | |||
| 05d6927852 | |||
| e793159400 | |||
| 0eaaded6e4 | |||
| 642306c835 | |||
| 5f115b6e3d | |||
| 5755724569 | |||
| 8bee8982bb | |||
| 5b6fe8eb96 | |||
| f9c634ca46 | |||
| b913f66b1e | |||
| 6fbe2e5649 | |||
| 8b0e0bf820 | |||
| 4f19cb7626 | |||
| d48e951232 | |||
| a1d2ebb4dc | |||
| bc52be7b40 | |||
| a2f670834e | |||
| 3d47034f54 | |||
| 0c329326f7 | |||
| 838caae7f5 | |||
| 16be206b0f | |||
| 0b3a5bb0af |
111
CHANGELOG.md
111
CHANGELOG.md
@@ -1,5 +1,116 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 37.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.3](https://core.telegram.org/bots/api-changelog#august-24-2026)**
|
||||
|
||||
**Breaking changes**:
|
||||
|
||||
* `OptionallyEphemeralSendRequest` replaced the `receiverUserId`/`callbackQueryId` properties with `ephemeralMessageParameters: EphemeralMessageParameters?`; the 13 ephemeral-capable send-request constructors and the corresponding `reply` API overloads replaced the two flat parameters with the parameter object, while direct and generic `send` API extensions retain non-deprecated flat-parameter overloads as an alternative API form
|
||||
* `ChatAdministratorRights` gained the abstract `canSendWelcomeMessages` property; implementations maintained in the same compilation module must supply the property, while `ChatCommonAdministratorRights` construction can use the new trailing default
|
||||
* `FlowsUpdatesFilter` gained the abstract `messageGenerationStoppedUpdatesFlow` property; direct implementations must supply the flow, while subclasses of `AbstractFlowsUpdatesFilter` inherit the filtered implementation
|
||||
* `RichText` gained the public `isValidRichMessageButtonText` contract and the `RichText`/`RichBlock`/`InputRichBlock` sealed hierarchies gained Bot API 10.3 variants; permitted same-module implementations and exhaustive `when` expressions must cover the new contracts and variants
|
||||
* `SendRichMessageDraft`, `sendRichMessageDraft`, and the corresponding generic `send` overload widened `chatId` from `ChatId` to `IdChatIdentifier`; source calls passing `ChatId` remain valid, while the JVM signatures changed
|
||||
* `SendMessageDraft` and `SendRichMessageDraft` request/API surfaces replaced `threadId: MessageThreadId?` with `directMessageThreadId: DirectMessageThreadId?`; serialized requests now use `direct_messages_topic_id` instead of `message_thread_id`, and JVM signatures changed
|
||||
|
||||
**Migration advice**: Direct and generic `send` extensions accept either `receiverUserId = userId, callbackQueryId = callbackId, replaceCallbackQueryMessage = ...` or `ephemeralMessageParameters = EphemeralMessageParameters(receiverUserId = userId, callbackQueryId = callbackId, replaceCallbackQueryMessage = ...)`; send-request constructors and `reply` API overloads require the parameter-object form; replace draft `threadId = MessageThreadId(...)` arguments with `directMessageThreadId = DirectMessageThreadId(...)`; add `canSendWelcomeMessages` and `messageGenerationStoppedUpdatesFlow` to direct interface implementations; add Bot API 10.3 branches to exhaustive rich-type `when` expressions
|
||||
|
||||
**Compatibility note**: The new `text`/`entities`/`isPrivate` fields of `GiftSentOrReceivedEvent.UniqueGift.Common` and `GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount` are trailing constructor parameters; existing positional argument and `componentN` order is preserved
|
||||
|
||||
* `Core`:
|
||||
* (`Ephemeral messages`) Added `EphemeralMessageParameters`; replaced the flat send-request recipient/callback parameters with `ephemeralMessageParameters`, including callback-message replacement support
|
||||
* (`Rich Messages`) Widened `SendRichMessageDraft.chatId` from `ChatId` to `IdChatIdentifier`, allowing contextual numeric identifiers to supply the default direct messages topic
|
||||
* (`General`) Migrated `SendMessageDraft` and `SendRichMessageDraft` from `message_thread_id`/`MessageThreadId` to `direct_messages_topic_id`/`DirectMessageThreadId`
|
||||
* (`Ephemeral messages`) Added new-file uploads for `editEphemeralMessageMedia`; collected secondary live-photo `photo` attachments for ephemeral and regular media edits, media groups, and paid media; added `showCaptionAboveMedia` for caption edits and rich-message text edits
|
||||
* (`Ephemeral messages`) Added `canSendWelcomeMessages` administrator right and `promoteChatMember` parameter
|
||||
* (`Rich Messages`) Added rich-message button actions, rich-text/button-row entities, typed button styles/alignment, expandable block quotations, compact tables, document blocks, document media links and direct document uploads
|
||||
* (`Rich Messages`) Added the `RichText.isValidRichMessageButtonText` subtype contract, moved rich-button markup generation onto `RichMessageButton` implementations, and corrected expandable-quotation Rich Markdown block HTML to use `<blockquote expandable>` with HTML-formatted nested text and credit
|
||||
* (`Reply markup`) Added `DisabledButton`/`DisabledInlineKeyboardButton` support for disabled inline buttons
|
||||
* (`Reply markup`) Added `forceReply` support to `InlineKeyboardMarkup` and `ReplyKeyboardMarkup`
|
||||
* (`General`) Added `canStop`/`keepOnStop` draft controls, `MessageGenerationStopped` updates, and `CommunityChatJoined` service messages
|
||||
* (`General`) `UniqueGiftInfo` now exposes `text`/`textSources`/`isPrivate`; the new fields follow every preexisting public constructor field to preserve positional and `componentN` compatibility
|
||||
* `Utils`:
|
||||
* (`Reply markup`) Added disabled inline-button shortcuts and `forceReply` parameters to inline/reply keyboard builders
|
||||
* (`General`) Added legacy and generated class casts for `MessageGenerationStoppedUpdate`
|
||||
* `API`:
|
||||
* (`Ephemeral messages`) Migrated send/reply extension surfaces to `ephemeralMessageParameters`; added rich ephemeral text editing and caption-above-media support
|
||||
* (`Rich Messages`) Widened `sendRichMessageDraft` and the corresponding generic `send` overload from `ChatId` to `IdChatIdentifier`
|
||||
* (`General`) Migrated direct, streaming-flow, `Chat`, builder, and generic draft-send extensions from `threadId`/`MessageThreadId` to `directMessageThreadId`/`DirectMessageThreadId`
|
||||
* (`Ephemeral messages`) Retained 172 non-deprecated direct and generic `send` overloads accepting `receiverUserId`/`callbackQueryId`/`replaceCallbackQueryMessage` as an alternative API form; every overload delegates to the corresponding `ephemeralMessageParameters` overload
|
||||
* (`Ephemeral messages`) Added named rich-message overloads and generic `InputRichMessage`/`RichMessageContent` aliases across both ephemeral reply families
|
||||
* (`General`) Added `canStop`/`keepOnStop` to `sendMessageDraft`/`sendRichMessageDraft` extension surfaces, including streaming draft flows and `send` overloads
|
||||
* `BehaviourBuilder`:
|
||||
* (`General`) Added `onMessageGenerationStopped`/`waitMessageGenerationStopped` and `onCommunityChatJoined`/community joined event expectations
|
||||
|
||||
## 36.1.0
|
||||
|
||||
* `Dependencies`:
|
||||
* Update `com.gradleup.nmcp.aggregation:com.gradleup.nmcp.aggregation.gradle.plugin` from `1.6.0` to `1.6.1`
|
||||
* Update `com.google.devtools.ksp:symbol-processing-api` from `2.3.9` to `2.3.11`
|
||||
* Update `io.ktor:ktor-client-core` from `3.5.1` to `3.5.2`
|
||||
* Update `dev.inmo:kslog` from `1.6.1` to `1.7.0`
|
||||
* Update `dev.inmo:micro_utils.colors.common` from `0.30.0` to `0.30.1`
|
||||
|
||||
## 36.0.0
|
||||
|
||||
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.2](https://core.telegram.org/bots/api-changelog#july-14-2026)**
|
||||
|
||||
**Breaking changes**:
|
||||
|
||||
* `RichBlockTableCell.align` now uses the string-serialized `RichBlockTableCellAlign` sealed hierarchy (`Left`, `Center`, or `Right`) instead of `String`
|
||||
* `RichBlockTableCell.valign` now uses the string-serialized `RichBlockTableCellVAlign` sealed hierarchy (`Top`, `Middle`, or `Bottom`) instead of `String`
|
||||
* `RichBlockTableCell` is now a sealed interface with `Header` and `Regular` implementations; the input table DSL uses `headerCell` and `cell` respectively
|
||||
* `InputRichBlockListItem` is now a sealed interface with `Ordered` and `Unordered` implementations; ordered items require a non-null `value` and typed `LabelType`, while `LabelType.Decimals` is the default; `InputRichBlocksBuilder` now exposes separate `orderedList` and `unorderedList` DSL functions with matching item builders
|
||||
* `ReplyParameters` is now a sealed interface with nested `ReplyParameters.Chat` and `ReplyParameters.Ephemeral` implementations; overloaded `ReplyParameters(...)` companion factories construct both regular-message and ephemeral-message variants
|
||||
* The 4 group-family message implementations (`CommonGroupContentMessageImpl`, `CommonForumContentMessageImpl`, `CommonChannelDirectMessagesContentMessageImpl`, `CommonSuggestedChannelDirectMessagesContentMessageImpl`) gained trailing `receiverUser`/`ephemeralMessageId` primary-constructor parameters (defaulted to `null`) — positional construction of these classes must be updated
|
||||
* `reply(to = ...)` overloads for the 13 ephemeral-capable senders (see below) now detect an ephemeral `to` target (`to is PossiblyEphemeralMessage && to.ephemeralMessageId != null`) and automatically address the reply through `ephemeral_message_id`, sending the outgoing message itself as ephemeral to the same receiver — this is a behavior change for any existing code that replies to a message carrying a non-null `ephemeralMessageId`
|
||||
|
||||
**Migration advice**: Keep `ReplyParameters(...)` for both chat-message and ephemeral-message targets; explicit `ReplyParameters.Ephemeral(...)` subtype construction also remains available; pass `receiverUser`/`ephemeralMessageId` explicitly (or rely on their `null` default) when constructing the 4 group-family message implementations positionally
|
||||
|
||||
* `Core`:
|
||||
* (`Rich Messages`) Added the raw-string-serialized `RichBlockTableCellVAlign` hierarchy and migrated table-cell vertical alignment from `String` to `RichBlockTableCellVAlign`
|
||||
* (`Rich Messages`) Added the raw-string-serialized `RichBlockTableCellAlign` hierarchy and migrated table-cell alignment from `String` to `RichBlockTableCellAlign`
|
||||
* (`Rich Messages`) Split `RichBlockTableCell` into header/regular variants with a shared flat surrogate serializer; added `headerCell` to the input table DSL
|
||||
* (`Rich Messages`) Added `h1` through `h6` shortcuts for plain and rich-text headings in `InputRichBlocksBuilder`
|
||||
* (`Rich Messages`) Reworked the input table DSL to build cells through nested `table { row { cell(...) { } } }` builders
|
||||
* (`Rich Messages`) Replaced the flat `InputRichBlockListItem` data class with ordered/unordered variants, added the string-serialized `LabelType` hierarchy (`A`, `a`, `I`, `i`, `1`), and split the list DSL into `InputRichBlockOrderedListBuilder`/`InputRichBlockUnorderedListBuilder`
|
||||
* (`Rich Messages`) Added `InputRichBlock` hierarchy with all 21 `InputRichBlock*` types (mirroring the received `RichBlock*` hierarchy and reusing `RichText`/`RichBlockCaption`/`RichBlockTableCell`), the label-less `InputRichBlockListItem` and the `InputRichBlockSerializer`; every `InputRichBlock` exposes `subBlocks` navigation
|
||||
* (`Rich Messages`) Added `TelegramMediaVoiceNote` (`InputMediaVoiceNote`) and the `RichMessageMemberTelegramMedia` marker interface implemented by it, `TelegramMediaAnimation`, `TelegramMediaAudio`, `TelegramMediaPhoto` and `TelegramMediaVideo`; added `VoiceFile.toTelegramMediaVoiceNote` converters
|
||||
* (`Rich Messages`) Added `InputRichMessageMedia` type (media referenced from `InputRichMessage.html`/`.markdown` via `tg://photo?id=`, `tg://video?id=` and `tg://audio?id=` links)
|
||||
* (`Rich Messages`) `InputRichMessage` gained `blocks` and `media` fields ("exactly one of `html`, `markdown` or `blocks` must be used") and the `InputRichMessageBlocks` factory; `InputRichMessageHTML`/`InputRichMessageMarkdown` gained a trailing `media` parameter
|
||||
* (`Rich Messages`) Added Rich Messages input DSL builders `buildInputRichBlocks`/`InputRichBlocksBuilder`, typed ordered/unordered list builders and the `InputRichMessageBlocks { }` builder overload (marked with the `@RichTextDsl` DSL marker)
|
||||
* (`Rich Messages`) `SendRichMessage` now supports `attach://` upload of new files referenced from `InputRichMessage.blocks`/`.media`; `SendRichMessageDraft` now rejects rich messages that require direct file upload (unsupported by the method)
|
||||
* (`Ephemeral Messages`) Added `EphemeralMessageId` value class, `PossiblyEphemeralMessage` (`receiverUser`/`ephemeralMessageId`) and `EphemeralMessageAction` (`receiverUserId`/`ephemeralMessageId`) abstractions
|
||||
* (`Ephemeral Messages`) `RawMessage` parses `receiver_user`/`ephemeral_message_id`; the 4 group-family `Common*ContentMessage` types (`CommonGroupContentMessage`, `CommonForumContentMessage`, `CommonChannelDirectMessagesContentMessage`, `CommonSuggestedChannelDirectMessagesContentMessage`, via the shared `PotentiallyFromUserGroupContentMessage`) now also implement `PossiblyEphemeralMessage`
|
||||
* (`Ephemeral Messages`) `BotCommand` gained the `isEphemeral` field
|
||||
* (`Ephemeral Messages`) `ReplyParameters` became a sealed interface with nested `Chat` and `Ephemeral` implementations and a shared surrogate-backed serializer preserving the flat Bot API JSON shape; added the `Message.ephemeralReplyParametersOrNull()`/`Message.ephemeralReplyReceiverUserIdOrNull` helpers used by the `reply(to = ...)` smart-branch
|
||||
* (`Ephemeral Messages`) `ReplyParameters.Ephemeral` and `Message.ephemeralReplyParametersOrNull()` support and forward `allowSendingWithoutReply`, `checklistTaskId`, and `pollOptionId` together with `ephemeralMessageId`
|
||||
* (`Ephemeral Messages`) Added `receiverUserId`/`callbackQueryId` params (via the new `OptionallyEphemeralSendRequest`) to the 13 ephemeral-capable send requests: `SendTextMessage`, `SendContact`, `SendLocation` (`Static`/`Live`), `SendVenue`, `SendPhotoData`, `SendLivePhotoData`, `SendAudioData`, `SendDocumentData`, `SendVideoData`, `SendAnimationData`, `SendVoiceData`, `SendVideoNoteData`, `SendStickerByFileId`
|
||||
* (`Ephemeral Messages`) Added `EditEphemeralMessageText`/`EditEphemeralMessageMedia`/`EditEphemeralMessageCaption`/`EditEphemeralMessageReplyMarkup` and `DeleteEphemeralMessage` requests (all return `Unit`, mirroring the inline-message edit family); `EditEphemeralMessageMedia` rejects `MultipartFile` media (new file upload is not supported for ephemeral edits)
|
||||
* (`Ephemeral Messages`) Added `EphemeralChatId` (`IdChatIdentifier`, carrying `chatId`/`receiverUser`/`ephemeralMessageId`) and the `ChatIdentifier.receiverUser`/`ChatIdentifier.ephemeralMessageId` extensions (mirroring `ChatIdentifier.threadId`); `FullChatIdentifierSerializer` gained the `chatId/eph/receiverUserChatId/ephemeralMessageId` string format. The nullable `receiverUserId` param of the 13 ephemeral-capable send requests still defaults from the passed `chatId` when it is an `EphemeralChatId`; `DeleteEphemeralMessage` and `EditEphemeralMessageText`/`EditEphemeralMessageCaption`/`EditEphemeralMessageMedia`/`EditEphemeralMessageReplyMarkup` instead keep `receiverUserId`/`ephemeralMessageId` REQUIRED on their primary constructor/factory form, gaining `EphemeralChatId`-taking secondary constructors/factory overloads that source both params from the identifier (throwing `IllegalArgumentException` if it carries no `ephemeralMessageId`)
|
||||
* (`Communities`) Added `CommunityId` value class and `Community` type (`id`/`name`)
|
||||
* (`Communities`) Added `CommunityChatAdded` (`community`) and `CommunityChatRemoved` (fieldless) chat events (`CommonEvent`); `RawMessage` parses `community_chat_added`/`community_chat_removed`
|
||||
* (`Communities`) Added `community` field to `ExtendedChat` (`ChatFullInfo.community`), parsed for `ExtendedChannelChatImpl`, `ExtendedGroupChatImpl`, `ExtendedSupergroupChatImpl`, `ExtendedForumChatImpl`, `ExtendedChannelDirectMessagesChatImpl` and `ExtendedBot`
|
||||
* (`Bot Subscriptions`) Added `BotSubscriptionUpdated` (`user`, `invoicePayload`, `state`) and `BotSubscriptionUpdatedUpdate`; `state` is modeled as the typed sealed `BotSubscriptionUpdated.State` (`Canceled`/`Active`/`Failed`, with an `Unknown` fallback), mirroring `TransactionType`
|
||||
* (`Bot Subscriptions`) `RawUpdate` parses the new `subscription` field; added `UPDATE_SUBSCRIPTION` to `ALL_UPDATES_LIST_WITHOUT_REACTIONS`; `FlowsUpdatesFilter` gained `botSubscriptionUpdatedUpdatesFlow`
|
||||
* `API`:
|
||||
* (`Ephemeral Messages`) Threaded `receiverUserId`/`callbackQueryId` through the `sendXxx`/`send`/`reply`/`replyWithXxx` extensions for the 13 ephemeral-capable senders (`send/Sends.kt`, `send/Replies.kt`, `send/RepliesWithChatsAndMessages.kt` and their per-type extension files); `reply(to = ...)` now automatically sends an ephemeral reply when `to` is itself ephemeral (see Breaking changes)
|
||||
* (`Ephemeral Messages`) Ephemeral-capable `reply(to = ...)` overloads gained `replyToEphemeralMessageId`, defaulting from `PossiblyEphemeralMessage.ephemeralMessageId`; direct and dispatcher overloads forward the explicit target into `ephemeralReplyParametersOrNull`
|
||||
* (`Ephemeral Messages`) Added 48 ephemeral-only `reply`/`replyWithXxx` overloads in `RepliesWithEphemeral.kt` without a `ChatMessage`; each overload requires `replyInChatId`, `receiverUserId`, and `replyToEphemeralMessageId`, with complete content-form and dispatcher parity across the 13 ephemeral-capable senders
|
||||
* (`Ephemeral Messages`) Added `editEphemeralMessageText`/`editEphemeralMessageMedia`/`editEphemeralMessageCaption`/`editEphemeralMessageReplyMarkup` and `deleteEphemeralMessage` `TelegramBot` extensions (the latter also accepts a `PossiblyEphemeralMessage` directly)
|
||||
* (`Ephemeral Messages`) Added explicit `replyToEphemeral`/`replyToEphemeralWithXxx` `TelegramBot` extensions for the 13 ephemeral-capable senders, replying to an ephemeral message by `chatId`/`ephemeralMessageId` without requiring the original `Message` object
|
||||
* (`Ephemeral Messages`) `receiverUserId`/`ephemeralMessageId` params of the edit/delete/`replyToEphemeral*` extensions remain REQUIRED on the `chatId: ChatIdentifier`/`chat: Chat` forms; each `chatId: ChatIdentifier` form additionally gained a convenience overload taking `chatId: EphemeralChatId` (dropping `receiverUserId`/`ephemeralMessageId`) that sources both from the identifier, throwing `IllegalArgumentException` if it carries no `ephemeralMessageId` (the `chat: Chat` forms got no such overload, since `Chat.id` is statically only an `IdChatIdentifier`); `Replies.kt`'s `receiverUserId` default now also checks `replyInChatId.receiverUser` before falling back to `to.ephemeralReplyReceiverUserIdOrNull`
|
||||
* (`Ephemeral Messages`) Not covered by this iteration (follow-up): `createResend`/`ResendMessage` do not carry ephemeral fields (a resend is always a regular message); `handleLiveLocation` and the generic `reply(mediaFile = ...)`/`reply(content = ...)` dispatchers in `RepliesWithChatsAndMessages.kt`'s `copyMessage`/live-location branches are unaffected; `behaviour_builder` triggers/waiters gained no ephemeral-specific helpers
|
||||
* `BehaviourBuilder`:
|
||||
* (`Communities`) Added `onCommunityChatAdded`/`onCommunityChatRemoved` triggers
|
||||
* (`Communities`) Added `waitCommunityChatAdded`/`waitCommunityChatRemoved` and `waitCommunityChatAddedEventsMessages`/`waitCommunityChatRemovedEventsMessages` expectations
|
||||
* (`Bot Subscriptions`) Added `onBotSubscriptionUpdated` trigger, `waitBotSubscriptionUpdated` expectation and `ByUserBotSubscriptionUpdatedMarkerFactory`
|
||||
* `Utils`:
|
||||
* (`Rich Messages`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for the `InputRichBlock` hierarchy, `TelegramMediaVoiceNote` and `RichMessageMemberTelegramMedia`
|
||||
* (`Ephemeral Messages`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for `EphemeralChatId` and `PossiblyEphemeralMessage`
|
||||
* (`Communities`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for `CommunityChatAdded` and `CommunityChatRemoved`
|
||||
* (`Bot Subscriptions`) Added class casts for `BotSubscriptionUpdatedUpdate` (`whenBotSubscriptionUpdatedUpdate`/`asBotSubscriptionUpdatedUpdate`/`requireBotSubscriptionUpdatedUpdate`); regenerated class casts extensions (`botSubscriptionUpdatedUpdateOrNull`/`OrThrow`, `botSubscriptionUpdatedOrNull`/`OrThrow`)
|
||||
|
||||
## 35.1.0
|
||||
|
||||
* `Dependencies`:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#june-11-2026)
|
||||
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#august-24-2026)
|
||||
|
||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||
|
||||
@@ -55,8 +55,22 @@ When a property (or method) can be declared on an interface/class and implemente
|
||||
|
||||
---
|
||||
|
||||
Any type representing an enumerable set of values MUST be implemented as a sealed interface. Every inheritor MUST be declared inside the sealed interface. The sealed interface MUST define the serializer, and every inheritor MUST explicitly use the sealed-interface serializer (for example, `@Serializable(Parent.Serializer::class)`).
|
||||
|
||||
---
|
||||
|
||||
All work MUST be performed in the normal (main) working worktree of the repository. DO NOT create or do the work inside a separate worktree (for example `.claude/worktrees/...`): commits made there leave the main checkout behind and force an extra fast-forward/pull to land the changes. If some environment forces an isolated worktree, fast-forward the main branch onto those commits and continue in the main worktree.
|
||||
|
||||
---
|
||||
|
||||
When a prompt contains a list of several subtasks, run each subtask as its own subagent (one subagent per subtask) instead of doing all of them inline in the main thread.
|
||||
|
||||
---
|
||||
|
||||
For any substantial change, drive it through a three-phase agent pipeline, each phase run as its own subagent(s), and each section/subtask committed separately:
|
||||
|
||||
1. **Plan / Architect** the changes — model range best → medium, best is the most suitable.
|
||||
2. **Coding / implementation** — model range medium → high, medium is the most suitable.
|
||||
3. **Check / validation** — model range high → best, high is the most suitable.
|
||||
|
||||
Model tiers: **best = Fable**, **high = Opus**, **medium = Sonnet**. (Tier names, not the concrete models, are the contract — remap the models if the roster changes.)
|
||||
|
||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=35.1.0
|
||||
library_version=37.0.0
|
||||
|
||||
@@ -8,13 +8,13 @@ javax-activation = "1.1.1"
|
||||
|
||||
korlibs = "5.4.0"
|
||||
uuid = "0.8.4"
|
||||
ktor = "3.5.1"
|
||||
ktor = "3.5.2"
|
||||
|
||||
ksp = "2.3.11"
|
||||
kotlin-poet = "2.3.0"
|
||||
|
||||
microutils = "0.30.0"
|
||||
kslog = "1.6.1"
|
||||
microutils = "0.30.1"
|
||||
kslog = "1.7.0"
|
||||
|
||||
versions = "0.54.0"
|
||||
|
||||
@@ -22,7 +22,7 @@ github-release-plugin = "2.5.2"
|
||||
dokka = "2.2.0"
|
||||
|
||||
validator = "0.18.1"
|
||||
nmcp = "1.6.0"
|
||||
nmcp = "1.6.1"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
package dev.inmo.tgbotapi.extensions.api
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.DeleteEphemeralMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.EphemeralChatId
|
||||
import dev.inmo.tgbotapi.types.EphemeralMessageId
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEphemeralMessage
|
||||
|
||||
public suspend fun TelegramBot.deleteEphemeralMessage(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId
|
||||
): Unit = execute(
|
||||
DeleteEphemeralMessage(chatId, receiverUserId, ephemeralMessageId)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.deleteEphemeralMessage(
|
||||
chatId: EphemeralChatId
|
||||
): Unit = execute(
|
||||
DeleteEphemeralMessage(chatId)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.deleteEphemeralMessage(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId
|
||||
): Unit = deleteEphemeralMessage(chat.id, receiverUserId, ephemeralMessageId)
|
||||
|
||||
/**
|
||||
* Convenience overload requiring [message] to carry non-null [PossiblyEphemeralMessage.receiverUser] and
|
||||
* [PossiblyEphemeralMessage.ephemeralMessageId] (as returned by any of the ephemeral send requests)
|
||||
*/
|
||||
public suspend fun TelegramBot.deleteEphemeralMessage(
|
||||
message: PossiblyEphemeralMessage
|
||||
): Unit = deleteEphemeralMessage(
|
||||
message.chat.id,
|
||||
message.receiverUser ?.id ?: error("Message ${message.messageId} in chat ${message.chat.id} is not ephemeral: receiverUser is null"),
|
||||
message.ephemeralMessageId ?: error("Message ${message.messageId} in chat ${message.chat.id} is not ephemeral: ephemeralMessageId is null")
|
||||
)
|
||||
@@ -27,6 +27,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = execute(
|
||||
PromoteChannelAdministrator(
|
||||
chatId = chatId,
|
||||
@@ -46,6 +47,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -67,6 +69,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChannelAdministrator(
|
||||
chat.id,
|
||||
userId,
|
||||
@@ -85,6 +88,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
@@ -105,6 +109,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChannelAdministrator(
|
||||
chatId,
|
||||
user.id,
|
||||
@@ -123,6 +128,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
@@ -143,6 +149,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChannelAdministrator(
|
||||
chat.id,
|
||||
user.id,
|
||||
@@ -161,4 +168,5 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
@@ -22,6 +22,7 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = execute(
|
||||
PromoteChatMember(
|
||||
chatId = chatId,
|
||||
@@ -35,7 +36,8 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTags = canManageTags
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -52,6 +54,7 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChatAdministrator(
|
||||
chatId = chat.id,
|
||||
userId = userId,
|
||||
@@ -64,7 +67,8 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTags = canManageTags
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
@@ -80,6 +84,7 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChatAdministrator(
|
||||
chatId = chatId,
|
||||
userId = user.id,
|
||||
@@ -92,7 +97,8 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTags = canManageTags
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
@@ -108,6 +114,7 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteChatAdministrator(
|
||||
chatId = chat.id,
|
||||
userId = user.id,
|
||||
@@ -120,5 +127,6 @@ public suspend fun TelegramBot.promoteChatAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTags = canManageTags
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
@@ -28,7 +28,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canManageTags: Boolean? = null
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null
|
||||
): Unit = execute(
|
||||
PromoteChatMember(
|
||||
chatId = chatId,
|
||||
@@ -51,6 +52,7 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -75,7 +77,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canManageTags: Boolean? = null
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null
|
||||
): Unit = promoteChatMember(
|
||||
chat.id,
|
||||
userId,
|
||||
@@ -97,6 +100,7 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
@@ -120,7 +124,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canManageTags: Boolean? = null
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null
|
||||
): Unit = promoteChatMember(
|
||||
chatId,
|
||||
user.id,
|
||||
@@ -142,6 +147,7 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
@Warning("This method is too common. Use it with caution")
|
||||
@@ -165,7 +171,8 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canManageTags: Boolean? = null
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null
|
||||
): Unit = promoteChatMember(
|
||||
chat.id,
|
||||
user.id,
|
||||
@@ -187,4 +194,5 @@ public suspend fun TelegramBot.promoteChatMember(
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
)
|
||||
|
||||
@@ -24,6 +24,7 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = execute(
|
||||
PromoteSupergroupAdministrator(
|
||||
chatId = chatId,
|
||||
@@ -38,7 +39,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics
|
||||
canManageTopics = canManageTopics,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
)
|
||||
|
||||
@@ -56,6 +58,7 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteSupergroupAdministrator(
|
||||
chat.id,
|
||||
userId,
|
||||
@@ -69,7 +72,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics
|
||||
canManageTopics = canManageTopics,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
@@ -86,6 +90,7 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteSupergroupAdministrator(
|
||||
chatId,
|
||||
user.id,
|
||||
@@ -99,7 +104,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics
|
||||
canManageTopics = canManageTopics,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
@@ -116,6 +122,7 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
): Unit = promoteSupergroupAdministrator(
|
||||
chat.id,
|
||||
user.id,
|
||||
@@ -129,5 +136,6 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
|
||||
canPromoteMembers = canPromoteMembers,
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics
|
||||
canManageTopics = canManageTopics,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.edit.caption
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.caption.EditEphemeralMessageCaption
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -0,0 +1,49 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.edit.media
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.media.EditEphemeralMessageMedia
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageMedia(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
media: TelegramFreeMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageMedia(chatId, receiverUserId, ephemeralMessageId, media, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageMedia(
|
||||
chatId: EphemeralChatId,
|
||||
media: TelegramFreeMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageMedia(chatId, media, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageMedia(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
media: TelegramFreeMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageMedia(chat.id, receiverUserId, ephemeralMessageId, media, replyMarkup)
|
||||
@@ -0,0 +1,45 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.edit.reply_markup
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditEphemeralMessageReplyMarkup
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageReplyMarkup(chatId, receiverUserId, ephemeralMessageId, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
|
||||
chatId: EphemeralChatId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageReplyMarkup(chatId, replyMarkup)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageReplyMarkup(chat.id, receiverUserId, ephemeralMessageId, replyMarkup)
|
||||
@@ -0,0 +1,315 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.edit.text
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.text.EditEphemeralMessageText
|
||||
import dev.inmo.tgbotapi.requests.edit.text.EditEphemeralMessageRichText
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||
import dev.inmo.tgbotapi.utils.buildEntities
|
||||
|
||||
/** Edit an ephemeral message with a rich message. */
|
||||
public suspend fun TelegramBot.editEphemeralMessageRichText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
richMessage: InputRichMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
request = EditEphemeralMessageRichText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
richMessage = richMessage,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/** Edit an ephemeral message with a rich message, obtaining recipient and message identifiers from [chatId]. */
|
||||
public suspend fun TelegramBot.editEphemeralMessageRichText(
|
||||
chatId: EphemeralChatId,
|
||||
richMessage: InputRichMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
request = EditEphemeralMessageRichText(
|
||||
chatId = chatId,
|
||||
richMessage = richMessage,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/** Edit an ephemeral message with a rich message. */
|
||||
public suspend fun TelegramBot.editEphemeralMessageRichText(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
richMessage: InputRichMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageRichText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
richMessage = richMessage,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
separator: TextSource? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
||||
* as a builder for that
|
||||
*/
|
||||
public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
chat: Chat,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
separator: String,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@ import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
import dev.inmo.tgbotapi.types.polls.*
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.types.venue.Venue
|
||||
import dev.inmo.tgbotapi.utils.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -58,6 +59,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -75,6 +77,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -96,6 +99,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -111,6 +115,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -274,6 +279,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -290,6 +296,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -311,6 +318,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -326,6 +334,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -352,6 +361,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -369,6 +379,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -391,6 +402,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -407,6 +419,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -429,6 +442,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -448,6 +462,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -472,6 +487,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -491,6 +507,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -524,6 +541,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -546,6 +564,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -569,6 +588,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -591,6 +611,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -608,6 +629,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -623,6 +645,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -736,6 +759,95 @@ public suspend inline fun TelegramBot.reply(
|
||||
)
|
||||
|
||||
|
||||
// Rich 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
|
||||
*/
|
||||
public suspend inline fun TelegramBot.replyRichMessage(
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
richMessage: InputRichMessage,
|
||||
replyInChatId: IdChatIdentifier = toChatId,
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = sendRichMessage(
|
||||
chatId = replyInChatId,
|
||||
richMessage = richMessage,
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = ReplyParameters(
|
||||
toChatId,
|
||||
toMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId
|
||||
),
|
||||
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
|
||||
*/
|
||||
public suspend inline fun TelegramBot.reply(
|
||||
toChatId: IdChatIdentifier,
|
||||
toMessageId: MessageId,
|
||||
richMessage: InputRichMessage,
|
||||
replyInChatId: IdChatIdentifier = toChatId,
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = replyRichMessage(
|
||||
toChatId = toChatId,
|
||||
toMessageId = toMessageId,
|
||||
richMessage = richMessage,
|
||||
replyInChatId = replyInChatId,
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
|
||||
// Animation
|
||||
|
||||
public suspend inline fun TelegramBot.replyWithAnimation(
|
||||
@@ -754,6 +866,7 @@ public suspend inline fun TelegramBot.replyWithAnimation(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -777,6 +890,7 @@ public suspend inline fun TelegramBot.replyWithAnimation(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -801,6 +915,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -823,6 +938,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -847,6 +963,7 @@ public suspend inline fun TelegramBot.replyWithAnimation(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -869,6 +986,7 @@ public suspend inline fun TelegramBot.replyWithAnimation(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -892,6 +1010,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -913,6 +1032,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -939,6 +1059,7 @@ public suspend inline fun TelegramBot.replyWithAudio(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -960,6 +1081,7 @@ public suspend inline fun TelegramBot.replyWithAudio(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -980,6 +1102,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -998,6 +1121,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1020,6 +1144,7 @@ public suspend inline fun TelegramBot.replyWithAudio(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1040,6 +1165,7 @@ public suspend inline fun TelegramBot.replyWithAudio(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1059,6 +1185,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1076,6 +1203,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1099,6 +1227,7 @@ public suspend inline fun TelegramBot.replyWithDocument(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1118,6 +1247,7 @@ public suspend inline fun TelegramBot.replyWithDocument(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1138,6 +1268,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1156,6 +1287,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1176,6 +1308,7 @@ public suspend inline fun TelegramBot.replyWithDocument(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1194,6 +1327,7 @@ public suspend inline fun TelegramBot.replyWithDocument(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1213,6 +1347,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1230,6 +1365,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1379,6 +1515,7 @@ public suspend inline fun TelegramBot.replyWithPhoto(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1398,6 +1535,7 @@ public suspend inline fun TelegramBot.replyWithPhoto(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1419,6 +1557,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1438,6 +1577,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1459,6 +1599,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1478,6 +1619,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1499,6 +1641,7 @@ public suspend inline fun TelegramBot.replyWithPhoto(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1517,6 +1660,7 @@ public suspend inline fun TelegramBot.replyWithPhoto(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1537,6 +1681,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1555,6 +1700,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1575,6 +1721,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1593,6 +1740,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1613,6 +1761,7 @@ public suspend inline fun TelegramBot.replyWithSticker(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -1629,6 +1778,7 @@ public suspend inline fun TelegramBot.replyWithSticker(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -1647,6 +1797,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -1663,6 +1814,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -1692,6 +1844,7 @@ public suspend inline fun TelegramBot.replyWithVideo(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1715,6 +1868,7 @@ public suspend inline fun TelegramBot.replyWithVideo(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1736,6 +1890,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1755,6 +1910,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1779,6 +1935,7 @@ public suspend inline fun TelegramBot.replyWithVideo(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1801,6 +1958,7 @@ public suspend inline fun TelegramBot.replyWithVideo(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1821,6 +1979,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1839,6 +1998,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1864,6 +2024,7 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1884,6 +2045,7 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1905,6 +2067,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1924,6 +2087,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1945,6 +2109,7 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -1964,6 +2129,7 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -1984,6 +2150,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2002,6 +2169,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2025,6 +2193,7 @@ public suspend inline fun TelegramBot.replyWithVideoNote(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2043,6 +2212,7 @@ public suspend inline fun TelegramBot.replyWithVideoNote(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2060,6 +2230,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2075,6 +2246,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2098,6 +2270,7 @@ public suspend inline fun TelegramBot.replyWithVoice(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2116,6 +2289,7 @@ public suspend inline fun TelegramBot.replyWithVoice(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2135,6 +2309,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2152,6 +2327,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2172,6 +2348,7 @@ public suspend inline fun TelegramBot.replyWithVoice(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2189,6 +2366,7 @@ public suspend inline fun TelegramBot.replyWithVoice(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -2207,6 +2385,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -2223,6 +2402,7 @@ public suspend inline fun TelegramBot.reply(
|
||||
threadId = replyInThreadId,
|
||||
directMessageThreadId = replyInDirectMessageThreadId,
|
||||
businessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3318,6 +3498,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -3337,6 +3518,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3355,6 +3537,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3373,6 +3556,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3391,6 +3575,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3409,6 +3594,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3427,6 +3613,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3445,6 +3632,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3463,6 +3651,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3481,6 +3670,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3499,6 +3689,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3522,6 +3713,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -3543,6 +3735,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3563,6 +3756,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3583,6 +3777,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3603,6 +3798,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3623,6 +3819,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3643,6 +3840,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3663,6 +3861,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3685,6 +3884,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
|
||||
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
|
||||
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = replyInChatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -3705,6 +3905,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3724,6 +3925,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3743,6 +3945,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3761,6 +3964,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3780,6 +3984,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3799,6 +4004,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -3818,6 +4024,7 @@ public suspend fun TelegramBot.reply(
|
||||
replyInThreadId = replyInThreadId,
|
||||
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
|
||||
replyInBusinessConnectionId = replyInBusinessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,698 @@
|
||||
@file:Suppress("KDocUnresolvedReference")
|
||||
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
||||
import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
|
||||
/**
|
||||
* Explicit helpers replying directly to an incoming ephemeral message identified by [chatId]/[ephemeralMessageId]
|
||||
* (as opposed to the `reply(to = someMessage, ...)` smart-branch overloads, which detect an ephemeral
|
||||
* [dev.inmo.tgbotapi.types.message.abstracts.PossiblyEphemeralMessage] target automatically). The outgoing message
|
||||
* is itself sent as ephemeral according to [ephemeralMessageParameters] and replies to [ephemeralMessageId].
|
||||
*
|
||||
* Each helper has two forms: one taking an explicit [EphemeralMessageParameters] object plus [EphemeralMessageId], and a convenience overload
|
||||
* taking an [dev.inmo.tgbotapi.types.EphemeralChatId] which sources the parameter object plus message identifier (throwing
|
||||
* [IllegalArgumentException] if it does not carry an `ephemeralMessageId`).
|
||||
*
|
||||
* @see dev.inmo.tgbotapi.types.ephemeralReplyParametersOrNull
|
||||
*/
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralRichMessage(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = sendRichMessage(
|
||||
chatId = chatId,
|
||||
richMessage = richMessage,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = ReplyParameters(
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId
|
||||
),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralRichMessage(
|
||||
chatId: EphemeralChatId,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = replyToEphemeralRichMessage(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
richMessage = richMessage,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeral(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = replyToEphemeralRichMessage(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
richMessage = richMessage,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeral(
|
||||
chatId: EphemeralChatId,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<RichMessageContent> = replyToEphemeralRichMessage(
|
||||
chatId = chatId,
|
||||
richMessage = richMessage,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeral(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<TextContent> = sendMessage(
|
||||
chatId = chatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeral(
|
||||
chatId: EphemeralChatId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<TextContent> = replyToEphemeral(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
chatId: EphemeralChatId,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = replyToEphemeralWithPhoto(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chatId = chatId,
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
chatId: EphemeralChatId,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = replyToEphemeralWithLivePhoto(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
audio: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
chatId: EphemeralChatId,
|
||||
audio: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = replyToEphemeralWithAudio(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
document: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
chatId: EphemeralChatId,
|
||||
document: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<DocumentContent> = replyToEphemeralWithDocument(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
video: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
chatId: EphemeralChatId,
|
||||
video: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = replyToEphemeralWithVideo(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
animation: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
chatId: EphemeralChatId,
|
||||
animation: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = replyToEphemeralWithAnimation(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
chatId: EphemeralChatId,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = replyToEphemeralWithVoice(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
videoNote: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chatId,
|
||||
videoNote = videoNote,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
chatId: EphemeralChatId,
|
||||
videoNote: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = replyToEphemeralWithVideoNote(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
videoNote = videoNote,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
sticker: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
chatId: EphemeralChatId,
|
||||
sticker: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = replyToEphemeralWithSticker(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
sticker = sticker,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Sends a static location (`live_period` is not supported for ephemeral messages, see [SendLocation.Live])
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Sends a static location (`live_period` is not supported for ephemeral messages, see [SendLocation.Live]).
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
chatId: EphemeralChatId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = replyToEphemeralWithLocation(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
title: String,
|
||||
address: String,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
title = title,
|
||||
address = address,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
chatId: EphemeralChatId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
title: String,
|
||||
address: String,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = replyToEphemeralWithVenue(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
title = title,
|
||||
address = address,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
chatId: ChatIdentifier,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = sendContact(
|
||||
chatId = chatId,
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
chatId: EphemeralChatId,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = replyToEphemeralWithContact(
|
||||
chatId = chatId,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
@@ -24,6 +24,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -40,6 +41,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -50,6 +52,42 @@ public suspend fun TelegramBot.sendContact(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendContact(
|
||||
chatId: ChatIdentifier,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = sendContact(
|
||||
chatId = chatId,
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -60,6 +98,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -74,6 +113,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -84,6 +124,38 @@ public suspend fun TelegramBot.sendContact(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendContact(
|
||||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = sendContact(
|
||||
chatId = chatId,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -96,6 +168,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -111,6 +184,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -120,6 +194,42 @@ public suspend fun TelegramBot.sendContact(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendContact(
|
||||
chat: Chat,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
lastName: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = sendContact(
|
||||
chat = chat,
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -130,6 +240,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -143,6 +254,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -151,3 +263,35 @@ public suspend fun TelegramBot.sendContact(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendContact(
|
||||
chat: Chat,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = sendContact(
|
||||
chat = chat,
|
||||
contact = contact,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -27,6 +27,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -46,6 +47,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -56,135 +58,7 @@ public 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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -195,6 +69,9 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -213,20 +90,21 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
@@ -236,6 +114,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -254,6 +133,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -263,11 +143,51 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
location = location,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -278,6 +198,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -296,6 +217,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -305,11 +227,53 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chat = chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
@@ -319,6 +283,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -337,6 +302,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -345,3 +311,381 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chat = chat,
|
||||
location = location,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLiveLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLiveLocation(
|
||||
chatId = chatId,
|
||||
location = location,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLiveLocation(
|
||||
chat = chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLiveLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LiveLocationContent> = sendLiveLocation(
|
||||
chat = chat,
|
||||
location = location,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,22 +18,27 @@ import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.firstOrNull
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlin.js.JsName
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
|
||||
@@ -57,39 +62,54 @@ private suspend fun TelegramBot.sendMessageDraftFlow(
|
||||
|
||||
public val GlobalDraftIdAllocator: DraftIdAllocator by lazy { DraftIdAllocator() }
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlow(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<TextSourcesList>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
draftId: DraftId? = null,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Boolean {
|
||||
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
|
||||
return sendMessageDraftFlow(
|
||||
messagesFlow.map {
|
||||
SendMessageDraft(chatId = chatId, draftId = draftId, entities = it, threadId = threadId)
|
||||
SendMessageDraft(chatId = chatId, draftId = draftId, entities = it, directMessageThreadId = directMessageThreadId, canStop = canStop, keepOnStop = keepOnStop)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlowWithTextsAndParseMode(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<Pair<String, ParseMode?>>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
draftId: DraftId? = null,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Boolean {
|
||||
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
|
||||
return sendMessageDraftFlow(
|
||||
messagesFlow.map {
|
||||
SendMessageDraft(chatId = chatId, draftId = draftId, text = it.first, parseMode = it.second, threadId = threadId)
|
||||
SendMessageDraft(chatId = chatId, draftId = draftId, text = it.first, parseMode = it.second, directMessageThreadId = directMessageThreadId, canStop = canStop, keepOnStop = keepOnStop)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<String>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
draftId: DraftId? = null,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Boolean {
|
||||
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
|
||||
return sendMessageDraftFlowWithTextsAndParseMode(
|
||||
@@ -97,101 +117,152 @@ public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
|
||||
messagesFlow = messagesFlow.map {
|
||||
it.escapeMarkdownV2Common() to MarkdownV2
|
||||
},
|
||||
threadId = threadId,
|
||||
draftId = draftId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
draftId = draftId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = entities,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
entities = entities,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
separator: TextSource? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
separator: String,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
separator: TextSource? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
separator = separator,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop,
|
||||
builderBody = builderBody
|
||||
)
|
||||
|
||||
/**
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
separator: String,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
separator = separator,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop,
|
||||
builderBody = builderBody
|
||||
)
|
||||
|
||||
@@ -17,6 +17,7 @@ public suspend fun TelegramBot.sendRichMessage(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -31,6 +32,7 @@ public suspend fun TelegramBot.sendRichMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -47,6 +49,7 @@ public suspend fun TelegramBot.sendRichMessage(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -60,6 +63,7 @@ public suspend fun TelegramBot.sendRichMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -2,20 +2,28 @@ package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendRichMessageDraft
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
|
||||
/**
|
||||
* @param chatId Numeric target chat identifier.
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendRichMessageDraft(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: Long,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendRichMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
richMessage = richMessage,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -40,6 +41,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -50,117 +52,16 @@ public 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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -175,25 +76,27 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -208,6 +111,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -217,17 +121,50 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
location = location,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -242,6 +179,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -251,16 +189,51 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chat = chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -275,6 +248,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -283,3 +257,309 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chat = chat,
|
||||
location = location,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chatId,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chatId: ChatIdentifier,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
|
||||
chatId = chatId,
|
||||
location = location,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
|
||||
chat = chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
*/
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendLocation(
|
||||
chatId = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendStaticLocation(
|
||||
chat: Chat,
|
||||
location: Location,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
|
||||
chat = chat,
|
||||
location = location,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -31,6 +31,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -52,6 +53,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -62,6 +64,52 @@ public suspend fun TelegramBot.sendVenue(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
title: String,
|
||||
address: String,
|
||||
foursquareId: FoursquareId? = null,
|
||||
foursquareType: FoursquareType? = null,
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
title = title,
|
||||
address = address,
|
||||
foursquareId = foursquareId,
|
||||
foursquareType = foursquareType,
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -79,6 +127,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -99,6 +148,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -108,6 +158,52 @@ public suspend fun TelegramBot.sendVenue(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chat: Chat,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
title: String,
|
||||
address: String,
|
||||
foursquareId: FoursquareId? = null,
|
||||
foursquareType: FoursquareType? = null,
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chat = chat,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
title = title,
|
||||
address = address,
|
||||
foursquareId = foursquareId,
|
||||
foursquareType = foursquareType,
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -124,6 +220,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -144,6 +241,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -153,6 +251,50 @@ public suspend fun TelegramBot.sendVenue(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
location: StaticLocation,
|
||||
title: String,
|
||||
address: String,
|
||||
foursquareId: FoursquareId? = null,
|
||||
foursquareType: FoursquareType? = null,
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chatId = chatId,
|
||||
location = location,
|
||||
title = title,
|
||||
address = address,
|
||||
foursquareId = foursquareId,
|
||||
foursquareType = foursquareType,
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -169,6 +311,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -189,6 +332,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -198,6 +342,50 @@ public suspend fun TelegramBot.sendVenue(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chat: Chat,
|
||||
location: StaticLocation,
|
||||
title: String,
|
||||
address: String,
|
||||
foursquareId: FoursquareId? = null,
|
||||
foursquareType: FoursquareType? = null,
|
||||
googlePlaceId: GooglePlaceId? = null,
|
||||
googlePlaceType: GooglePlaceType? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chat = chat,
|
||||
location = location,
|
||||
title = title,
|
||||
address = address,
|
||||
foursquareId = foursquareId,
|
||||
foursquareType = foursquareType,
|
||||
googlePlaceId = googlePlaceId,
|
||||
googlePlaceType = googlePlaceType,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -208,6 +396,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -222,6 +411,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -232,6 +422,38 @@ public suspend fun TelegramBot.sendVenue(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chatId = chatId,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -242,6 +464,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -255,6 +478,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -263,3 +487,35 @@ public suspend fun TelegramBot.sendVenue(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVenue(
|
||||
chat: Chat,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = sendVenue(
|
||||
chat = chat,
|
||||
venue = venue,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -56,6 +57,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -66,6 +68,54 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -83,6 +133,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -104,6 +155,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -113,6 +165,52 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
animation: AnimationFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -131,6 +229,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -152,6 +251,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -161,6 +261,54 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chat: Chat,
|
||||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chat = chat,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -178,6 +326,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -198,6 +347,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -207,6 +357,52 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chat: Chat,
|
||||
animation: AnimationFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chat = chat,
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -225,6 +421,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -246,6 +443,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -256,6 +454,52 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -272,6 +516,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -292,6 +537,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -301,6 +547,50 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
animation: AnimationFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -318,6 +608,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -338,6 +629,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -347,6 +639,52 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chat: Chat,
|
||||
animation: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chat = chat,
|
||||
animation = animation,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -363,6 +701,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -382,6 +721,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -390,3 +730,47 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAnimation(
|
||||
chat: Chat,
|
||||
animation: AnimationFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = sendAnimation(
|
||||
chat = chat,
|
||||
animation = animation,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -30,6 +30,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -50,6 +51,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -60,6 +62,50 @@ public suspend fun TelegramBot.sendAudio(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAudio(
|
||||
chatId: ChatIdentifier,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -76,6 +122,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -95,6 +142,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -104,6 +152,50 @@ public suspend fun TelegramBot.sendAudio(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAudio(
|
||||
chat: Chat,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chat = chat,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -117,6 +209,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -136,6 +229,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -145,6 +239,44 @@ public suspend fun TelegramBot.sendAudio(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAudio(
|
||||
chatId: ChatIdentifier,
|
||||
audio: AudioFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -158,6 +290,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -174,6 +307,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -183,6 +317,44 @@ public suspend fun TelegramBot.sendAudio(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendAudio(
|
||||
chat: Chat,
|
||||
audio: AudioFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chat = chat,
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -199,6 +371,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -218,6 +391,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -228,6 +402,48 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendAudio(
|
||||
chatId: ChatIdentifier,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -243,6 +459,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -261,6 +478,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -270,6 +488,48 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendAudio(
|
||||
chat: Chat,
|
||||
audio: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chat = chat,
|
||||
audio = audio,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
performer = performer,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -282,6 +542,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -300,6 +561,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -309,6 +571,42 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendAudio(
|
||||
chatId: ChatIdentifier,
|
||||
audio: AudioFile,
|
||||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chatId = chatId,
|
||||
audio = audio,
|
||||
entities = entities,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -321,6 +619,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -336,6 +635,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -344,3 +644,39 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendAudio(
|
||||
chat: Chat,
|
||||
audio: AudioFile,
|
||||
entities: TextSourcesList,
|
||||
title: String? = audio.title,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = sendAudio(
|
||||
chat = chat,
|
||||
audio = audio,
|
||||
entities = entities,
|
||||
title = title,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -27,6 +27,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -45,6 +46,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -56,6 +58,46 @@ public suspend fun TelegramBot.sendDocument(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendDocument(
|
||||
chatId: ChatIdentifier,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -69,6 +111,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -86,6 +129,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -96,6 +140,46 @@ public suspend fun TelegramBot.sendDocument(
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendDocument(
|
||||
chat: Chat,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chat = chat,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -108,6 +192,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -125,6 +210,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -135,6 +221,44 @@ public suspend fun TelegramBot.sendDocument(
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendDocument(
|
||||
chatId: ChatIdentifier,
|
||||
document: DocumentFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -147,6 +271,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -163,6 +288,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -173,6 +299,44 @@ public suspend fun TelegramBot.sendDocument(
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendDocument(
|
||||
chat: Chat,
|
||||
document: DocumentFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chat = chat,
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -185,6 +349,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -202,6 +367,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -213,6 +379,44 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendDocument(
|
||||
chatId: ChatIdentifier,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -225,6 +429,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -241,6 +446,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -251,6 +457,44 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendDocument(
|
||||
chat: Chat,
|
||||
document: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chat = chat,
|
||||
document = document,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -262,6 +506,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -278,6 +523,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -288,6 +534,42 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendDocument(
|
||||
chatId: ChatIdentifier,
|
||||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chatId = chatId,
|
||||
document = document,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -299,6 +581,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -314,6 +597,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -323,3 +607,39 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendDocument(
|
||||
chat: Chat,
|
||||
document: DocumentFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null,
|
||||
disableContentTypeDetection: Boolean? = null
|
||||
): ChatContentMessage<DocumentContent> = sendDocument(
|
||||
chat = chat,
|
||||
document = document,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
disableContentTypeDetection = disableContentTypeDetection,
|
||||
)
|
||||
|
||||
@@ -31,6 +31,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -50,6 +51,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -60,6 +62,48 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chatId = chatId,
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -74,6 +118,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -92,6 +137,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -101,6 +147,46 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
livePhoto: LivePhotoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chatId = chatId,
|
||||
livePhoto = livePhoto,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -116,6 +202,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -134,6 +221,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -143,6 +231,48 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLivePhoto(
|
||||
chat: Chat,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chat = chat,
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -157,6 +287,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -174,6 +305,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -183,6 +315,46 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendLivePhoto(
|
||||
chat: Chat,
|
||||
livePhoto: LivePhotoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chat = chat,
|
||||
livePhoto = livePhoto,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -197,6 +369,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -215,6 +388,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -225,6 +399,46 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chatId = chatId,
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -238,6 +452,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -255,6 +470,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -264,6 +480,44 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
livePhoto: LivePhotoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chatId = chatId,
|
||||
livePhoto = livePhoto,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -278,6 +532,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -295,6 +550,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -304,6 +560,46 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
chat: Chat,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chat = chat,
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -317,6 +613,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -333,6 +630,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -341,3 +639,41 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
chat: Chat,
|
||||
livePhoto: LivePhotoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
|
||||
chat = chat,
|
||||
livePhoto = livePhoto,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -30,6 +30,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -48,6 +49,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -58,6 +60,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
fileId: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -72,6 +114,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -89,6 +132,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -98,6 +142,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
fileId: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
fileId = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -112,6 +196,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -129,6 +214,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -138,6 +224,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
photo: PhotoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -152,6 +278,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -169,6 +296,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -178,6 +306,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
photo: PhotoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -192,6 +360,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -209,6 +378,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -218,6 +388,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
photoSize: PhotoSize,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
photoSize = photoSize,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -232,6 +442,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -249,6 +460,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -258,6 +470,46 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
photoSize: PhotoSize,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
photoSize = photoSize,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -272,6 +524,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -289,6 +542,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -299,6 +553,44 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
fileId: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
fileId = fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -312,6 +604,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -328,6 +621,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -337,6 +631,44 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
fileId: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
fileId = fileId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -350,6 +682,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -366,6 +699,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -375,6 +709,44 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
photo: PhotoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
photo = photo,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -388,6 +760,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -404,6 +777,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -413,6 +787,44 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
photo: PhotoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
photo = photo,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -426,6 +838,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -442,6 +855,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -451,6 +865,44 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
photoSize: PhotoSize,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chatId = chatId,
|
||||
photoSize = photoSize,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -464,6 +916,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -480,6 +933,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -488,3 +942,41 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendPhoto(
|
||||
chat: Chat,
|
||||
photoSize: PhotoSize,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = sendPhoto(
|
||||
chat = chat,
|
||||
photoSize = photoSize,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -24,6 +24,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -39,6 +40,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -50,6 +52,40 @@ public suspend fun TelegramBot.sendSticker(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -60,6 +96,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -74,6 +111,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -84,6 +122,40 @@ public suspend fun TelegramBot.sendSticker(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendSticker(
|
||||
chat: Chat,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chat = chat,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -94,6 +166,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -108,6 +181,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -118,6 +192,40 @@ public suspend fun TelegramBot.sendSticker(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -128,6 +236,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -142,6 +251,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -151,3 +261,37 @@ public suspend fun TelegramBot.sendSticker(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendSticker(
|
||||
chat: Chat,
|
||||
sticker: Sticker,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chat = chat,
|
||||
sticker = sticker,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -37,6 +37,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -62,6 +63,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -72,6 +74,60 @@ public suspend fun TelegramBot.sendVideo(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideo(
|
||||
chatId: ChatIdentifier,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -87,6 +143,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -111,6 +168,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -120,6 +178,48 @@ public suspend fun TelegramBot.sendVideo(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideo(
|
||||
chatId: ChatIdentifier,
|
||||
video: VideoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -141,6 +241,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -165,6 +266,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -174,6 +276,60 @@ public suspend fun TelegramBot.sendVideo(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideo(
|
||||
chat: Chat,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chat = chat,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -190,6 +346,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -208,6 +365,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -217,6 +375,48 @@ public suspend fun TelegramBot.sendVideo(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideo(
|
||||
chat: Chat,
|
||||
video: VideoFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chat = chat,
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -237,6 +437,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -261,6 +462,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -271,6 +473,58 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVideo(
|
||||
chatId: ChatIdentifier,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -285,6 +539,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -308,6 +563,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -317,6 +573,46 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVideo(
|
||||
chatId: ChatIdentifier,
|
||||
video: VideoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -337,6 +633,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -360,6 +657,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -369,6 +667,58 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVideo(
|
||||
chat: Chat,
|
||||
video: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
cover: InputFile? = null,
|
||||
startTimestamp: Seconds? = null,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chat = chat,
|
||||
video = video,
|
||||
thumb = thumb,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
cover = cover,
|
||||
startTimestamp = startTimestamp,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -384,6 +734,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -401,6 +752,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -409,3 +761,43 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVideo(
|
||||
chat: Chat,
|
||||
video: VideoFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = sendVideo(
|
||||
chat = chat,
|
||||
video = video,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -42,6 +43,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -52,6 +54,44 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
videoNote: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chatId,
|
||||
videoNote = videoNote,
|
||||
thumb = thumb,
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -62,6 +102,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -78,6 +119,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -87,6 +129,38 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chatId,
|
||||
videoNote = videoNote,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -100,6 +174,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -116,6 +191,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -125,6 +201,44 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideoNote(
|
||||
chat: Chat,
|
||||
videoNote: InputFile,
|
||||
thumb: InputFile? = null,
|
||||
duration: Long? = null,
|
||||
size: Int? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chat = chat,
|
||||
videoNote = videoNote,
|
||||
thumb = thumb,
|
||||
duration = duration,
|
||||
size = size,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -135,6 +249,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -148,6 +263,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -156,3 +272,35 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVideoNote(
|
||||
chat: Chat,
|
||||
videoNote: VideoNoteFile,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chat = chat,
|
||||
videoNote = videoNote,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -27,6 +27,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -44,6 +45,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -54,6 +56,44 @@ public suspend fun TelegramBot.sendVoice(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVoice(
|
||||
chatId: ChatIdentifier,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -67,6 +107,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -83,6 +124,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -92,6 +134,44 @@ public suspend fun TelegramBot.sendVoice(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVoice(
|
||||
chat: Chat,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chat = chat,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -104,6 +184,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -120,6 +201,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -129,6 +211,42 @@ public suspend fun TelegramBot.sendVoice(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVoice(
|
||||
chatId: ChatIdentifier,
|
||||
voice: VoiceFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -141,6 +259,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -156,6 +275,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -165,6 +285,42 @@ public suspend fun TelegramBot.sendVoice(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend fun TelegramBot.sendVoice(
|
||||
chat: Chat,
|
||||
voice: VoiceFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chat = chat,
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
@@ -178,6 +334,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -193,6 +350,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
duration = duration,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -204,6 +362,42 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
)
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVoice(
|
||||
chatId: ChatIdentifier,
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -216,6 +410,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -231,6 +426,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -240,6 +436,42 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVoice(
|
||||
chat: Chat,
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chat = chat,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
duration = duration,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -251,6 +483,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -266,6 +499,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -274,6 +508,40 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVoice(
|
||||
chatId: ChatIdentifier,
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chatId = chatId,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
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
|
||||
@@ -285,6 +553,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -299,6 +568,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -307,3 +577,37 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
public suspend inline fun TelegramBot.sendVoice(
|
||||
chat: Chat,
|
||||
voice: VoiceFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
effectId: EffectId? = null,
|
||||
suggestedPostParameters: SuggestedPostParameters? = null,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = sendVoice(
|
||||
chat = chat,
|
||||
voice = voice,
|
||||
entities = entities,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = receiverUserId ?.let { EphemeralMessageParameters(it, callbackQueryId, replaceCallbackQueryMessage) },
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
effectId = effectId,
|
||||
suggestedPostParameters = suggestedPostParameters,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.RequestsExecutor
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.SendContact
|
||||
import dev.inmo.tgbotapi.types.CallbackQueryId
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.Contact
|
||||
import dev.inmo.tgbotapi.types.EphemeralMessageParameters
|
||||
import dev.inmo.tgbotapi.types.RawChatId
|
||||
import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
import kotlin.coroutines.startCoroutine
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNull
|
||||
import kotlin.test.assertSame
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class EphemeralRawSendOverloadsTest {
|
||||
private object RequestCaptured : Throwable()
|
||||
|
||||
private class CapturingBot : RequestsExecutor {
|
||||
lateinit var request: Request<*>
|
||||
|
||||
override suspend fun <T : Any> execute(request: Request<T>): T {
|
||||
this.request = request
|
||||
throw RequestCaptured
|
||||
}
|
||||
|
||||
override fun close() = Unit
|
||||
}
|
||||
|
||||
private fun CapturingBot.capture(block: suspend CapturingBot.() -> Unit): Request<*> {
|
||||
var completion: Result<Unit>? = null
|
||||
block.startCoroutine(
|
||||
this,
|
||||
object : Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
completion = result
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
val completed = completion ?: error("Request coroutine did not complete synchronously")
|
||||
assertTrue(completed.isFailure)
|
||||
assertSame(RequestCaptured, completed.exceptionOrNull())
|
||||
return request
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rawDirectOverloadForwardsAllEphemeralParameters() {
|
||||
val chatId = ChatId(RawChatId(1L))
|
||||
val receiverUserId = ChatId(RawChatId(2L))
|
||||
val callbackQueryId = CallbackQueryId("direct-callback")
|
||||
val request = CapturingBot().capture {
|
||||
sendContact(
|
||||
chatId = chatId,
|
||||
phoneNumber = "+10000000000",
|
||||
firstName = "Direct",
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
replaceCallbackQueryMessage = true
|
||||
)
|
||||
} as SendContact
|
||||
|
||||
assertEquals(
|
||||
EphemeralMessageParameters(receiverUserId, callbackQueryId, true),
|
||||
request.ephemeralMessageParameters
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rawGenericOverloadForwardsAllEphemeralParameters() {
|
||||
val chatId = ChatId(RawChatId(3L))
|
||||
val receiverUserId = ChatId(RawChatId(4L))
|
||||
val callbackQueryId = CallbackQueryId("generic-callback")
|
||||
val request = CapturingBot().capture {
|
||||
send(
|
||||
chatId = chatId,
|
||||
contact = Contact("+10000000001", "Generic"),
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
replaceCallbackQueryMessage = false
|
||||
)
|
||||
} as SendContact
|
||||
|
||||
assertEquals(
|
||||
EphemeralMessageParameters(receiverUserId, callbackQueryId, false),
|
||||
request.ephemeralMessageParameters
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parameterObjectAndDefaultFormsRemainResolvable() {
|
||||
val chatId = ChatId(RawChatId(5L))
|
||||
val defaultRequest = CapturingBot().capture {
|
||||
sendContact(
|
||||
chatId = chatId,
|
||||
phoneNumber = "+10000000002",
|
||||
firstName = "Default"
|
||||
)
|
||||
} as SendContact
|
||||
assertNull(defaultRequest.ephemeralMessageParameters)
|
||||
|
||||
val ephemeralMessageParameters = EphemeralMessageParameters(
|
||||
receiverUserId = ChatId(RawChatId(6L)),
|
||||
callbackQueryId = CallbackQueryId("object-callback"),
|
||||
replaceCallbackQueryMessage = true
|
||||
)
|
||||
val objectRequest = CapturingBot().capture {
|
||||
sendContact(
|
||||
chatId = chatId,
|
||||
phoneNumber = "+10000000003",
|
||||
firstName = "Object",
|
||||
ephemeralMessageParameters = ephemeralMessageParameters
|
||||
)
|
||||
} as SendContact
|
||||
|
||||
assertEquals(ephemeralMessageParameters, objectRequest.ephemeralMessageParameters)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.RequestsExecutor
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.SendMessageDraft
|
||||
import dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.DraftId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.RawChatId
|
||||
import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
import kotlin.coroutines.startCoroutine
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertIs
|
||||
import kotlin.test.assertSame
|
||||
|
||||
class SendMessageDraftTest {
|
||||
private object RequestCaptured : Throwable()
|
||||
|
||||
private class CapturingBot : RequestsExecutor {
|
||||
lateinit var request: Request<*>
|
||||
|
||||
override suspend fun <T : Any> execute(request: Request<T>): T {
|
||||
this.request = request
|
||||
throw RequestCaptured
|
||||
}
|
||||
|
||||
override fun close() = Unit
|
||||
}
|
||||
|
||||
private fun CapturingBot.capture(block: suspend CapturingBot.() -> Unit): Request<*> {
|
||||
var completion: Result<Unit>? = null
|
||||
block.startCoroutine(
|
||||
this,
|
||||
object : Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
completion = result
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
val completed = completion ?: error("Request coroutine did not complete synchronously")
|
||||
assertSame(RequestCaptured, completed.exceptionOrNull())
|
||||
return request
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directExtensionForwardsDirectMessageThreadId() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(
|
||||
RawChatId(1L),
|
||||
DirectMessageThreadId(2L)
|
||||
)
|
||||
val request = assertIs<SendMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
sendMessageDraft(
|
||||
chatId,
|
||||
DraftId(3L),
|
||||
"direct",
|
||||
directMessageThreadId = DirectMessageThreadId(7L)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(DirectMessageThreadId(7L), request.directMessageThreadId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun genericExtensionForwardsDirectMessageThreadId() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(
|
||||
RawChatId(4L),
|
||||
DirectMessageThreadId(5L)
|
||||
)
|
||||
val request = assertIs<SendMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
send(chatId, DraftId(6L), "generic")
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(DirectMessageThreadId(5L), request.directMessageThreadId)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.send
|
||||
|
||||
import dev.inmo.tgbotapi.bot.RequestsExecutor
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.SendRichMessageDraft
|
||||
import dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.RawChatId
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessageHTML
|
||||
import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
import kotlin.coroutines.startCoroutine
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertIs
|
||||
import kotlin.test.assertSame
|
||||
|
||||
class SendRichMessageDraftTest {
|
||||
private object RequestCaptured : Throwable()
|
||||
|
||||
private class CapturingBot : RequestsExecutor {
|
||||
lateinit var request: Request<*>
|
||||
|
||||
override suspend fun <T : Any> execute(request: Request<T>): T {
|
||||
this.request = request
|
||||
throw RequestCaptured
|
||||
}
|
||||
|
||||
override fun close() = Unit
|
||||
}
|
||||
|
||||
private fun CapturingBot.capture(block: suspend CapturingBot.() -> Unit): Request<*> {
|
||||
var completion: Result<Unit>? = null
|
||||
block.startCoroutine(
|
||||
this,
|
||||
object : Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
completion = result
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
val completed = completion ?: error("Request coroutine did not complete synchronously")
|
||||
assertSame(RequestCaptured, completed.exceptionOrNull())
|
||||
return request
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directExtensionAcceptsIdChatIdentifier() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(RawChatId(1L), DirectMessageThreadId(2L))
|
||||
val request = assertIs<SendRichMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
sendRichMessageDraft(
|
||||
chatId,
|
||||
3L,
|
||||
InputRichMessageHTML("direct"),
|
||||
directMessageThreadId = DirectMessageThreadId(7L)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(DirectMessageThreadId(7L), request.directMessageThreadId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun genericExtensionAcceptsIdChatIdentifier() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(RawChatId(4L), DirectMessageThreadId(5L))
|
||||
val request = assertIs<SendRichMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
send(chatId, 6L, InputRichMessageHTML("generic"))
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(DirectMessageThreadId(5L), request.directMessageThreadId)
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getAllowedUpdates ()Ljava/util/List;
|
||||
public fun getAsUpdateReceiver ()Lkotlin/jvm/functions/Function2;
|
||||
public fun getBot ()Ldev/inmo/tgbotapi/bot/RequestsExecutor;
|
||||
public fun getBotSubscriptionUpdatedUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getBusinessConnectionUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getBusinessMessageUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getCallbackQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -108,6 +109,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getInlineQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getLog ()Ldev/inmo/kslog/common/KSLog;
|
||||
public fun getManagedBotUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessageGenerationStoppedUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMyChatMemberUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
|
||||
@@ -166,6 +166,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/B
|
||||
public static synthetic fun expectOne$default (Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitBotSubscriptionUpdatedKt {
|
||||
public static final fun waitBotSubscriptionUpdated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitBotSubscriptionUpdated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitBusinessConnectionKt {
|
||||
public static final fun waitBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -658,6 +663,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommonEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommonEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatJoined (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatJoined$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatRemoved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatRemoved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeleteChatPhotoEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeleteChatPhotoEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitForumTopicClosed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -779,6 +790,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitChatSharedRequestEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommonEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommonEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatAddedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatJoinedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatJoinedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitCommunityChatRemovedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitCommunityChatRemovedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitDeleteChatPhotoEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDeleteChatPhotoEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitForumTopicClosedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -940,6 +957,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitContentMessageWithTextMentions$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMessageGenerationStoppedKt {
|
||||
public static final fun waitMessageGenerationStopped (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitMessageGenerationStopped$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPaidMediaPurchasedKt {
|
||||
public static final fun waitPaidMediaPurchased (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static final fun waitPaidMediaPurchased (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -1024,6 +1046,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/filters/Messag
|
||||
public static final fun getMessageFilterForums ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BotSubscriptionUpdatedTriggersKt {
|
||||
public static final fun onBotSubscriptionUpdated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onBotSubscriptionUpdated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggersKt {
|
||||
public static final fun onBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
@@ -1419,6 +1446,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommonEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommonEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommunityChatAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommunityChatAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommunityChatJoined (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommunityChatJoined$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onCommunityChatRemoved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onCommunityChatRemoved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onDeleteChatPhoto (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onDeleteChatPhoto$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onForumTopicClosed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
@@ -1655,6 +1688,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onTextMentionWithVoiceContent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MessageGenerationStoppedTriggersKt {
|
||||
public static final fun onMessageGenerationStopped (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onMessageGenerationStopped$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PaidMediaPurchasedTriggersKt {
|
||||
public static final fun onPaidMediaPurchased (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static final fun onPaidMediaPurchased (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
@@ -1828,6 +1866,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
|
||||
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatMessageGenerationStoppedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatMessageGenerationStoppedMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/MessageGenerationStopped;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatMessageMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByChatMessageMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
@@ -1870,6 +1914,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
|
||||
public fun invoke-ErVIubg (Ldev/inmo/tgbotapi/types/polls/Poll;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBotSubscriptionUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBotSubscriptionUpdatedMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/payments/BotSubscriptionUpdated;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.utils.botSubscriptionUpdatedUpdateOrNull
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
fun BehaviourContext.waitBotSubscriptionUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<BotSubscriptionUpdated> = expectFlow(
|
||||
initRequest,
|
||||
errorFactory
|
||||
) {
|
||||
(it.botSubscriptionUpdatedUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||
}
|
||||
@@ -10,6 +10,9 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatJoined
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
|
||||
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
|
||||
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
|
||||
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
|
||||
@@ -327,6 +330,21 @@ fun BehaviourContext.waitSuggestedPostRefunded(
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostRefunded>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatAdded(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<CommunityChatAdded>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatJoined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<CommunityChatJoined>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatRemoved(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<CommunityChatRemoved>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostDeclined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
|
||||
@@ -7,6 +7,9 @@ import dev.inmo.tgbotapi.extensions.utils.*
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatJoined
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
|
||||
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||
@@ -251,3 +254,18 @@ fun BehaviourContext.waitUniqueGiftSentOrReceivedMessages(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEventsMessages<GiftSentOrReceivedEvent.UniqueGift>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatAddedEventsMessages(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEventsMessages<CommunityChatAdded>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatJoinedEventsMessages(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEventsMessages<CommunityChatJoined>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitCommunityChatRemovedEventsMessages(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEventsMessages<CommunityChatRemoved>(initRequest, errorFactory)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.utils.messageGenerationStoppedUpdateOrNull
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.MessageGenerationStopped
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
fun BehaviourContext.waitMessageGenerationStopped(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<MessageGenerationStopped> = expectFlow(
|
||||
initRequest,
|
||||
errorFactory
|
||||
) {
|
||||
(it.messageGenerationStoppedUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBotSubscriptionUpdatedMarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.utils.botSubscriptionUpdatedUpdateOrNull
|
||||
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onBotSubscriptionUpdated(
|
||||
initialFilter: SimpleFilter<BotSubscriptionUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BotSubscriptionUpdated, Update>? = null,
|
||||
markerFactory: MarkerFactory<in BotSubscriptionUpdated, Any>? = ByUserBotSubscriptionUpdatedMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, BotSubscriptionUpdated>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BotSubscriptionUpdated>
|
||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
|
||||
(it.botSubscriptionUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||
}
|
||||
@@ -15,6 +15,9 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatJoined
|
||||
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
|
||||
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
|
||||
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
|
||||
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
|
||||
@@ -1452,3 +1455,66 @@ fun <BC : BehaviourContext> BC.onSuggestedPostRefunded(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onCommunityChatAdded(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<CommunityChatAdded>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommunityChatAdded>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<CommunityChatAdded>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<CommunityChatAdded>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommunityChatAdded>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onCommunityChatJoined(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<CommunityChatJoined>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommunityChatJoined>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<CommunityChatJoined>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<CommunityChatJoined>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommunityChatJoined>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onCommunityChatRemoved(
|
||||
initialFilter: SimpleFilter<ChatEventMessage<CommunityChatRemoved>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommunityChatRemoved>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChatEventMessage<CommunityChatRemoved>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<CommunityChatRemoved>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommunityChatRemoved>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageGenerationStoppedMarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.utils.messageGenerationStoppedUpdateOrNull
|
||||
import dev.inmo.tgbotapi.types.MessageGenerationStopped
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onMessageGenerationStopped(
|
||||
initialFilter: SimpleFilter<MessageGenerationStopped>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, MessageGenerationStopped, Update>? = null,
|
||||
markerFactory: MarkerFactory<in MessageGenerationStopped, Any>? = ByChatMessageGenerationStoppedMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, MessageGenerationStopped>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageGenerationStopped>
|
||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
|
||||
(it.messageGenerationStoppedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
|
||||
|
||||
import dev.inmo.tgbotapi.types.MessageGenerationStopped
|
||||
|
||||
object ByChatMessageGenerationStoppedMarkerFactory : MarkerFactory<MessageGenerationStopped, Any> {
|
||||
override suspend fun invoke(data: MessageGenerationStopped) = data.chat.id
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
|
||||
|
||||
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
|
||||
|
||||
object ByUserBotSubscriptionUpdatedMarkerFactory : MarkerFactory<BotSubscriptionUpdated, Any> {
|
||||
override suspend fun invoke(data: BotSubscriptionUpdated) = data.user
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
package dev.inmo.tgbotapi.abstracts.types
|
||||
|
||||
import dev.inmo.tgbotapi.types.EphemeralMessageId
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
|
||||
interface EphemeralMessageAction : ChatRequest {
|
||||
val receiverUserId: UserId
|
||||
val ephemeralMessageId: EphemeralMessageId
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package dev.inmo.tgbotapi.requests
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.EphemeralMessageAction
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
@Serializable
|
||||
data class DeleteEphemeralMessage(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(receiverUserIdField)
|
||||
@EncodeDefault
|
||||
override val receiverUserId: UserId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(ephemeralMessageIdField)
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId
|
||||
) : SimpleRequest<Unit>, EphemeralMessageAction {
|
||||
constructor(
|
||||
chatId: EphemeralChatId
|
||||
): this(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" }
|
||||
)
|
||||
|
||||
override fun method(): String = "deleteEphemeralMessage"
|
||||
|
||||
override val resultDeserializer: DeserializationStrategy<Unit>
|
||||
get() = UnitFromBooleanSerializer
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -52,6 +52,8 @@ data class PromoteChatMember(
|
||||
private val canManageDirectMessages: Boolean? = null,
|
||||
@SerialName(canManageTagsField)
|
||||
private val canManageTags: Boolean? = null,
|
||||
@SerialName(canSendWelcomeMessagesField)
|
||||
private val canSendWelcomeMessages: Boolean? = null,
|
||||
) : ChatMemberRequest<Unit>, UntilDate {
|
||||
override fun method(): String = "promoteChatMember"
|
||||
override val resultDeserializer: DeserializationStrategy<Unit>
|
||||
@@ -73,6 +75,7 @@ fun PromoteChatMember(
|
||||
canManageVideoChats: Boolean? = null,
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
) = PromoteChatMember(
|
||||
chatId = chatId,
|
||||
userId = userId,
|
||||
@@ -89,6 +92,7 @@ fun PromoteChatMember(
|
||||
canManageVideoChats = canManageVideoChats,
|
||||
canManageChat = canManageChat,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
canManageTopics = null,
|
||||
canPostStories = null,
|
||||
canEditStories = null,
|
||||
@@ -113,6 +117,7 @@ fun PromoteChannelAdministrator(
|
||||
canEditStories: Boolean? = null,
|
||||
canDeleteStories: Boolean? = null,
|
||||
canManageDirectMessages: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
) = PromoteChatMember(
|
||||
chatId = chatId,
|
||||
userId = userId,
|
||||
@@ -132,7 +137,8 @@ fun PromoteChannelAdministrator(
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories,
|
||||
canManageDirectMessages = canManageDirectMessages
|
||||
canManageDirectMessages = canManageDirectMessages,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
|
||||
fun PromoteSupergroupAdministrator(
|
||||
@@ -150,6 +156,7 @@ fun PromoteSupergroupAdministrator(
|
||||
canManageChat: Boolean? = null,
|
||||
canManageTopics: Boolean? = null,
|
||||
canManageTags: Boolean? = null,
|
||||
canSendWelcomeMessages: Boolean? = null,
|
||||
) = PromoteChatMember(
|
||||
chatId = chatId,
|
||||
userId = userId,
|
||||
@@ -167,6 +174,7 @@ fun PromoteSupergroupAdministrator(
|
||||
canManageChat = canManageChat,
|
||||
canManageTopics = canManageTopics,
|
||||
canManageTags = canManageTags,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages,
|
||||
canPostStories = null,
|
||||
canEditStories = null,
|
||||
canDeleteStories = null
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.EphemeralMessageAction
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
interface EditEphemeralMessage : SimpleRequest<Unit>, EphemeralMessageAction {
|
||||
override val resultDeserializer: DeserializationStrategy<Unit>
|
||||
get() = UnitFromBooleanSerializer
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.caption
|
||||
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import kotlinx.serialization.*
|
||||
|
||||
const val editEphemeralMessageCaptionMethod = "editEphemeralMessageCaption"
|
||||
|
||||
fun EditEphemeralMessageCaption(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = caption,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageCaption(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable
|
||||
data class EditEphemeralMessageCaption internal constructor(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(receiverUserIdField)
|
||||
@EncodeDefault
|
||||
override val receiverUserId: UserId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(ephemeralMessageIdField)
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId,
|
||||
@SerialName(captionField)
|
||||
override val text: String? = null,
|
||||
@SerialName(parseModeField)
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
val showCaptionAboveMedia: Boolean? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditEphemeralMessage, EditTextChatMessage, EditReplyMessage {
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
}
|
||||
|
||||
override fun method(): String = editEphemeralMessageCaptionMethod
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -6,7 +6,10 @@ import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.media.CoveredTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.PhotoedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||
import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -34,9 +37,12 @@ data class EditChatMessageMedia(
|
||||
override val data: SimpleRequest<ContentMessage<MediaContent>>
|
||||
get() = this
|
||||
override val mediaMap: Map<String, MultipartFile> by lazy {
|
||||
(media.file as? MultipartFile) ?.let {
|
||||
mapOf(it.fileId to it)
|
||||
} ?: emptyMap()
|
||||
listOfNotNull(
|
||||
media.file as? MultipartFile,
|
||||
(media as? PhotoedTelegramMedia) ?.photo as? MultipartFile,
|
||||
(media as? ThumbedTelegramMedia) ?.thumb as? MultipartFile,
|
||||
(media as? CoveredTelegramMedia) ?.cover as? MultipartFile
|
||||
).associateBy { it.fileId }
|
||||
}
|
||||
|
||||
// init {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.media
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.media.CoveredTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.PhotoedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
|
||||
import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import kotlinx.serialization.*
|
||||
|
||||
const val editEphemeralMessageMediaMethod = "editEphemeralMessageMedia"
|
||||
|
||||
@Serializable
|
||||
data class EditEphemeralMessageMedia(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(receiverUserIdField)
|
||||
@EncodeDefault
|
||||
override val receiverUserId: UserId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(ephemeralMessageIdField)
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(mediaField)
|
||||
override val media: TelegramFreeMedia,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditEphemeralMessage, EditReplyMessage, EditMediaMessage, MultipartRequest.Common<Unit> {
|
||||
constructor(
|
||||
chatId: EphemeralChatId,
|
||||
media: TelegramFreeMedia,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): this(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
media,
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
override val data: SimpleRequest<Unit>
|
||||
get() = this
|
||||
override val mediaMap: Map<String, MultipartFile> by lazy {
|
||||
listOfNotNull(
|
||||
media.file as? MultipartFile,
|
||||
(media as? PhotoedTelegramMedia) ?.photo as? MultipartFile,
|
||||
(media as? ThumbedTelegramMedia) ?.thumb as? MultipartFile,
|
||||
(media as? CoveredTelegramMedia) ?.cover as? MultipartFile
|
||||
).associateBy { it.fileId }
|
||||
}
|
||||
|
||||
override fun method(): String = editEphemeralMessageMediaMethod
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.reply_markup
|
||||
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.EditEphemeralMessage
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import kotlinx.serialization.*
|
||||
|
||||
const val editEphemeralMessageReplyMarkupMethod = "editEphemeralMessageReplyMarkup"
|
||||
|
||||
@Serializable
|
||||
data class EditEphemeralMessageReplyMarkup(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(receiverUserIdField)
|
||||
@EncodeDefault
|
||||
override val receiverUserId: UserId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(ephemeralMessageIdField)
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditEphemeralMessage, EditReplyMessage {
|
||||
constructor(
|
||||
chatId: EphemeralChatId,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): this(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
override fun method(): String = editEphemeralMessageReplyMarkupMethod
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.text
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.types.rich.multipartFiles
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import dev.inmo.tgbotapi.utils.throwRangeError
|
||||
import kotlinx.serialization.*
|
||||
|
||||
const val editEphemeralMessageTextMethod = "editEphemeralMessageText"
|
||||
|
||||
fun EditEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageRichText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
richMessage: InputRichMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = null,
|
||||
parseMode = null,
|
||||
rawEntities = null,
|
||||
linkPreviewOptions = null,
|
||||
replyMarkup = replyMarkup,
|
||||
richMessage = richMessage
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageRichText(
|
||||
chatId: EphemeralChatId,
|
||||
richMessage: InputRichMessage,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageRichText(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
richMessage = richMessage,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageText(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditEphemeralMessageText(
|
||||
chatId: EphemeralChatId,
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable
|
||||
data class EditEphemeralMessageText internal constructor(
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatIdentifier,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(receiverUserIdField)
|
||||
@EncodeDefault
|
||||
override val receiverUserId: UserId,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(ephemeralMessageIdField)
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId,
|
||||
@SerialName(textField)
|
||||
override val text: String? = null,
|
||||
@SerialName(parseModeField)
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(entitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(richMessageField)
|
||||
val richMessage: InputRichMessage? = null
|
||||
) : EditEphemeralMessage,
|
||||
EditTextChatMessage,
|
||||
EditReplyMessage,
|
||||
EditLinkPreviewOptionsContainer,
|
||||
MultipartRequest.Common<Unit> {
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
text ?.let { rawEntities ?.asTextSources(it) }
|
||||
}
|
||||
|
||||
init {
|
||||
require((text == null) != (richMessage == null)) { "Exactly one of text and richMessage must be specified" }
|
||||
text ?.let {
|
||||
if (it.length !in textLength) {
|
||||
throwRangeError("Text length", textLength, it.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun method(): String = editEphemeralMessageTextMethod
|
||||
override val data: SimpleRequest<Unit>
|
||||
get() = this
|
||||
override val mediaMap: Map<String, MultipartFile>
|
||||
get() = richMessage ?.multipartFiles ?: emptyMap()
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyEphemeralSendRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
@@ -36,6 +37,8 @@ data class SendContact(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -51,7 +54,8 @@ data class SendContact(
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
) : SendContentMessageRequest<ChatContentMessage<ContactContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<ContactContent>>
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<ContactContent>>,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
constructor(
|
||||
chatId: ChatIdentifier,
|
||||
@@ -59,6 +63,7 @@ data class SendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -74,6 +79,7 @@ data class SendContact(
|
||||
threadId,
|
||||
directMessageThreadId,
|
||||
businessConnectionId,
|
||||
ephemeralMessageParameters,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowPaidBroadcast,
|
||||
@@ -95,6 +101,7 @@ fun Contact.toRequest(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -108,6 +115,7 @@ fun Contact.toRequest(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -34,6 +34,7 @@ fun SendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -48,6 +49,7 @@ fun SendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -64,6 +66,7 @@ fun SendStaticLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -78,6 +81,7 @@ fun SendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -87,6 +91,11 @@ fun SendStaticLocation(
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* @param livePeriod According to Telegram Bots API, must be `0` when sending as an ephemeral message (with
|
||||
* [ephemeralMessageParameters] set), as ephemeral messages do not support live location updates. Prefer [SendStaticLocation]
|
||||
* for ephemeral locations.
|
||||
*/
|
||||
fun SendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
latitude: Double,
|
||||
@@ -98,6 +107,7 @@ fun SendLiveLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -116,6 +126,7 @@ fun SendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -132,9 +143,15 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
HorizontallyAccured,
|
||||
Livable,
|
||||
ProximityAlertable,
|
||||
Headed {
|
||||
Headed,
|
||||
OptionallyEphemeralSendRequest {
|
||||
override fun method(): String = "sendLocation"
|
||||
|
||||
/**
|
||||
* @property livePeriod According to Telegram Bots API, must be `0` when sending as an ephemeral message (with
|
||||
* [ephemeralMessageParameters] set), as ephemeral messages do not support live location updates. Prefer [Static]
|
||||
* for ephemeral locations.
|
||||
*/
|
||||
@Serializable
|
||||
data class Live (
|
||||
@SerialName(chatIdField)
|
||||
@@ -165,6 +182,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -215,6 +234,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -267,6 +288,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -297,6 +320,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
ephemeralMessageParameters = surrogate.ephemeralMessageParameters,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
@@ -316,6 +340,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
ephemeralMessageParameters = surrogate.ephemeralMessageParameters,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
@@ -340,6 +365,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -30,6 +30,7 @@ fun SendTextMessage(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -45,6 +46,7 @@ fun SendTextMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -62,6 +64,7 @@ fun SendTextMessage(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -77,6 +80,7 @@ fun SendTextMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -108,6 +112,8 @@ data class SendTextMessage internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -127,7 +133,8 @@ data class SendTextMessage internal constructor(
|
||||
) : SendContentMessageRequest<ChatContentMessage<TextContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<TextContent>>,
|
||||
TextableSendMessageRequest<ChatContentMessage<TextContent>>,
|
||||
LinkPreviewOptionsContainer
|
||||
LinkPreviewOptionsContainer,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text)
|
||||
|
||||
@@ -9,46 +9,64 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
|
||||
import dev.inmo.tgbotapi.utils.throwRangeError
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
/**
|
||||
* Creates a plain-text draft for a direct messages topic.
|
||||
*
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
fun SendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
) = SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* Creates an entity-formatted draft for a direct messages topic.
|
||||
*
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
fun SendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
) = SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
threadId = threadId
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* Streams a partial text message draft to a direct messages topic.
|
||||
*
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
*/
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable
|
||||
data class SendMessageDraft internal constructor(
|
||||
@@ -63,12 +81,16 @@ data class SendMessageDraft internal constructor(
|
||||
@SerialName(entitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(canStopField)
|
||||
val canStop: Boolean? = null,
|
||||
@SerialName(keepOnStopField)
|
||||
val keepOnStop: Boolean? = null
|
||||
) : SendChatMessageRequest<Unit>,
|
||||
TextedOutput,
|
||||
OptionallyMessageThreadRequest
|
||||
OptionallyDirectMessageThreadRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text)
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyEphemeralSendRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
@@ -10,6 +14,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.content.RichMessageContent
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.types.rich.multipartFiles
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.EncodeDefault
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
@@ -41,6 +46,8 @@ data class SendRichMessage(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -56,10 +63,15 @@ data class SendRichMessage(
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
) : SendContentMessageRequest<ChatContentMessage<RichMessageContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<RichMessageContent>> {
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<RichMessageContent>>,
|
||||
MultipartRequest.Common<ChatContentMessage<RichMessageContent>>,
|
||||
OptionallyEphemeralSendRequest {
|
||||
override fun method(): String = "sendRichMessage"
|
||||
override val resultDeserializer: DeserializationStrategy<ChatContentMessage<RichMessageContent>>
|
||||
get() = RichMessageContentMessageResultDeserializer
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
override val data: SimpleRequest<ChatContentMessage<RichMessageContent>>
|
||||
get() = this
|
||||
override val mediaMap: Map<String, MultipartFile> by lazy { richMessage.multipartFiles }
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.DirectMessageThreadId
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.canStopField
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.directMessagesTopicIdField
|
||||
import dev.inmo.tgbotapi.types.draftIdField
|
||||
import dev.inmo.tgbotapi.types.messageThreadIdField
|
||||
import dev.inmo.tgbotapi.types.keepOnStopField
|
||||
import dev.inmo.tgbotapi.types.richMessageField
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.types.rich.multipartFiles
|
||||
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.SerialName
|
||||
@@ -19,12 +22,14 @@ import kotlinx.serialization.SerializationStrategy
|
||||
* ephemeral and acts as a temporary 30-second preview - once the output is finalized, [SendRichMessage] must be called
|
||||
* with the complete message to persist it in the user's chat.
|
||||
*
|
||||
* @param chatId Numeric target chat identifier.
|
||||
* @param directMessageThreadId Direct messages topic identifier. Defaults from [chatId].
|
||||
* @see <a href="https://core.telegram.org/bots/api#sendrichmessagedraft">sendRichMessageDraft</a>
|
||||
*/
|
||||
@Serializable
|
||||
data class SendRichMessageDraft(
|
||||
@SerialName(chatIdField)
|
||||
val chatId: ChatId,
|
||||
val chatId: IdChatIdentifier,
|
||||
/**
|
||||
* Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated.
|
||||
*/
|
||||
@@ -32,13 +37,20 @@ data class SendRichMessageDraft(
|
||||
val draftId: Long,
|
||||
@SerialName(richMessageField)
|
||||
val richMessage: InputRichMessage,
|
||||
@SerialName(messageThreadIdField)
|
||||
val threadId: MessageThreadId? = chatId.threadId
|
||||
@SerialName(directMessagesTopicIdField)
|
||||
val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(canStopField)
|
||||
val canStop: Boolean? = null,
|
||||
@SerialName(keepOnStopField)
|
||||
val keepOnStop: Boolean? = null
|
||||
) : SimpleRequest<Unit> {
|
||||
init {
|
||||
require(draftId != 0L) {
|
||||
"draftId of SendRichMessageDraft must be non-zero"
|
||||
}
|
||||
require(richMessage.multipartFiles.isEmpty()) {
|
||||
"sendRichMessageDraft does not support direct upload of new files"
|
||||
}
|
||||
}
|
||||
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
|
||||
@@ -45,6 +45,8 @@ data class SendVenue(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -62,7 +64,8 @@ data class SendVenue(
|
||||
) : SendContentMessageRequest<ChatContentMessage<VenueContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<VenueContent>>,
|
||||
TitledSendMessageRequest<ChatContentMessage<VenueContent>>,
|
||||
PositionedSendMessageRequest<ChatContentMessage<VenueContent>>
|
||||
PositionedSendMessageRequest<ChatContentMessage<VenueContent>>,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
constructor(
|
||||
chatId: ChatIdentifier,
|
||||
@@ -70,6 +73,7 @@ data class SendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -90,6 +94,7 @@ data class SendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -111,6 +116,7 @@ fun Venue.toRequest(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -124,6 +130,7 @@ fun Venue.toRequest(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.EphemeralMessageParameters
|
||||
|
||||
/**
|
||||
* Inheritors of this interface may be sent as ephemeral messages by passing [ephemeralMessageParameters].
|
||||
* Ephemeral messages are available for groups/supergroups only.
|
||||
*/
|
||||
interface OptionallyEphemeralSendRequest {
|
||||
val ephemeralMessageParameters: EphemeralMessageParameters?
|
||||
}
|
||||
@@ -38,6 +38,7 @@ fun SendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -64,6 +65,7 @@ fun SendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -96,6 +98,7 @@ fun SendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -122,6 +125,7 @@ fun SendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -179,6 +183,8 @@ data class SendAnimationData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -201,7 +207,8 @@ data class SendAnimationData internal constructor(
|
||||
DuratedSendMessageRequest<ChatContentMessage<AnimationContent>>,
|
||||
SizedSendMessageRequest<ChatContentMessage<AnimationContent>>,
|
||||
WithCustomizableCaptionRequest<ChatContentMessage<AnimationContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
OptionallyWithSpoilerRequest,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -37,6 +37,7 @@ fun SendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -61,6 +62,7 @@ fun SendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -91,6 +93,7 @@ fun SendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -115,6 +118,7 @@ fun SendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -168,6 +172,8 @@ data class SendAudioData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -189,7 +195,8 @@ data class SendAudioData internal constructor(
|
||||
ThumbedSendMessageRequest<ChatContentMessage<AudioContent>>,
|
||||
TitledSendMessageRequest<ChatContentMessage<AudioContent>>,
|
||||
DuratedSendMessageRequest<ChatContentMessage<AudioContent>>,
|
||||
Performerable
|
||||
Performerable,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: List<TextSource>? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -42,6 +42,7 @@ fun SendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -64,6 +65,7 @@ fun SendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -101,6 +103,7 @@ fun SendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -123,6 +126,7 @@ fun SendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -180,6 +184,8 @@ data class SendDocumentData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -200,7 +206,8 @@ data class SendDocumentData internal constructor(
|
||||
SendContentMessageRequest<ChatContentMessage<DocumentContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<DocumentContent>>,
|
||||
TextableSendMessageRequest<ChatContentMessage<DocumentContent>>,
|
||||
ThumbedSendMessageRequest<ChatContentMessage<DocumentContent>>
|
||||
ThumbedSendMessageRequest<ChatContentMessage<DocumentContent>>,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -35,6 +35,7 @@ fun SendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -58,6 +59,7 @@ fun SendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -87,6 +89,7 @@ fun SendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -110,6 +113,7 @@ fun SendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -161,6 +165,8 @@ data class SendLivePhotoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -180,7 +186,8 @@ data class SendLivePhotoData internal constructor(
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<LivePhotoContent>>,
|
||||
TextableSendMessageRequest<ChatContentMessage<LivePhotoContent>>,
|
||||
WithCustomizableCaptionRequest<ChatContentMessage<LivePhotoContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
OptionallyWithSpoilerRequest,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -53,6 +53,11 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
val files: List<MultipartFile> = media.flatMap {
|
||||
listOfNotNull(
|
||||
it.file as? MultipartFile,
|
||||
if (it is PhotoedTelegramMedia) {
|
||||
it.photo as? MultipartFile
|
||||
} else {
|
||||
null
|
||||
},
|
||||
if (it is ThumbedTelegramMedia) {
|
||||
it.thumb as? MultipartFile
|
||||
} else {
|
||||
|
||||
@@ -15,6 +15,7 @@ import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.media.CoveredTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.PhotoedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
@@ -67,6 +68,11 @@ fun SendPaidMedia(
|
||||
val files: List<MultipartFile> = media.flatMap {
|
||||
listOfNotNull(
|
||||
it.file as? MultipartFile,
|
||||
if (it is PhotoedTelegramMedia) {
|
||||
it.photo as? MultipartFile
|
||||
} else {
|
||||
null
|
||||
},
|
||||
if (it is ThumbedTelegramMedia) {
|
||||
it.thumb as? MultipartFile
|
||||
} else {
|
||||
@@ -130,6 +136,11 @@ fun SendPaidMedia(
|
||||
val files: List<MultipartFile> = media.flatMap {
|
||||
listOfNotNull(
|
||||
it.file as? MultipartFile,
|
||||
if (it is PhotoedTelegramMedia) {
|
||||
it.photo as? MultipartFile
|
||||
} else {
|
||||
null
|
||||
},
|
||||
if (it is ThumbedTelegramMedia) {
|
||||
it.thumb as? MultipartFile
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,7 @@ fun SendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -52,6 +53,7 @@ fun SendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -79,6 +81,7 @@ fun SendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -98,6 +101,7 @@ fun SendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -147,6 +151,8 @@ data class SendPhotoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -166,7 +172,8 @@ data class SendPhotoData internal constructor(
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<PhotoContent>>,
|
||||
TextableSendMessageRequest<ChatContentMessage<PhotoContent>>,
|
||||
WithCustomizableCaptionRequest<ChatContentMessage<PhotoContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
OptionallyWithSpoilerRequest,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send.media
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyEphemeralSendRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
@@ -22,6 +23,7 @@ fun SendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -36,6 +38,7 @@ fun SendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -74,6 +77,8 @@ data class SendStickerByFileId internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(emojiField)
|
||||
val emoji: String? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -90,7 +95,7 @@ data class SendStickerByFileId internal constructor(
|
||||
override val replyParameters: ReplyParameters? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
) : SendContentMessageRequest<ChatContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ChatContentMessage<StickerContent>> {
|
||||
) : SendContentMessageRequest<ChatContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ChatContentMessage<StickerContent>>, OptionallyEphemeralSendRequest {
|
||||
override fun method(): String = "sendSticker"
|
||||
override val resultDeserializer: DeserializationStrategy<ChatContentMessage<StickerContent>>
|
||||
get() = commonResultDeserializer
|
||||
|
||||
@@ -43,6 +43,7 @@ fun SendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -73,6 +74,7 @@ fun SendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -108,6 +110,7 @@ fun SendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -138,6 +141,7 @@ fun SendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -201,6 +205,8 @@ data class SendVideoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -226,7 +232,8 @@ data class SendVideoData internal constructor(
|
||||
CoveredSendMessageRequest<ChatContentMessage<VideoContent>>,
|
||||
WithCustomStartMediaData,
|
||||
OptionallyWithSpoilerRequest,
|
||||
OptionallyStreamable
|
||||
OptionallyStreamable,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -25,6 +25,7 @@ fun SendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -45,6 +46,7 @@ fun SendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -90,6 +92,8 @@ data class SendVideoNoteData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -109,7 +113,8 @@ data class SendVideoNoteData internal constructor(
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
|
||||
ThumbedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
|
||||
DuratedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
|
||||
SizedSendMessageRequest<ChatContentMessage<VideoNoteContent>>
|
||||
SizedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val height: Int?
|
||||
get() = width
|
||||
|
||||
@@ -31,6 +31,7 @@ fun SendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -51,6 +52,7 @@ fun SendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -77,6 +79,7 @@ fun SendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
duration: Long? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -98,6 +101,7 @@ fun SendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -145,6 +149,8 @@ data class SendVoiceData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -163,7 +169,8 @@ data class SendVoiceData internal constructor(
|
||||
SendContentMessageRequest<ChatContentMessage<VoiceContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<VoiceContent>>,
|
||||
TextableSendMessageRequest<ChatContentMessage<VoiceContent>>,
|
||||
DuratedSendMessageRequest<ChatContentMessage<VoiceContent>>
|
||||
DuratedSendMessageRequest<ChatContentMessage<VoiceContent>>,
|
||||
OptionallyEphemeralSendRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -14,7 +14,9 @@ data class BotCommand(
|
||||
@SerialName(botCommandField)
|
||||
val command: String,
|
||||
@SerialName(descriptionField)
|
||||
val description: String
|
||||
val description: String,
|
||||
@SerialName(isEphemeralField)
|
||||
val isEphemeral: Boolean = false
|
||||
) {
|
||||
init {
|
||||
if (command.length !in botCommandLengthLimit) {
|
||||
|
||||
@@ -39,6 +39,10 @@ sealed interface IdChatIdentifier : ChatIdentifier {
|
||||
get() = null
|
||||
val directMessageThreadId: DirectMessageThreadId?
|
||||
get() = null
|
||||
val receiverUser: UserId?
|
||||
get() = null
|
||||
val ephemeralMessageId: EphemeralMessageId?
|
||||
get() = null
|
||||
|
||||
companion object {
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
|
||||
@@ -48,6 +52,7 @@ sealed interface IdChatIdentifier : ChatIdentifier {
|
||||
} ?: ChatId(chatId)
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId) = ChatIdWithThreadId(chatId, threadId)
|
||||
operator fun invoke(chatId: RawChatId, businessConnectionId: BusinessConnectionId) = BusinessChatId(chatId, businessConnectionId)
|
||||
operator fun invoke(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = EphemeralChatId(chatId, receiverUser, ephemeralMessageId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +96,26 @@ value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, B
|
||||
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Chat id of group/supergroup additionally carrying ephemeral [receiverUser] (and optional [ephemeralMessageId]);
|
||||
* used to default `receiverUserId`/`ephemeralMessageId` params of ephemeral-related requests
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
value class EphemeralChatId(
|
||||
val chatIdWithReceiverUserAndEphemeralMessageId: Triple<RawChatId, UserId, EphemeralMessageId?>
|
||||
) : IdChatIdentifier {
|
||||
override val chatId: RawChatId
|
||||
get() = chatIdWithReceiverUserAndEphemeralMessageId.first
|
||||
override val receiverUser: UserId
|
||||
get() = chatIdWithReceiverUserAndEphemeralMessageId.second
|
||||
override val ephemeralMessageId: EphemeralMessageId?
|
||||
get() = chatIdWithReceiverUserAndEphemeralMessageId.third
|
||||
|
||||
constructor(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null): this(Triple(chatId, receiverUser, ephemeralMessageId))
|
||||
}
|
||||
|
||||
val ChatIdentifier.threadId: MessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.threadId
|
||||
|
||||
@@ -100,16 +125,24 @@ val ChatIdentifier.directMessageThreadId: DirectMessageThreadId?
|
||||
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
|
||||
get() = (this as? IdChatIdentifier) ?.businessConnectionId
|
||||
|
||||
val ChatIdentifier.receiverUser: UserId?
|
||||
get() = (this as? IdChatIdentifier) ?.receiverUser
|
||||
|
||||
val ChatIdentifier.ephemeralMessageId: EphemeralMessageId?
|
||||
get() = (this as? IdChatIdentifier) ?.ephemeralMessageId
|
||||
|
||||
fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is ChatId -> this
|
||||
is ChatIdWithThreadId -> ChatId(chatId)
|
||||
is ChatIdWithChannelDirectMessageThreadId -> ChatId(chatId)
|
||||
is BusinessChatId -> ChatId(chatId)
|
||||
is EphemeralChatId -> ChatId(chatId)
|
||||
}
|
||||
|
||||
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
|
||||
fun IdChatIdentifier.toChatIdWithChannelDirectMessageThreadId(threadId: DirectMessageThreadId) = ChatIdWithChannelDirectMessageThreadId(chatId, threadId)
|
||||
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
|
||||
fun IdChatIdentifier.toEphemeralChatId(receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = IdChatIdentifier(chatId, receiverUser, ephemeralMessageId)
|
||||
|
||||
/**
|
||||
* https://core.telegram.org/bots/api#formatting-options
|
||||
@@ -256,6 +289,17 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
)
|
||||
}
|
||||
}
|
||||
4 -> {
|
||||
val (chatId, intermediateDelimiter, receiverUserChatId, ephemeralMessageId) = splitted
|
||||
when (intermediateDelimiter) {
|
||||
"eph" -> EphemeralChatId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
receiverUserChatId.toLongOrNull() ?.let { ChatId(RawChatId(it)) } ?: return@let null,
|
||||
ephemeralMessageId.toLongOrNull() ?.let(::EphemeralMessageId)
|
||||
)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
} ?: id.content.let {
|
||||
@@ -269,6 +313,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
|
||||
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessConnectionId}")
|
||||
is ChatIdWithChannelDirectMessageThreadId -> encoder.encodeString("${value.chatId}/cdm/${value.directMessageThreadId}")
|
||||
is EphemeralChatId -> encoder.encodeString("${value.chatId}/eph/${value.receiverUser.chatId}/${value.ephemeralMessageId?.long ?: ""}")
|
||||
is Username -> encoder.encodeString(value.full)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +253,7 @@ const val inlineMessageIdField = "inline_message_id"
|
||||
const val callbackDataField = "callback_data"
|
||||
const val callbackGameField = "callback_game"
|
||||
const val callbackQueryIdField = "callback_query_id"
|
||||
const val ephemeralMessageParametersField = "ephemeral_message_parameters"
|
||||
const val webAppQueryIdField = "web_app_query_id"
|
||||
const val inlineQueryIdField = "inline_query_id"
|
||||
const val inlineKeyboardField = "inline_keyboard"
|
||||
@@ -311,6 +312,7 @@ const val canEditStoriesField = "can_edit_stories"
|
||||
const val canDeleteStoriesField = "can_delete_stories"
|
||||
const val canManageDirectMessagesField = "can_manage_direct_messages"
|
||||
const val canManageTagsField = "can_manage_tags"
|
||||
const val canSendWelcomeMessagesField = "can_send_welcome_messages"
|
||||
const val captionEntitiesField = "caption_entities"
|
||||
const val hasSpoilerField = "has_spoiler"
|
||||
const val showCaptionAboveMediaField = "show_caption_above_media"
|
||||
@@ -466,6 +468,7 @@ const val botCommandField = "command"
|
||||
const val botCommandFullField = "bot_command"
|
||||
const val botCommandsField = "commands"
|
||||
const val scopeField = "scope"
|
||||
const val isEphemeralField = "is_ephemeral"
|
||||
|
||||
const val isMemberField = "is_member"
|
||||
const val isForumField = "is_forum"
|
||||
@@ -608,6 +611,8 @@ const val isCheckedField = "is_checked"
|
||||
const val isOpenField = "is_open"
|
||||
const val isBorderedField = "is_bordered"
|
||||
const val isStripedField = "is_striped"
|
||||
const val isCompactField = "is_compact"
|
||||
const val buttonsField = "buttons"
|
||||
const val certificateField = "certificate"
|
||||
const val questionField = "question"
|
||||
const val questionEntitiesField = "question_entities"
|
||||
@@ -625,6 +630,9 @@ const val subscriptionPriceField = "subscription_price"
|
||||
const val copyTextField = "copy_text"
|
||||
const val topicIdField = "topic_id"
|
||||
const val draftIdField = "draft_id"
|
||||
const val canStopField = "can_stop"
|
||||
const val keepOnStopField = "keep_on_stop"
|
||||
const val stoppedMessageGenerationField = "stopped_message_generation"
|
||||
|
||||
const val isPublicField = "is_public"
|
||||
|
||||
@@ -756,6 +764,10 @@ const val mainFrameTimestampField = "main_frame_timestamp"
|
||||
const val firstProfileAudioField = "first_profile_audio"
|
||||
const val paidMessageStarCountField = "paid_message_star_count"
|
||||
const val senderTagField = "sender_tag"
|
||||
const val receiverUserField = "receiver_user"
|
||||
const val receiverUserIdField = "receiver_user_id"
|
||||
const val replaceCallbackQueryMessageField = "replace_callback_query_message"
|
||||
const val ephemeralMessageIdField = "ephemeral_message_id"
|
||||
const val countField = "count"
|
||||
const val ratingField = "rating"
|
||||
const val uniqueGiftColorsField = "unique_gift_colors"
|
||||
@@ -772,6 +784,7 @@ const val disableEditMessageField = "disable_edit_message"
|
||||
const val scoreField = "score"
|
||||
const val forceField = "force"
|
||||
const val forceReplyField = "force_reply"
|
||||
const val disabledField = "disabled"
|
||||
|
||||
const val regularPollType = "regular"
|
||||
const val quizPollType = "quiz"
|
||||
@@ -942,4 +955,6 @@ const val temperatureField = "temperature"
|
||||
const val backgroundColorField = "background_color"
|
||||
const val keepOriginalDetailsField = "keep_original_details"
|
||||
|
||||
const val communityField = "community"
|
||||
|
||||
const val codecField = "codec"
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class EphemeralMessageId(
|
||||
val long: Long
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return long.toString()
|
||||
}
|
||||
}
|
||||
|
||||
fun Long.asEphemeralMessageId() = EphemeralMessageId(this)
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Parameters defining an ephemeral message recipient and optional callback-query replacement behavior.
|
||||
*/
|
||||
@Serializable
|
||||
data class EphemeralMessageParameters(
|
||||
@SerialName(receiverUserIdField)
|
||||
val receiverUserId: UserId,
|
||||
@SerialName(callbackQueryIdField)
|
||||
val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(replaceCallbackQueryMessageField)
|
||||
val replaceCallbackQueryMessage: Boolean? = null
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChat
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Information about a user stopping message generation.
|
||||
*/
|
||||
@Serializable
|
||||
data class MessageGenerationStopped(
|
||||
@SerialName(chatField)
|
||||
val chat: PreviewChat,
|
||||
@SerialName(messageThreadIdField)
|
||||
val messageThreadId: MessageThreadId? = null,
|
||||
@SerialName(draftIdField)
|
||||
val draftId: DraftId
|
||||
)
|
||||
@@ -2,195 +2,351 @@ package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.abstracts.WithMessageId
|
||||
import dev.inmo.tgbotapi.types.chat.Bot
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewBot
|
||||
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
||||
import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEphemeralMessage
|
||||
import dev.inmo.tgbotapi.types.message.asTextSources
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||
import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationException
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable
|
||||
data class ReplyParameters internal constructor(
|
||||
@SerialName(chatIdField)
|
||||
val chatIdentifier: ChatIdentifier,
|
||||
@SerialName(messageIdField)
|
||||
override val messageId: MessageId,
|
||||
@SerialName(allowSendingWithoutReplyField)
|
||||
val allowSendingWithoutReply: Boolean? = null,
|
||||
@SerialName(quoteField)
|
||||
val quote: String? = null,
|
||||
@SerialName(quoteParseModeField)
|
||||
val quoteParseMode: ParseMode? = null,
|
||||
@SerialName(quoteEntitiesField)
|
||||
private val quoteEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(quotePositionField)
|
||||
val quotePosition: Int? = null,
|
||||
@SerialName(checklistTaskIdField)
|
||||
val checklistTaskId: ChecklistTaskId? = null,
|
||||
@SerialName(pollOptionIdField)
|
||||
val pollOptionId: PollOptionPersistentId? = null,
|
||||
) : WithMessageId, TextedInput {
|
||||
override val text: String?
|
||||
get() = quote
|
||||
override val textSources: List<TextSource> by lazy {
|
||||
quoteEntities ?.asTextSources(quote ?: return@lazy emptyList()) ?: emptyList()
|
||||
@Serializable(ReplyParameters.Serializer::class)
|
||||
sealed interface ReplyParameters {
|
||||
val messageId: MessageId?
|
||||
val allowSendingWithoutReply: Boolean?
|
||||
val checklistTaskId: ChecklistTaskId?
|
||||
val pollOptionId: PollOptionPersistentId?
|
||||
|
||||
/**
|
||||
* Reply parameters targeting a regular message identified by [messageId]. A `null` [chatIdentifier] targets a
|
||||
* message in the current chat; a non-null [chatIdentifier] targets a message in a different chat. Public
|
||||
* construction uses the `ReplyParameters(...)` companion factories.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable(ReplyParameters.Serializer::class)
|
||||
data class Chat internal constructor(
|
||||
val chatIdentifier: ChatIdentifier?,
|
||||
override val messageId: MessageId,
|
||||
override val allowSendingWithoutReply: Boolean? = null,
|
||||
val quote: String? = null,
|
||||
val quoteParseMode: ParseMode? = null,
|
||||
internal val quoteEntities: List<RawMessageEntity>? = null,
|
||||
val quotePosition: Int? = null,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
override val pollOptionId: PollOptionPersistentId? = null,
|
||||
) : WithMessageId, ReplyParameters, TextedInput {
|
||||
override val text: String?
|
||||
get() = quote
|
||||
override val textSources: List<TextSource> by lazy {
|
||||
quoteEntities ?.asTextSources(quote ?: return@lazy emptyList()) ?: emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
entities.makeSourceString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
null,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
metaInfo: Message.MetaInfo,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
constructor(
|
||||
message: Message,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
) : this(
|
||||
message.metaInfo,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ReplyParameters.Serializer::class)
|
||||
/**
|
||||
* Reply parameters targeting an incoming ephemeral message identified by [ephemeralMessageId]. The outgoing
|
||||
* reply must also be ephemeral; chat and quote fields are unsupported for ephemeral replies. Type-neutral
|
||||
* construction is available through the `ReplyParameters(...)` companion factory.
|
||||
*/
|
||||
data class Ephemeral(
|
||||
val ephemeralMessageId: EphemeralMessageId,
|
||||
override val allowSendingWithoutReply: Boolean? = null,
|
||||
override val checklistTaskId: ChecklistTaskId? = null,
|
||||
override val pollOptionId: PollOptionPersistentId? = null,
|
||||
) : ReplyParameters {
|
||||
override val messageId: MessageId? = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
operator fun invoke(
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Ephemeral = Ephemeral(
|
||||
ephemeralMessageId,
|
||||
allowSendingWithoutReply,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = Chat(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
entities.makeSourceString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
metaInfo: Message.MetaInfo,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
message: Message,
|
||||
entities: TextSourcesList,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
message.metaInfo,
|
||||
entities,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = Chat(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
null,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
metaInfo: Message.MetaInfo,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
message: Message,
|
||||
quote: String,
|
||||
quoteParseMode: ParseMode,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
message.metaInfo,
|
||||
quote,
|
||||
quoteParseMode,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
chatIdentifier: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = Chat(
|
||||
chatIdentifier,
|
||||
messageId,
|
||||
allowSendingWithoutReply,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
metaInfo: Message.MetaInfo,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
metaInfo.chatId,
|
||||
metaInfo.messageId,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
|
||||
operator fun invoke(
|
||||
message: Message,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
quotePosition: Int? = null,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): Chat = invoke(
|
||||
message.metaInfo,
|
||||
allowSendingWithoutReply,
|
||||
quotePosition,
|
||||
checklistTaskId,
|
||||
pollOptionId
|
||||
)
|
||||
}
|
||||
|
||||
object Serializer : KSerializer<ReplyParameters> {
|
||||
@Serializable
|
||||
private data class Surrogate(
|
||||
@SerialName(chatIdField) val chatIdentifier: ChatIdentifier? = null,
|
||||
@SerialName(messageIdField) val messageId: MessageId? = null,
|
||||
@SerialName(allowSendingWithoutReplyField) val allowSendingWithoutReply: Boolean? = null,
|
||||
@SerialName(quoteField) val quote: String? = null,
|
||||
@SerialName(quoteParseModeField) val quoteParseMode: ParseMode? = null,
|
||||
@SerialName(quoteEntitiesField) val quoteEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(quotePositionField) val quotePosition: Int? = null,
|
||||
@SerialName(checklistTaskIdField) val checklistTaskId: ChecklistTaskId? = null,
|
||||
@SerialName(pollOptionIdField) val pollOptionId: PollOptionPersistentId? = null,
|
||||
@SerialName(ephemeralMessageIdField) val ephemeralMessageId: EphemeralMessageId? = null,
|
||||
)
|
||||
|
||||
override val descriptor: SerialDescriptor = Surrogate.serializer().descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): ReplyParameters {
|
||||
val surrogate = decoder.decodeSerializableValue(Surrogate.serializer())
|
||||
if (surrogate.messageId != null && surrogate.ephemeralMessageId != null) {
|
||||
throw SerializationException("ReplyParameters must contain either message_id or ephemeral_message_id, not both")
|
||||
}
|
||||
return when {
|
||||
surrogate.ephemeralMessageId != null -> Ephemeral(
|
||||
ephemeralMessageId = surrogate.ephemeralMessageId,
|
||||
allowSendingWithoutReply = surrogate.allowSendingWithoutReply,
|
||||
checklistTaskId = surrogate.checklistTaskId,
|
||||
pollOptionId = surrogate.pollOptionId
|
||||
)
|
||||
surrogate.messageId != null -> Chat(
|
||||
chatIdentifier = surrogate.chatIdentifier,
|
||||
messageId = surrogate.messageId,
|
||||
allowSendingWithoutReply = surrogate.allowSendingWithoutReply,
|
||||
quote = surrogate.quote,
|
||||
quoteParseMode = surrogate.quoteParseMode,
|
||||
quoteEntities = surrogate.quoteEntities,
|
||||
quotePosition = surrogate.quotePosition,
|
||||
checklistTaskId = surrogate.checklistTaskId,
|
||||
pollOptionId = surrogate.pollOptionId
|
||||
)
|
||||
else -> throw SerializationException("ReplyParameters must contain message_id or ephemeral_message_id")
|
||||
}
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: ReplyParameters) {
|
||||
val surrogate = when (value) {
|
||||
is Chat -> Surrogate(
|
||||
chatIdentifier = value.chatIdentifier,
|
||||
messageId = value.messageId,
|
||||
allowSendingWithoutReply = value.allowSendingWithoutReply,
|
||||
quote = value.quote,
|
||||
quoteParseMode = value.quoteParseMode,
|
||||
quoteEntities = value.quoteEntities,
|
||||
quotePosition = value.quotePosition,
|
||||
checklistTaskId = value.checklistTaskId,
|
||||
pollOptionId = value.pollOptionId
|
||||
)
|
||||
is Ephemeral -> Surrogate(
|
||||
allowSendingWithoutReply = value.allowSendingWithoutReply,
|
||||
ephemeralMessageId = value.ephemeralMessageId,
|
||||
checklistTaskId = value.checklistTaskId,
|
||||
pollOptionId = value.pollOptionId
|
||||
)
|
||||
}
|
||||
encoder.encodeSerializableValue(Surrogate.serializer(), surrogate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds [ReplyParameters.Ephemeral] with [allowSendingWithoutReply], [checklistTaskId], and [pollOptionId], targeting
|
||||
* [ephemeralMessageId]. The target defaults to [PossiblyEphemeralMessage.ephemeralMessageId]; a missing target produces
|
||||
* `null`.
|
||||
*/
|
||||
fun Message.ephemeralReplyParametersOrNull(
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
ephemeralMessageId: EphemeralMessageId? = (this as? PossiblyEphemeralMessage) ?.ephemeralMessageId,
|
||||
checklistTaskId: ChecklistTaskId? = null,
|
||||
pollOptionId: PollOptionPersistentId? = null,
|
||||
): ReplyParameters? =
|
||||
ephemeralMessageId ?.let {
|
||||
ReplyParameters(
|
||||
ephemeralMessageId = it,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
checklistTaskId = checklistTaskId,
|
||||
pollOptionId = pollOptionId,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the receiver [UserId] for an ephemeral reply: [PossiblyEphemeralMessage.receiverUser] when available,
|
||||
* otherwise [OptionallyFromUserMessage.from]; returns `null` for a non-ephemeral message.
|
||||
*/
|
||||
val Message.ephemeralReplyReceiverUserIdOrNull: UserId?
|
||||
get() = (this as? PossiblyEphemeralMessage) ?.takeIf { it.ephemeralMessageId != null } ?.let {
|
||||
val receiverUser = it.receiverUser
|
||||
val thisAsOptionallyFromUserMessage = this as? OptionallyFromUserMessage
|
||||
val from = thisAsOptionallyFromUserMessage ?.from
|
||||
when {
|
||||
receiverUser != null && receiverUser !is PreviewBot && from !is Bot -> receiverUser.id
|
||||
from != null && from !is PreviewBot && from !is Bot -> from.id
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ const val UPDATE_GUEST_MESSAGE = "guest_message"
|
||||
|
||||
const val UPDATE_MANAGED_BOT = "managed_bot"
|
||||
|
||||
const val UPDATE_SUBSCRIPTION = "subscription"
|
||||
|
||||
const val UPDATE_STOPPED_MESSAGE_GENERATION = stoppedMessageGenerationField
|
||||
|
||||
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_MESSAGE,
|
||||
UPDATE_EDITED_MESSAGE,
|
||||
@@ -65,6 +69,10 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_REMOVE_CHAT_BOOST,
|
||||
|
||||
UPDATE_MANAGED_BOT,
|
||||
|
||||
UPDATE_SUBSCRIPTION,
|
||||
|
||||
UPDATE_STOPPED_MESSAGE_GENERATION,
|
||||
)
|
||||
|
||||
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(
|
||||
|
||||
@@ -24,6 +24,34 @@ sealed interface InlineKeyboardButton {
|
||||
val iconCustomEmojiId: CustomEmojiId?
|
||||
}
|
||||
|
||||
/**
|
||||
* A disabled inline keyboard button action. Telegram Bot API currently defines no fields for this object.
|
||||
*
|
||||
* @see DisabledInlineKeyboardButton
|
||||
* @see https://core.telegram.org/bots/api#disabledbutton
|
||||
*/
|
||||
@Serializable
|
||||
data object DisabledButton
|
||||
|
||||
/**
|
||||
* An inline keyboard button which does nothing when pressed.
|
||||
*
|
||||
* @see https://core.telegram.org/bots/api#inlinekeyboardbutton
|
||||
*/
|
||||
@Serializable
|
||||
data class DisabledInlineKeyboardButton(
|
||||
@SerialName(textField)
|
||||
override val text: String,
|
||||
@SerialName(iconCustomEmojiIdField)
|
||||
override val iconCustomEmojiId: CustomEmojiId? = null,
|
||||
@SerialName(styleField)
|
||||
override val style: KeyboardButtonStyle? = null
|
||||
) : InlineKeyboardButton {
|
||||
@SerialName(disabledField)
|
||||
@EncodeDefault
|
||||
private val disabled = DisabledButton
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class UnknownInlineKeyboardButton (
|
||||
val rawData: JsonElement
|
||||
|
||||
@@ -24,6 +24,7 @@ object InlineKeyboardButtonSerializer : KSerializer<InlineKeyboardButton> {
|
||||
|
||||
private fun resolveSerializer(json: JsonObject): KSerializer<out InlineKeyboardButton>? {
|
||||
return when {
|
||||
json[disabledField] != null -> DisabledInlineKeyboardButton.serializer()
|
||||
json[callbackDataField] != null -> CallbackDataInlineKeyboardButton.serializer()
|
||||
json[callbackGameField] != null -> CallbackGameInlineKeyboardButton.serializer()
|
||||
json[loginUrlField] != null -> LoginURLInlineKeyboardButton.serializer()
|
||||
@@ -47,6 +48,7 @@ object InlineKeyboardButtonSerializer : KSerializer<InlineKeyboardButton> {
|
||||
|
||||
override fun serialize(encoder: Encoder, value: InlineKeyboardButton) {
|
||||
when (value) {
|
||||
is DisabledInlineKeyboardButton -> DisabledInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||
is CallbackDataInlineKeyboardButton -> CallbackDataInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||
is LoginURLInlineKeyboardButton -> LoginURLInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||
is PayInlineKeyboardButton -> PayInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.buttons
|
||||
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton
|
||||
import dev.inmo.tgbotapi.types.forceReplyField
|
||||
import dev.inmo.tgbotapi.types.inlineKeyboardField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
@@ -9,7 +10,13 @@ import kotlinx.serialization.Serializable
|
||||
@Serializable
|
||||
data class InlineKeyboardMarkup(
|
||||
@SerialName(inlineKeyboardField)
|
||||
val keyboard: Matrix<InlineKeyboardButton>
|
||||
val keyboard: Matrix<InlineKeyboardButton>,
|
||||
/**
|
||||
* Requests a reply interface for the message. Telegram does not allow changing this value when editing the inline
|
||||
* keyboard.
|
||||
*/
|
||||
@SerialName(forceReplyField)
|
||||
val forceReply: Boolean? = null
|
||||
) : KeyboardMarkup {
|
||||
init {
|
||||
val isTherePayButton = keyboard.any { it ->
|
||||
@@ -28,20 +35,22 @@ data class InlineKeyboardMarkup(
|
||||
|
||||
operator fun plus(other: InlineKeyboardMarkup): InlineKeyboardMarkup {
|
||||
return InlineKeyboardMarkup(
|
||||
keyboard + other.keyboard
|
||||
keyboard = keyboard + other.keyboard,
|
||||
forceReply = forceReply ?.or(other.forceReply ?: false) ?: other.forceReply
|
||||
)
|
||||
}
|
||||
|
||||
operator fun minus(other: InlineKeyboardMarkup): InlineKeyboardMarkup {
|
||||
val otherButtons = other.keyboard.flatten()
|
||||
return InlineKeyboardMarkup(
|
||||
keyboard.mapNotNull { row ->
|
||||
keyboard = keyboard.mapNotNull { row ->
|
||||
row.filter { button ->
|
||||
button !in otherButtons
|
||||
}.takeIf {
|
||||
it.isNotEmpty()
|
||||
}
|
||||
}
|
||||
},
|
||||
forceReply = forceReply
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,12 @@ data class ReplyKeyboardMarkup(
|
||||
val inputFieldPlaceholder: String? = null,
|
||||
val selective: Boolean? = null,
|
||||
@SerialName(isPersistentField)
|
||||
val persistent: Boolean? = null
|
||||
val persistent: Boolean? = null,
|
||||
/**
|
||||
* Requests a reply interface for the message.
|
||||
*/
|
||||
@SerialName(forceReplyField)
|
||||
val forceReply: Boolean? = null
|
||||
) : KeyboardMarkup {
|
||||
init {
|
||||
if (inputFieldPlaceholder != null && inputFieldPlaceholder.length !in inputFieldPlaceholderLimit) {
|
||||
@@ -31,6 +36,7 @@ data class ReplyKeyboardMarkup(
|
||||
inputFieldPlaceholder = inputFieldPlaceholder ?.plus(other.inputFieldPlaceholder ?.let { placeholderDelimiter + it } ?: "") ?: other.inputFieldPlaceholder,
|
||||
selective = selective ?.or(other.selective ?: false) ?: other.selective,
|
||||
persistent = persistent ?.or(other.persistent ?: false) ?: other.persistent,
|
||||
forceReply = forceReply ?.or(other.forceReply ?: false) ?: other.forceReply,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,15 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardButtonStyle
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.*
|
||||
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
||||
|
||||
/**
|
||||
* Creates [DisabledInlineKeyboardButton].
|
||||
*/
|
||||
fun disabledInlineButton(
|
||||
text: String,
|
||||
iconCustomEmojiId: CustomEmojiId? = null,
|
||||
style: KeyboardButtonStyle? = null
|
||||
) = DisabledInlineKeyboardButton(text, iconCustomEmojiId, style)
|
||||
|
||||
/**
|
||||
* Creates [PayInlineKeyboardButton]
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
|
||||
import dev.inmo.tgbotapi.types.colors.ColorId
|
||||
import dev.inmo.tgbotapi.types.communities.Community
|
||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
|
||||
import dev.inmo.tgbotapi.types.gifts.unique.UniqueGiftColors
|
||||
@@ -71,7 +72,9 @@ data class ExtendedChannelChatImpl(
|
||||
@SerialName(uniqueGiftColorsField)
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(guardBotField)
|
||||
override val guardBot: User? = null
|
||||
override val guardBot: User? = null,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null
|
||||
) : ExtendedChannelChat
|
||||
|
||||
@Serializable
|
||||
@@ -120,7 +123,9 @@ data class ExtendedGroupChatImpl(
|
||||
@SerialName(uniqueGiftColorsField)
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(guardBotField)
|
||||
override val guardBot: User? = null
|
||||
override val guardBot: User? = null,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null
|
||||
) : ExtendedGroupChat
|
||||
|
||||
@Serializable
|
||||
@@ -322,7 +327,9 @@ data class ExtendedSupergroupChatImpl(
|
||||
@SerialName(uniqueGiftColorsField)
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(guardBotField)
|
||||
override val guardBot: User? = null
|
||||
override val guardBot: User? = null,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null
|
||||
) : ExtendedSupergroupChat
|
||||
|
||||
@Serializable
|
||||
@@ -398,7 +405,9 @@ data class ExtendedForumChatImpl(
|
||||
@SerialName(uniqueGiftColorsField)
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(guardBotField)
|
||||
override val guardBot: User? = null
|
||||
override val guardBot: User? = null,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null
|
||||
) : ExtendedForumChat
|
||||
|
||||
@Serializable
|
||||
@@ -477,7 +486,9 @@ data class ExtendedChannelDirectMessagesChatImpl(
|
||||
@SerialName(uniqueGiftColorsField)
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(guardBotField)
|
||||
override val guardBot: User? = null
|
||||
override val guardBot: User? = null,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null
|
||||
) : ExtendedChannelDirectMessagesChat {
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(isDirectMessagesField)
|
||||
@@ -533,6 +544,8 @@ data class ExtendedBot(
|
||||
override val uniqueGiftColors: UniqueGiftColors? = null,
|
||||
@SerialName(canManageBotsField)
|
||||
val canManageBots: Boolean = false,
|
||||
@SerialName(communityField)
|
||||
override val community: Community? = null,
|
||||
) : Bot(), ExtendedChat {
|
||||
@SerialName(isBotField)
|
||||
private val isBot = true
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
|
||||
import dev.inmo.tgbotapi.types.colors.ColorId
|
||||
import dev.inmo.tgbotapi.types.communities.Community
|
||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
|
||||
import dev.inmo.tgbotapi.types.gifts.unique.UniqueGiftColors
|
||||
@@ -35,6 +36,14 @@ sealed interface ExtendedChat : Chat {
|
||||
val guardBot: User?
|
||||
get() = null
|
||||
|
||||
/**
|
||||
* The Community to which the chat belongs
|
||||
*
|
||||
* @see <a href="https://core.telegram.org/bots/api#chatfullinfo">ChatFullInfo.community</a>
|
||||
*/
|
||||
val community: Community?
|
||||
get() = null
|
||||
|
||||
@Deprecated(
|
||||
message = "Telegram Bot API v9.0 introduced the new field, `acceptedGiftTypes`, to allow granular" +
|
||||
" control over which types of gifts user, bot, or chat can accept.",
|
||||
|
||||
@@ -50,6 +50,8 @@ data class AdministratorChatMemberImpl(
|
||||
override val canManageDirectMessages: Boolean = false,
|
||||
@SerialName(canManageTagsField)
|
||||
override val canManageTags: Boolean = false,
|
||||
@SerialName(canSendWelcomeMessagesField)
|
||||
override val canSendWelcomeMessages: Boolean = false,
|
||||
) : AdministratorChatMember {
|
||||
@SerialName(statusField)
|
||||
@Required
|
||||
|
||||
@@ -21,6 +21,7 @@ sealed interface ChatAdministratorRights : SpecialChatAdministratorRights {
|
||||
val canDeleteStories: Boolean
|
||||
val canManageDirectMessages: Boolean
|
||||
val canManageTags: Boolean
|
||||
val canSendWelcomeMessages: Boolean
|
||||
|
||||
companion object {
|
||||
operator fun invoke(
|
||||
@@ -38,7 +39,8 @@ sealed interface ChatAdministratorRights : SpecialChatAdministratorRights {
|
||||
canManageTopics: Boolean = false,
|
||||
canPostStories: Boolean = false,
|
||||
canEditStories: Boolean = false,
|
||||
canDeleteStories: Boolean = false
|
||||
canDeleteStories: Boolean = false,
|
||||
canSendWelcomeMessages: Boolean = false
|
||||
) = ChatCommonAdministratorRights(
|
||||
canChangeInfo = canChangeInfo,
|
||||
canPostMessages = canPostMessages,
|
||||
@@ -54,7 +56,8 @@ sealed interface ChatAdministratorRights : SpecialChatAdministratorRights {
|
||||
canManageTopics = canManageTopics,
|
||||
canPostStories = canPostStories,
|
||||
canEditStories = canEditStories,
|
||||
canDeleteStories = canDeleteStories
|
||||
canDeleteStories = canDeleteStories,
|
||||
canSendWelcomeMessages = canSendWelcomeMessages
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,4 +40,6 @@ data class ChatCommonAdministratorRights(
|
||||
override val canManageDirectMessages: Boolean = false,
|
||||
@SerialName(canManageTagsField)
|
||||
override val canManageTags: Boolean = false,
|
||||
@SerialName(canSendWelcomeMessagesField)
|
||||
override val canSendWelcomeMessages: Boolean = false,
|
||||
) : ChatAdministratorRights
|
||||
|
||||
@@ -50,6 +50,8 @@ data class OwnerChatMember(
|
||||
override val canManageDirectMessages: Boolean = true
|
||||
@Transient
|
||||
override val canManageTags: Boolean = true
|
||||
@Transient
|
||||
override val canSendWelcomeMessages: Boolean = true
|
||||
|
||||
@SerialName(statusField)
|
||||
@Required
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.types.communities
|
||||
|
||||
import dev.inmo.tgbotapi.types.idField
|
||||
import dev.inmo.tgbotapi.types.nameField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Represents a community (a group of chats)
|
||||
*/
|
||||
@Serializable
|
||||
data class Community(
|
||||
@SerialName(idField)
|
||||
val id: CommunityId,
|
||||
@SerialName(nameField)
|
||||
val name: String
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user