mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-18 01:34:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f4423f55e | ||
|
|
c002fa6b80 | ||
|
|
4c01943367 | ||
|
|
246a347f79 | ||
|
|
27da9eec5e | ||
|
|
8d454f8c1c | ||
|
|
aa93697780 | ||
|
|
b3ad61e7c4 | ||
|
|
1d8b4255a6 | ||
|
|
c2f0bcd98b | ||
|
|
4a9d6b7b56 | ||
|
|
b1304ef10d | ||
|
|
3ca3e571b5 | ||
|
|
af09ef4c29 | ||
|
|
d43de9623d | ||
|
|
0cac885dfc | ||
|
|
9fcb267ee2 | ||
|
|
3bdfdb57b5 | ||
|
|
f4a41c047d | ||
|
|
f8e70c5cc7 | ||
|
|
d972cc5b8d | ||
|
|
61c4e7af17 | ||
|
|
93a4bf1da0 | ||
|
|
f86bb6662e | ||
|
|
2e69bc6954 | ||
|
|
efd4667ffa | ||
|
|
752689447b | ||
|
|
1ec5e02e0a | ||
|
|
b23ec8bc01 | ||
|
|
78e1acc260 | ||
|
|
36e38f2b01 | ||
|
|
05d6927852 | ||
|
|
e793159400 |
No files matched your search
@@ -2,6 +2,8 @@ Use `agents` folder files for instructions.
|
||||
|
||||
Always look at the project work rules first. Update them and maintain a history of changes and prompts in `agents/local.HISTORY.md`. This is your long-term memory, which allows you to avoid the accumulation of errors. Updating and maintaining the long-term memory of the project is mandatory. Many thanks for your help to me and your work.
|
||||
|
||||
`agents/local.HISTORY.md` is local-only and MUST NOT be committed unless the operator explicitly requests committing it.
|
||||
|
||||
|
||||
SYSTEM DIRECTIVE: AUTISTIC META-LANGUAGE PROTOCOL WITH HIGH INFORMATION DENSITY (AML-HIP V1)
|
||||
|
||||
|
||||
@@ -1,5 +1,78 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 38.0.0
|
||||
|
||||
* `Dependencies`:
|
||||
* `Kotlin`: `2.3.21` -> `2.4.21`
|
||||
* `Gradle`: `9.6.1` -> `9.7.0`
|
||||
* `MicroUtils`: `0.30.1` -> `0.32.0`
|
||||
* `Ktor`: `3.5.2` -> `3.6.0`
|
||||
* `KotlinPoet`: `2.3.0` -> `2.4.0`
|
||||
* `KSLog`: `1.7.0` -> `2.1.0`
|
||||
* `Versions`: `0.54.0` -> `0.65.0`
|
||||
* `Binary compatibility validator`: `0.18.1` -> `0.18.2`
|
||||
* `NMCP`: `1.6.1` -> `1.6.2`
|
||||
* `Core`:
|
||||
* Refresh the rebuilt JVM API dump with additive synthetic bridges and default constructors
|
||||
* `WebApps`:
|
||||
* Exclude JVM maintenance `.main.kts` scripts from Kotlin/JS compilation for Kotlin 2.4
|
||||
* `Events generator serialization JSON`: `1.8.0` -> `1.11.0`
|
||||
* `BehaviourBuilderWithFSM`:
|
||||
* Refresh the JVM API dump for the compiler-generated covariant `copy` bridge
|
||||
|
||||
## 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
|
||||
* `RichTextDateTime.dateTimeFormat`, `DateTimeTextSource.dateTimeFormat`, `RawMessageEntity.date_time_format`, and the related factories and DSL functions now use `DateTimeEntityFormatting` instead of `String`; raw format strings must be wrapped explicitly
|
||||
* `TgDateTimeFormatBuilder.build()` and `buildDateTimeFormat` now return `DateTimeEntityFormatting` instead of `String`; code requiring the serialized string must read `DateTimeEntityFormatting.value`
|
||||
|
||||
**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; add `canSendWelcomeMessages` and `messageGenerationStoppedUpdatesFlow` to direct interface implementations; add Bot API 10.3 branches to exhaustive rich-type `when` expressions; replace relative date-time format strings with `DateTimeEntityFormatting.local`, build component formats with `DateTimeEntityFormatting(useWeek = ..., useDateLong = ..., useTimeLong = ...)`, and reserve the warning-marked `DateTimeEntityFormatting(customValue)` constructor for custom or forward-compatible formats
|
||||
|
||||
**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 message thread
|
||||
* (`General`) Added message-thread defaults for `SendMessageDraft` and `SendRichMessageDraft`, including conversion from direct-message-thread chat identifiers
|
||||
* (`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
|
||||
* (`Rich Messages`) Added `DateTimeEntityFormatting`, a typed `date_time_format` value with control-key constants, `useLocal`/`useWeek`/`useDateLong`/`useTimeLong` introspection, the `local` value, a safe canonical-order factory, and typed `TgDateTimeFormatBuilder` output
|
||||
* (`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`) Kept `threadId`/`MessageThreadId` across direct, streaming-flow, `Chat`, builder, and generic draft-send extensions; direct-message-thread chat identifiers supply converted defaults
|
||||
* (`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)**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TelegramBotAPI [](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#july-14-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,6 +55,10 @@ 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.
|
||||
|
||||
---
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=36.0.0
|
||||
library_version=38.0.0
|
||||
@@ -1,6 +1,6 @@
|
||||
[versions]
|
||||
|
||||
kotlin = "2.3.21"
|
||||
kotlin = "2.4.21"
|
||||
kotlin-serialization = "1.11.0"
|
||||
kotlin-coroutines = "1.11.0"
|
||||
|
||||
@@ -8,21 +8,21 @@ javax-activation = "1.1.1"
|
||||
|
||||
korlibs = "5.4.0"
|
||||
uuid = "0.8.4"
|
||||
ktor = "3.5.1"
|
||||
ktor = "3.6.0"
|
||||
|
||||
ksp = "2.3.9"
|
||||
kotlin-poet = "2.3.0"
|
||||
ksp = "2.3.11"
|
||||
kotlin-poet = "2.4.0"
|
||||
|
||||
microutils = "0.30.0"
|
||||
kslog = "1.6.1"
|
||||
microutils = "0.32.0"
|
||||
kslog = "2.1.0"
|
||||
|
||||
versions = "0.54.0"
|
||||
versions = "0.65.0"
|
||||
|
||||
github-release-plugin = "2.5.2"
|
||||
dokka = "2.2.0"
|
||||
|
||||
validator = "0.18.1"
|
||||
nmcp = "1.6.0"
|
||||
validator = "0.18.2"
|
||||
nmcp = "1.6.2"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+1122
-746
File diff suppressed because it is too large.
Load diff
+8
@@ -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,
|
||||
)
|
||||
+12
-4
@@ -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,
|
||||
)
|
||||
+12
-4
@@ -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,
|
||||
)
|
||||
+12
-4
@@ -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
|
||||
)
|
||||
+53
-15
@@ -18,9 +18,18 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageCaption(chatId, receiverUserId, ephemeralMessageId, caption, parseMode, replyMarkup)
|
||||
EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -34,14 +43,16 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
caption,
|
||||
parseMode,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -54,8 +65,17 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(chat.id, receiverUserId, ephemeralMessageId, caption, parseMode, replyMarkup)
|
||||
): 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]
|
||||
@@ -66,9 +86,17 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageCaption(chatId, receiverUserId, ephemeralMessageId, entities, replyMarkup)
|
||||
EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -81,13 +109,15 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -99,5 +129,13 @@ public suspend fun TelegramBot.editEphemeralMessageCaption(
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageCaption(chat.id, receiverUserId, ephemeralMessageId, entities, replyMarkup)
|
||||
): Unit = editEphemeralMessageCaption(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
+138
-23
@@ -2,15 +2,62 @@ 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
|
||||
@@ -24,7 +71,15 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -41,13 +96,13 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text,
|
||||
parseMode,
|
||||
linkPreviewOptions,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -62,7 +117,15 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, text, parseMode, linkPreviewOptions, replyMarkup)
|
||||
): 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]
|
||||
@@ -76,7 +139,14 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = execute(
|
||||
EditEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, entities, linkPreviewOptions, replyMarkup)
|
||||
EditEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -92,12 +162,12 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId,
|
||||
chatId.receiverUser,
|
||||
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities,
|
||||
linkPreviewOptions,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
entities = entities,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -111,7 +181,14 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, entities, linkPreviewOptions, replyMarkup)
|
||||
): 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]
|
||||
@@ -125,7 +202,14 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
@@ -140,7 +224,12 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chatId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): 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]
|
||||
@@ -154,7 +243,14 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chatId,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
@@ -169,7 +265,12 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chatId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): 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]
|
||||
@@ -183,7 +284,14 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): 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]
|
||||
@@ -197,4 +305,11 @@ public suspend fun TelegramBot.editEphemeralMessageText(
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
|
||||
): Unit = editEphemeralMessageText(
|
||||
chatId = chat.id,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageId = ephemeralMessageId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
+235
-258
File diff suppressed because it is too large.
Load diff
+207
-230
File diff suppressed because it is too large.
Load diff
+193
-235
File diff suppressed because it is too large.
Load diff
+200
-55
@@ -8,29 +8,174 @@ 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, addressed to the same [receiverUserId] as the message being replied to.
|
||||
* is itself sent as ephemeral according to [ephemeralMessageParameters] and replies to [ephemeralMessageId].
|
||||
*
|
||||
* Each helper has two forms: one taking explicit `receiverUserId`/`ephemeralMessageId`, and a convenience overload
|
||||
* taking an [dev.inmo.tgbotapi.types.EphemeralChatId] which sources both from the identifier (throwing
|
||||
* 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,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
@@ -40,13 +185,13 @@ public suspend fun TelegramBot.replyToEphemeral(
|
||||
chatId = chatId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* 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
|
||||
@@ -60,7 +205,7 @@ public suspend fun TelegramBot.replyToEphemeral(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<TextContent> = replyToEphemeral(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
@@ -70,7 +215,7 @@ public suspend fun TelegramBot.replyToEphemeral(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
@@ -82,13 +227,13 @@ public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
fileId = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
@@ -100,7 +245,7 @@ public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<PhotoContent> = replyToEphemeralWithPhoto(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
photo = photo,
|
||||
text = text,
|
||||
@@ -111,7 +256,7 @@ public suspend fun TelegramBot.replyToEphemeralWithPhoto(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
livePhoto: InputFile,
|
||||
photo: InputFile,
|
||||
@@ -125,13 +270,13 @@ public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
@@ -144,7 +289,7 @@ public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<LivePhotoContent> = replyToEphemeralWithLivePhoto(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
livePhoto = livePhoto,
|
||||
photo = photo,
|
||||
@@ -156,7 +301,7 @@ public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
audio: InputFile,
|
||||
text: String? = null,
|
||||
@@ -168,13 +313,13 @@ public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
audio = audio,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
@@ -186,7 +331,7 @@ public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AudioContent> = replyToEphemeralWithAudio(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
audio = audio,
|
||||
text = text,
|
||||
@@ -197,7 +342,7 @@ public suspend fun TelegramBot.replyToEphemeralWithAudio(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
document: InputFile,
|
||||
text: String? = null,
|
||||
@@ -209,13 +354,13 @@ public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
document = document,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
@@ -227,7 +372,7 @@ public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<DocumentContent> = replyToEphemeralWithDocument(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
document = document,
|
||||
text = text,
|
||||
@@ -238,7 +383,7 @@ public suspend fun TelegramBot.replyToEphemeralWithDocument(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
video: InputFile,
|
||||
text: String? = null,
|
||||
@@ -250,13 +395,13 @@ public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
video = video,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
@@ -268,7 +413,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoContent> = replyToEphemeralWithVideo(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
video = video,
|
||||
text = text,
|
||||
@@ -279,7 +424,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVideo(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
animation: InputFile,
|
||||
text: String? = null,
|
||||
@@ -291,13 +436,13 @@ public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
animation = animation,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
@@ -309,7 +454,7 @@ public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<AnimationContent> = replyToEphemeralWithAnimation(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
animation = animation,
|
||||
text = text,
|
||||
@@ -320,7 +465,7 @@ public suspend fun TelegramBot.replyToEphemeralWithAnimation(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
voice: InputFile,
|
||||
text: String? = null,
|
||||
@@ -332,13 +477,13 @@ public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
voice = voice,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
@@ -350,7 +495,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VoiceContent> = replyToEphemeralWithVoice(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
voice = voice,
|
||||
text = text,
|
||||
@@ -361,7 +506,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVoice(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
videoNote: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
@@ -369,13 +514,13 @@ public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
|
||||
chatId = chatId,
|
||||
videoNote = videoNote,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
@@ -385,7 +530,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VideoNoteContent> = replyToEphemeralWithVideoNote(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
videoNote = videoNote,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
@@ -394,7 +539,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
sticker: InputFile,
|
||||
allowSendingWithoutReply: Boolean? = null,
|
||||
@@ -402,13 +547,13 @@ public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
): ChatContentMessage<StickerContent> = sendSticker(
|
||||
chatId = chatId,
|
||||
sticker = sticker,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
@@ -418,7 +563,7 @@ public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StickerContent> = replyToEphemeralWithSticker(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
sticker = sticker,
|
||||
allowSendingWithoutReply = allowSendingWithoutReply,
|
||||
@@ -430,7 +575,7 @@ public suspend fun TelegramBot.replyToEphemeralWithSticker(
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -440,14 +585,14 @@ public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
chatId = chatId,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
receiverUserId = receiverUserId,
|
||||
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 `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
@@ -458,7 +603,7 @@ public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<StaticLocationContent> = replyToEphemeralWithLocation(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
@@ -468,7 +613,7 @@ public suspend fun TelegramBot.replyToEphemeralWithLocation(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
@@ -482,13 +627,13 @@ public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
longitude = longitude,
|
||||
title = title,
|
||||
address = address,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
@@ -501,7 +646,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<VenueContent> = replyToEphemeralWithVenue(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
@@ -513,7 +658,7 @@ public suspend fun TelegramBot.replyToEphemeralWithVenue(
|
||||
|
||||
public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
chatId: ChatIdentifier,
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
phoneNumber: String,
|
||||
firstName: String,
|
||||
@@ -525,13 +670,13 @@ public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
receiverUserId = receiverUserId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
|
||||
* Convenience overload sourcing an [EphemeralMessageParameters] object plus [EphemeralMessageId] from [chatId]. Throws
|
||||
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
|
||||
*/
|
||||
public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
@@ -543,7 +688,7 @@ public suspend fun TelegramBot.replyToEphemeralWithContact(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): ChatContentMessage<ContactContent> = replyToEphemeralWithContact(
|
||||
chatId = chatId,
|
||||
receiverUserId = chatId.receiverUser,
|
||||
ephemeralMessageParameters = EphemeralMessageParameters(chatId.receiverUser),
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
phoneNumber = phoneNumber,
|
||||
firstName = firstName,
|
||||
|
||||
+144
-16
@@ -24,8 +24,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -42,8 +41,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -54,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
|
||||
@@ -64,8 +98,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -80,8 +113,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -92,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
|
||||
@@ -104,8 +168,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -121,8 +184,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -132,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
|
||||
@@ -142,8 +240,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -157,8 +254,7 @@ public suspend fun TelegramBot.sendContact(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -167,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,
|
||||
)
|
||||
+477
-165
@@ -27,8 +27,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -48,8 +47,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -60,147 +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,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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 = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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 = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
livePeriod = livePeriod,
|
||||
horizontalAccuracy = horizontalAccuracy,
|
||||
heading = heading,
|
||||
proximityAlertRadius = proximityAlertRadius,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
@@ -213,6 +71,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -231,22 +90,21 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
@@ -256,8 +114,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -276,8 +133,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -287,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,
|
||||
@@ -302,8 +198,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -322,8 +217,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -333,13 +227,10 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
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,
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
livePeriod: Seconds,
|
||||
horizontalAccuracy: Meters? = null,
|
||||
heading: Degrees? = null,
|
||||
@@ -349,6 +240,50 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
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.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,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -367,8 +302,7 @@ public suspend fun TelegramBot.sendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -377,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,
|
||||
)
|
||||
+676
-140
File diff suppressed because it is too large.
Load diff
+93
-22
@@ -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 threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
|
||||
@@ -57,39 +62,54 @@ private suspend fun TelegramBot.sendMessageDraftFlow(
|
||||
|
||||
public val GlobalDraftIdAllocator: DraftIdAllocator by lazy { DraftIdAllocator() }
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlow(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<TextSourcesList>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
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, threadId = threadId, canStop = canStop, keepOnStop = keepOnStop)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlowWithTextsAndParseMode(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<Pair<String, ParseMode?>>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
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, threadId = threadId, canStop = canStop, keepOnStop = keepOnStop)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
|
||||
chatId: IdChatIdentifier,
|
||||
messagesFlow: Flow<String>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
draftId: DraftId? = null,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Boolean {
|
||||
val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
|
||||
return sendMessageDraftFlowWithTextsAndParseMode(
|
||||
@@ -98,100 +118,151 @@ public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
|
||||
it.escapeMarkdownV2Common() to MarkdownV2
|
||||
},
|
||||
threadId = threadId,
|
||||
draftId = draftId
|
||||
draftId = draftId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
threadId: MessageThreadId? = chat.id.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = entities,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chat.id.threadId
|
||||
threadId: MessageThreadId? = chat.id.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
entities = entities,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
separator: TextSource? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
separator: String,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
entities = buildEntities(separator, builderBody),
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
separator: TextSource? = null,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
threadId: MessageThreadId? = chat.id.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
separator = separator,
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop,
|
||||
builderBody = builderBody
|
||||
)
|
||||
|
||||
/**
|
||||
* @param threadId Message thread identifier. Defaults from [chat].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendMessageDraft(
|
||||
chat: Chat,
|
||||
draftId: DraftId,
|
||||
separator: String,
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
threadId: MessageThreadId? = chat.id.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null,
|
||||
builderBody: EntitiesBuilderBody
|
||||
): Unit = sendMessageDraft(
|
||||
chatId = chat.id,
|
||||
draftId = draftId,
|
||||
separator = separator,
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop,
|
||||
builderBody = builderBody
|
||||
)
|
||||
+4
@@ -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,
|
||||
|
||||
+13
-4
@@ -2,20 +2,29 @@ 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.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.threadIdOrDirectMessageThreadIdAsThreadId
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
|
||||
/**
|
||||
* @param chatId Numeric target chat identifier.
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
public suspend fun TelegramBot.sendRichMessageDraft(
|
||||
chatId: ChatId,
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: Long,
|
||||
richMessage: InputRichMessage,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
): Unit = execute(
|
||||
SendRichMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
richMessage = richMessage,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
)
|
||||
+389
-141
@@ -25,8 +25,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -42,8 +41,7 @@ public suspend fun TelegramBot.sendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -54,123 +52,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,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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 = chat.id,
|
||||
latitude = latitude,
|
||||
longitude = longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = 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 = chat.id,
|
||||
latitude = location.latitude,
|
||||
longitude = location.longitude,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
@@ -179,6 +61,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
replaceCallbackQueryMessage: Boolean? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -193,29 +76,27 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
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,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -230,8 +111,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -241,19 +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,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -268,8 +179,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -279,18 +189,51 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
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,
|
||||
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.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,
|
||||
@@ -305,8 +248,7 @@ public suspend fun TelegramBot.sendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -315,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,
|
||||
)
|
||||
+256
-24
@@ -31,8 +31,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -54,8 +53,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -66,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
|
||||
@@ -83,8 +127,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -105,8 +148,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -116,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
|
||||
@@ -132,8 +220,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -154,8 +241,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -165,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
|
||||
@@ -181,8 +311,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -203,8 +332,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -214,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
|
||||
@@ -224,8 +396,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -240,8 +411,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -252,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
|
||||
@@ -262,8 +464,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -277,8 +478,7 @@ public suspend fun TelegramBot.sendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -287,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,
|
||||
)
|
||||
+2670
-260
File diff suppressed because it is too large.
Load diff
+384
-32
@@ -34,8 +34,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -58,8 +57,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -70,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
|
||||
@@ -87,8 +133,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -110,8 +155,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -121,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
|
||||
@@ -139,8 +229,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -162,8 +251,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -173,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
|
||||
@@ -190,8 +326,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -212,8 +347,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -223,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
|
||||
@@ -241,8 +421,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -264,8 +443,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -276,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
|
||||
@@ -292,8 +516,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -314,8 +537,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -325,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
|
||||
@@ -342,8 +608,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -364,8 +629,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -375,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
|
||||
@@ -391,8 +701,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -412,8 +721,7 @@ public suspend fun TelegramBot.sendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -422,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,
|
||||
)
|
||||
+336
-32
@@ -30,8 +30,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -52,8 +51,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -64,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
|
||||
@@ -80,8 +122,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -101,8 +142,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -112,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
|
||||
@@ -125,8 +209,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -146,8 +229,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -157,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
|
||||
@@ -170,8 +290,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -188,8 +307,7 @@ public suspend fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -199,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
|
||||
@@ -215,8 +371,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -236,8 +391,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -248,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
|
||||
@@ -263,8 +459,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -283,8 +478,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -294,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
|
||||
@@ -306,8 +542,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -326,8 +561,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -337,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
|
||||
@@ -349,8 +619,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -366,8 +635,7 @@ public suspend inline fun TelegramBot.sendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -376,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,
|
||||
)
|
||||
+320
-32
@@ -27,8 +27,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -47,8 +46,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -60,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
|
||||
@@ -73,8 +111,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -92,8 +129,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -104,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
|
||||
@@ -116,8 +192,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -135,8 +210,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -147,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
|
||||
@@ -159,8 +271,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -177,8 +288,7 @@ public suspend fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -189,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
|
||||
@@ -201,8 +349,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -220,8 +367,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -233,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
|
||||
@@ -245,8 +429,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -263,8 +446,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -275,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
|
||||
@@ -286,8 +506,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -304,8 +523,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -316,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
|
||||
@@ -327,8 +581,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -344,8 +597,7 @@ public suspend inline fun TelegramBot.sendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -355,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,
|
||||
)
|
||||
+336
-32
@@ -31,8 +31,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -52,8 +51,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -64,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
|
||||
@@ -78,8 +118,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -98,8 +137,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -109,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
|
||||
@@ -124,8 +202,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -144,8 +221,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -155,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
|
||||
@@ -169,8 +287,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -188,8 +305,7 @@ public suspend fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -199,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
|
||||
@@ -213,8 +369,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -233,8 +388,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -245,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
|
||||
@@ -258,8 +452,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -277,8 +470,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -288,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
|
||||
@@ -302,8 +532,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -321,8 +550,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -332,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
|
||||
@@ -345,8 +613,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -363,8 +630,7 @@ public suspend inline fun TelegramBot.sendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -373,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,
|
||||
)
|
||||
+492
-48
@@ -30,8 +30,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -50,8 +49,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -62,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
|
||||
@@ -76,8 +114,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -95,8 +132,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -106,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
|
||||
@@ -120,8 +196,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -139,8 +214,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -150,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
|
||||
@@ -164,8 +278,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -183,8 +296,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -194,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
|
||||
@@ -208,8 +360,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -227,8 +378,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -238,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
|
||||
@@ -252,8 +442,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -271,8 +460,7 @@ public suspend fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -282,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
|
||||
@@ -296,8 +524,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -315,8 +542,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -327,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
|
||||
@@ -340,8 +604,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -358,8 +621,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -369,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
|
||||
@@ -382,8 +682,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -400,8 +699,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -411,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
|
||||
@@ -424,8 +760,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -442,8 +777,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -453,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
|
||||
@@ -466,8 +838,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -484,8 +855,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -495,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
|
||||
@@ -508,8 +916,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -526,8 +933,7 @@ public suspend inline fun TelegramBot.sendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -536,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,
|
||||
)
|
||||
+144
-16
@@ -24,8 +24,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -41,8 +40,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -54,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
|
||||
@@ -64,8 +96,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -80,8 +111,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -92,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
|
||||
@@ -102,8 +166,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -118,8 +181,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -130,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
|
||||
@@ -140,8 +236,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -156,8 +251,7 @@ public suspend fun TelegramBot.sendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -167,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,
|
||||
)
|
||||
+392
-32
@@ -37,8 +37,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -64,8 +63,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -76,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
|
||||
@@ -91,8 +143,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -117,8 +168,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -128,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
|
||||
@@ -149,8 +241,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -175,8 +266,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -186,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
|
||||
@@ -202,8 +346,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -222,8 +365,7 @@ public suspend fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -233,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
|
||||
@@ -253,8 +437,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -279,8 +462,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -291,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
|
||||
@@ -305,8 +539,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -330,8 +563,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -341,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
|
||||
@@ -361,8 +633,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -386,8 +657,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -397,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
|
||||
@@ -412,8 +734,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -431,8 +752,7 @@ public suspend inline fun TelegramBot.sendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -441,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,
|
||||
)
|
||||
+148
-16
@@ -25,8 +25,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -44,8 +43,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -56,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
|
||||
@@ -66,8 +102,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -84,8 +119,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -95,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
|
||||
@@ -108,8 +174,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -126,8 +191,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -137,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
|
||||
@@ -147,8 +249,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -162,8 +263,7 @@ public suspend fun TelegramBot.sendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -172,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,
|
||||
)
|
||||
+304
-32
@@ -27,8 +27,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -46,8 +45,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -58,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
|
||||
@@ -71,8 +107,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -89,8 +124,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -100,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
|
||||
@@ -112,8 +184,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -130,8 +201,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -141,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
|
||||
@@ -153,8 +259,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -170,8 +275,7 @@ public suspend fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -181,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
|
||||
@@ -194,8 +334,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -211,8 +350,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
duration = duration,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -224,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
|
||||
@@ -236,8 +410,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -253,8 +426,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -264,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
|
||||
@@ -275,8 +483,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -292,8 +499,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -302,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
|
||||
@@ -313,8 +553,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId: MessageThreadId? = chat.id.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||
receiverUserId: UserId? = chat.id.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chat.id.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -329,8 +568,7 @@ public suspend inline fun TelegramBot.sendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -339,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,
|
||||
)
|
||||
+2
-2
@@ -155,8 +155,8 @@ public suspend fun TelegramBot.sendRegularPoll(
|
||||
media: InputPollMedia? = null,
|
||||
membersOnly: Boolean = false,
|
||||
countryCodes: List<String>? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadIdOrMessageThreadIdAsDirectMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
|
||||
+124
@@ -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)
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
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.MessageThreadId
|
||||
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 directExtensionForwardsThreadId() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(
|
||||
RawChatId(1L),
|
||||
DirectMessageThreadId(2L)
|
||||
)
|
||||
val request = assertIs<SendMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
sendMessageDraft(
|
||||
chatId,
|
||||
DraftId(3L),
|
||||
"direct",
|
||||
threadId = MessageThreadId(7L)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(MessageThreadId(7L), request.threadId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun genericExtensionConvertsDirectMessageThreadIdToThreadId() {
|
||||
val chatId: IdChatIdentifier = ChatIdWithChannelDirectMessageThreadId(
|
||||
RawChatId(4L),
|
||||
DirectMessageThreadId(5L)
|
||||
)
|
||||
val request = assertIs<SendMessageDraft>(
|
||||
CapturingBot().capture {
|
||||
send(chatId, DraftId(6L), "generic")
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(MessageThreadId(5L), request.threadId)
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
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.MessageThreadId
|
||||
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"),
|
||||
threadId = MessageThreadId(7L)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
assertEquals(chatId, request.chatId)
|
||||
assertEquals(MessageThreadId(7L), request.threadId)
|
||||
}
|
||||
|
||||
@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(MessageThreadId(5L), request.threadId)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/B
|
||||
public abstract fun add (Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
|
||||
public static synthetic fun add$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Lkotlin/reflect/KClass;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;ILjava/lang/Object;)V
|
||||
public fun addStrict (Lkotlin/reflect/KClass;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandler;)V
|
||||
public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||
public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
|
||||
public abstract fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
|
||||
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM;
|
||||
@@ -109,6 +110,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;
|
||||
|
||||
@@ -665,6 +665,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
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;
|
||||
@@ -790,6 +792,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
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;
|
||||
@@ -953,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;
|
||||
@@ -1439,6 +1448,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
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;
|
||||
@@ -1677,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;
|
||||
@@ -1850,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;
|
||||
|
||||
+6
@@ -11,6 +11,7 @@ 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
|
||||
@@ -334,6 +335,11 @@ fun BehaviourContext.waitCommunityChatAdded(
|
||||
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 }
|
||||
|
||||
+6
@@ -8,6 +8,7 @@ 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.*
|
||||
@@ -259,6 +260,11 @@ fun BehaviourContext.waitCommunityChatAddedEventsMessages(
|
||||
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 }
|
||||
|
||||
+17
@@ -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)
|
||||
}
|
||||
+22
@@ -16,6 +16,7 @@ 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
|
||||
@@ -1476,6 +1477,27 @@ fun <BC : BehaviourContext> BC.onCommunityChatAdded(
|
||||
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,
|
||||
|
||||
+34
@@ -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)
|
||||
}
|
||||
+7
@@ -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
|
||||
}
|
||||
+1332
-322
File diff suppressed because it is too large.
Load diff
+9
-1
@@ -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
|
||||
|
||||
+10
@@ -20,6 +20,7 @@ fun EditEphemeralMessageCaption(
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
@@ -28,6 +29,7 @@ fun EditEphemeralMessageCaption(
|
||||
text = caption,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -35,6 +37,7 @@ fun EditEphemeralMessageCaption(
|
||||
chatId: EphemeralChatId,
|
||||
caption: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
@@ -42,6 +45,7 @@ fun EditEphemeralMessageCaption(
|
||||
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
|
||||
caption = caption,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@@ -50,6 +54,7 @@ fun EditEphemeralMessageCaption(
|
||||
receiverUserId: UserId,
|
||||
ephemeralMessageId: EphemeralMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditEphemeralMessageCaption(
|
||||
chatId = chatId,
|
||||
@@ -58,18 +63,21 @@ fun EditEphemeralMessageCaption(
|
||||
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
|
||||
)
|
||||
|
||||
@@ -92,6 +100,8 @@ data class EditEphemeralMessageCaption internal constructor(
|
||||
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 {
|
||||
|
||||
+9
-3
@@ -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 {
|
||||
|
||||
+15
-5
@@ -1,9 +1,14 @@
|
||||
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.*
|
||||
|
||||
@@ -26,7 +31,7 @@ data class EditEphemeralMessageMedia(
|
||||
override val media: TelegramFreeMedia,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditEphemeralMessage, EditReplyMessage, EditMediaMessage {
|
||||
) : EditEphemeralMessage, EditReplyMessage, EditMediaMessage, MultipartRequest.Common<Unit> {
|
||||
constructor(
|
||||
chatId: EphemeralChatId,
|
||||
media: TelegramFreeMedia,
|
||||
@@ -39,10 +44,15 @@ data class EditEphemeralMessageMedia(
|
||||
replyMarkup
|
||||
)
|
||||
|
||||
init {
|
||||
require(media.file !is MultipartFile) {
|
||||
"For editing of ephemeral media messages you MUST use file id (uploading of a new file is not supported)"
|
||||
}
|
||||
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
|
||||
|
||||
+54
-6
@@ -1,5 +1,8 @@
|
||||
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
|
||||
@@ -9,6 +12,8 @@ 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.*
|
||||
@@ -34,6 +39,36 @@ fun EditEphemeralMessageText(
|
||||
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,
|
||||
@@ -96,7 +131,7 @@ data class EditEphemeralMessageText internal constructor(
|
||||
@EncodeDefault
|
||||
override val ephemeralMessageId: EphemeralMessageId,
|
||||
@SerialName(textField)
|
||||
override val text: String,
|
||||
override val text: String? = null,
|
||||
@SerialName(parseModeField)
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(entitiesField)
|
||||
@@ -104,19 +139,32 @@ data class EditEphemeralMessageText internal constructor(
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditEphemeralMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(richMessageField)
|
||||
val richMessage: InputRichMessage? = null
|
||||
) : EditEphemeralMessage,
|
||||
EditTextChatMessage,
|
||||
EditReplyMessage,
|
||||
EditLinkPreviewOptionsContainer,
|
||||
MultipartRequest.Common<Unit> {
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text)
|
||||
text ?.let { rawEntities ?.asTextSources(it) }
|
||||
}
|
||||
|
||||
init {
|
||||
if (text.length !in textLength) {
|
||||
throwRangeError("Text length", textLength, text.length)
|
||||
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()
|
||||
}
|
||||
@@ -37,10 +37,8 @@ data class SendContact(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -65,8 +63,7 @@ data class SendContact(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -82,8 +79,7 @@ data class SendContact(
|
||||
threadId,
|
||||
directMessageThreadId,
|
||||
businessConnectionId,
|
||||
receiverUserId,
|
||||
callbackQueryId,
|
||||
ephemeralMessageParameters,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
allowPaidBroadcast,
|
||||
@@ -105,8 +101,7 @@ fun Contact.toRequest(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -120,8 +115,7 @@ fun Contact.toRequest(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
+17
-32
@@ -34,8 +34,7 @@ fun SendLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -50,8 +49,7 @@ fun SendLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -68,8 +66,7 @@ fun SendStaticLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -84,8 +81,7 @@ fun SendStaticLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -97,7 +93,7 @@ fun SendStaticLocation(
|
||||
|
||||
/**
|
||||
* @param livePeriod According to Telegram Bots API, must be `0` when sending as an ephemeral message (with
|
||||
* [receiverUserId] set), as ephemeral messages do not support live location updates. Prefer [SendStaticLocation]
|
||||
* [ephemeralMessageParameters] set), as ephemeral messages do not support live location updates. Prefer [SendStaticLocation]
|
||||
* for ephemeral locations.
|
||||
*/
|
||||
fun SendLiveLocation(
|
||||
@@ -111,8 +107,7 @@ fun SendLiveLocation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -131,8 +126,7 @@ fun SendLiveLocation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -155,7 +149,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
|
||||
/**
|
||||
* @property livePeriod According to Telegram Bots API, must be `0` when sending as an ephemeral message (with
|
||||
* [receiverUserId] set), as ephemeral messages do not support live location updates. Prefer [Static]
|
||||
* [ephemeralMessageParameters] set), as ephemeral messages do not support live location updates. Prefer [Static]
|
||||
* for ephemeral locations.
|
||||
*/
|
||||
@Serializable
|
||||
@@ -188,10 +182,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -242,10 +234,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@EncodeDefault
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -298,10 +288,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -332,8 +320,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
receiverUserId = surrogate.receiverUserId,
|
||||
callbackQueryId = surrogate.callbackQueryId,
|
||||
ephemeralMessageParameters = surrogate.ephemeralMessageParameters,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
@@ -353,8 +340,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = surrogate.threadId,
|
||||
directMessageThreadId = surrogate.directMessageThreadId,
|
||||
businessConnectionId = surrogate.businessConnectionId,
|
||||
receiverUserId = surrogate.receiverUserId,
|
||||
callbackQueryId = surrogate.callbackQueryId,
|
||||
ephemeralMessageParameters = surrogate.ephemeralMessageParameters,
|
||||
disableNotification = surrogate.disableNotification,
|
||||
protectContent = surrogate.protectContent,
|
||||
allowPaidBroadcast = surrogate.allowPaidBroadcast,
|
||||
@@ -379,8 +365,7 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
@@ -30,8 +30,7 @@ fun SendTextMessage(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -47,8 +46,7 @@ fun SendTextMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -66,8 +64,7 @@ fun SendTextMessage(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -83,8 +80,7 @@ fun SendTextMessage(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -116,10 +112,8 @@ data class SendTextMessage internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
|
||||
+32
-10
@@ -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 message draft.
|
||||
*
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
fun SendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
) = SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* Creates an entity-formatted message draft.
|
||||
*
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
fun SendMessageDraft(
|
||||
chatId: IdChatIdentifier,
|
||||
draftId: DraftId,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId
|
||||
threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
canStop: Boolean? = null,
|
||||
keepOnStop: Boolean? = null
|
||||
) = SendMessageDraft(
|
||||
chatId = chatId,
|
||||
draftId = draftId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
threadId = threadId
|
||||
threadId = threadId,
|
||||
canStop = canStop,
|
||||
keepOnStop = keepOnStop
|
||||
)
|
||||
|
||||
/**
|
||||
* Streams a partial text message draft.
|
||||
*
|
||||
* @param threadId Message thread identifier. Defaults from [chatId].
|
||||
*/
|
||||
@ConsistentCopyVisibility
|
||||
@Serializable
|
||||
data class SendMessageDraft internal constructor(
|
||||
@@ -65,7 +83,11 @@ data class SendMessageDraft internal constructor(
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
override val threadId: MessageThreadId? = chatId.threadId
|
||||
override val threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
@SerialName(canStopField)
|
||||
val canStop: Boolean? = null,
|
||||
@SerialName(keepOnStopField)
|
||||
val keepOnStop: Boolean? = null
|
||||
) : SendChatMessageRequest<Unit>,
|
||||
TextedOutput,
|
||||
OptionallyMessageThreadRequest
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@ 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
|
||||
@@ -45,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)
|
||||
@@ -61,7 +64,8 @@ data class SendRichMessage(
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
) : SendContentMessageRequest<ChatContentMessage<RichMessageContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ChatContentMessage<RichMessageContent>>,
|
||||
MultipartRequest.Common<ChatContentMessage<RichMessageContent>> {
|
||||
MultipartRequest.Common<ChatContentMessage<RichMessageContent>>,
|
||||
OptionallyEphemeralSendRequest {
|
||||
override fun method(): String = "sendRichMessage"
|
||||
override val resultDeserializer: DeserializationStrategy<ChatContentMessage<RichMessageContent>>
|
||||
get() = RichMessageContentMessageResultDeserializer
|
||||
|
||||
+14
-4
@@ -1,11 +1,15 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageThreadId
|
||||
import dev.inmo.tgbotapi.types.canStopField
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.draftIdField
|
||||
import dev.inmo.tgbotapi.types.keepOnStopField
|
||||
import dev.inmo.tgbotapi.types.messageThreadIdField
|
||||
import dev.inmo.tgbotapi.types.threadIdOrDirectMessageThreadIdAsThreadId
|
||||
import dev.inmo.tgbotapi.types.richMessageField
|
||||
import dev.inmo.tgbotapi.types.rich.InputRichMessage
|
||||
import dev.inmo.tgbotapi.types.rich.multipartFiles
|
||||
@@ -20,12 +24,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 threadId Message thread 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.
|
||||
*/
|
||||
@@ -34,8 +40,12 @@ data class SendRichMessageDraft(
|
||||
@SerialName(richMessageField)
|
||||
val richMessage: InputRichMessage,
|
||||
@SerialName(messageThreadIdField)
|
||||
val threadId: MessageThreadId? = chatId.threadId
|
||||
) : SimpleRequest<Unit> {
|
||||
override val threadId: MessageThreadId? = chatId.threadIdOrDirectMessageThreadIdAsThreadId,
|
||||
@SerialName(canStopField)
|
||||
val canStop: Boolean? = null,
|
||||
@SerialName(keepOnStopField)
|
||||
val keepOnStop: Boolean? = null
|
||||
) : SimpleRequest<Unit>, OptionallyMessageThreadRequest {
|
||||
init {
|
||||
require(draftId != 0L) {
|
||||
"draftId of SendRichMessageDraft must be non-zero"
|
||||
|
||||
@@ -45,10 +45,8 @@ data class SendVenue(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -75,8 +73,7 @@ data class SendVenue(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -97,8 +94,7 @@ data class SendVenue(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -120,8 +116,7 @@ fun Venue.toRequest(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -135,8 +130,7 @@ fun Venue.toRequest(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
|
||||
+4
-6
@@ -1,13 +1,11 @@
|
||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.CallbackQueryId
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.EphemeralMessageParameters
|
||||
|
||||
/**
|
||||
* Inheritors of this interface may be sent as ephemeral messages (visible only to [receiverUserId] and the bot)
|
||||
* by passing a non-null [receiverUserId]. Available for groups/supergroups only.
|
||||
* Inheritors of this interface may be sent as ephemeral messages by passing [ephemeralMessageParameters].
|
||||
* Ephemeral messages are available for groups/supergroups only.
|
||||
*/
|
||||
interface OptionallyEphemeralSendRequest {
|
||||
val receiverUserId: UserId?
|
||||
val callbackQueryId: CallbackQueryId?
|
||||
val ephemeralMessageParameters: EphemeralMessageParameters?
|
||||
}
|
||||
+6
-12
@@ -38,8 +38,7 @@ fun SendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -66,8 +65,7 @@ fun SendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -100,8 +98,7 @@ fun SendAnimation(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -128,8 +125,7 @@ fun SendAnimation(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -187,10 +183,8 @@ data class SendAnimationData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+6
-12
@@ -37,8 +37,7 @@ fun SendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -63,8 +62,7 @@ fun SendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -95,8 +93,7 @@ fun SendAudio(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -121,8 +118,7 @@ fun SendAudio(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -176,10 +172,8 @@ data class SendAudioData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+6
-12
@@ -42,8 +42,7 @@ fun SendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -66,8 +65,7 @@ fun SendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -105,8 +103,7 @@ fun SendDocument(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -129,8 +126,7 @@ fun SendDocument(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -188,10 +184,8 @@ data class SendDocumentData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+6
-12
@@ -35,8 +35,7 @@ fun SendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -60,8 +59,7 @@ fun SendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -91,8 +89,7 @@ fun SendLivePhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -116,8 +113,7 @@ fun SendLivePhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -169,10 +165,8 @@ data class SendLivePhotoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+5
@@ -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 {
|
||||
|
||||
+11
@@ -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 {
|
||||
|
||||
+6
-12
@@ -33,8 +33,7 @@ fun SendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -54,8 +53,7 @@ fun SendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -83,8 +81,7 @@ fun SendPhoto(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -104,8 +101,7 @@ fun SendPhoto(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -155,10 +151,8 @@ data class SendPhotoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+4
-8
@@ -23,8 +23,7 @@ fun SendSticker(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -39,8 +38,7 @@ fun SendSticker(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
emoji = emoji,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
@@ -79,10 +77,8 @@ data class SendStickerByFileId internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(emojiField)
|
||||
val emoji: String? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
|
||||
+6
-12
@@ -43,8 +43,7 @@ fun SendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -75,8 +74,7 @@ fun SendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -112,8 +110,7 @@ fun SendVideo(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -144,8 +141,7 @@ fun SendVideo(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -209,10 +205,8 @@ data class SendVideoData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+4
-8
@@ -25,8 +25,7 @@ fun SendVideoNote(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -47,8 +46,7 @@ fun SendVideoNote(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -94,10 +92,8 @@ data class SendVideoNoteData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
+6
-12
@@ -31,8 +31,7 @@ fun SendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
allowPaidBroadcast: Boolean = false,
|
||||
@@ -53,8 +52,7 @@ fun SendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -81,8 +79,7 @@ fun SendVoice(
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
receiverUserId: UserId? = chatId.receiverUser,
|
||||
callbackQueryId: CallbackQueryId? = null,
|
||||
ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
duration: Long? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -104,8 +101,7 @@ fun SendVoice(
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
receiverUserId = receiverUserId,
|
||||
callbackQueryId = callbackQueryId,
|
||||
ephemeralMessageParameters = ephemeralMessageParameters,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
allowPaidBroadcast = allowPaidBroadcast,
|
||||
@@ -153,10 +149,8 @@ data class SendVoiceData internal constructor(
|
||||
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(receiverUserIdField)
|
||||
override val receiverUserId: UserId? = chatId.receiverUser,
|
||||
@SerialName(callbackQueryIdField)
|
||||
override val callbackQueryId: CallbackQueryId? = null,
|
||||
@SerialName(ephemeralMessageParametersField)
|
||||
override val ephemeralMessageParameters: EphemeralMessageParameters? = chatId.receiverUser ?.let(::EphemeralMessageParameters),
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -6,7 +6,9 @@ import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.directMessageThreadId
|
||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||
import dev.inmo.tgbotapi.utils.messageThreadId
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
@@ -17,11 +19,19 @@ import kotlinx.serialization.json.JsonPrimitive
|
||||
import kotlinx.serialization.json.longOrNull
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
/** Telegram URI-scheme prefix used for links handled by Telegram applications. */
|
||||
const val internalTgAppLinksBeginning = "tg://"
|
||||
|
||||
/** Base URL used for public Telegram links. */
|
||||
const val internalLinkBeginning = "https://t.me"
|
||||
|
||||
/** Telegram URI prefix used to open a user by numeric identifier. */
|
||||
const val internalUserLinkBeginning = "${internalTgAppLinksBeginning}user?id="
|
||||
|
||||
/** Reserved Telegram username used as the base of managed-bot creation links. */
|
||||
const val managedBotNewBotUsername = "newbot"
|
||||
|
||||
/** Identifies a Telegram chat either by numeric [IdChatIdentifier] or by [Username]. */
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@ClassCastsIncluded
|
||||
sealed interface ChatIdentifier
|
||||
@@ -32,35 +42,67 @@ sealed interface ChatIdentifier
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
sealed interface IdChatIdentifier : ChatIdentifier {
|
||||
/** Numeric Telegram chat identifier. */
|
||||
val chatId: RawChatId
|
||||
|
||||
/** Message thread carried as default request context, when available. */
|
||||
val threadId: MessageThreadId?
|
||||
get() = null
|
||||
|
||||
/** Business connection carried as default request context, when available. */
|
||||
val businessConnectionId: BusinessConnectionId?
|
||||
get() = null
|
||||
|
||||
/** Direct-message thread carried as default request context, when available. */
|
||||
val directMessageThreadId: DirectMessageThreadId?
|
||||
get() = null
|
||||
|
||||
/** User receiving an ephemeral message, when available. */
|
||||
val receiverUser: UserId?
|
||||
get() = null
|
||||
|
||||
/** Existing ephemeral message targeted by an operation, when available. */
|
||||
val ephemeralMessageId: EphemeralMessageId?
|
||||
get() = null
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates [ChatIdWithThreadId] when [threadId] is present, [BusinessChatId] when only
|
||||
* [businessConnectionId] is present, or [ChatId] when both optional values are absent.
|
||||
* A non-null [threadId] takes precedence over [businessConnectionId].
|
||||
*/
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
|
||||
ChatIdWithThreadId(chatId, threadId)
|
||||
} ?: businessConnectionId ?.let {
|
||||
BusinessChatId(chatId, businessConnectionId)
|
||||
} ?: ChatId(chatId)
|
||||
|
||||
/** Creates an identifier carrying the supplied [threadId]. */
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId) = ChatIdWithThreadId(chatId, threadId)
|
||||
|
||||
/** Creates an identifier carrying the supplied [businessConnectionId]. */
|
||||
operator fun invoke(chatId: RawChatId, businessConnectionId: BusinessConnectionId) = BusinessChatId(chatId, businessConnectionId)
|
||||
|
||||
/** Creates an identifier carrying ephemeral delivery context for [receiverUser]. */
|
||||
operator fun invoke(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = EphemeralChatId(chatId, receiverUser, ephemeralMessageId)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Numeric Telegram chat identifier without embedded request context.
|
||||
*
|
||||
* @property chatId Raw numeric identifier.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
value class ChatId(override val chatId: RawChatId) : IdChatIdentifier
|
||||
|
||||
/**
|
||||
* Numeric Telegram chat identifier carrying a default message thread.
|
||||
*
|
||||
* @property chatIdWithThreadId Raw chat identifier and message-thread identifier pair.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
@@ -70,9 +112,15 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair<RawChatId, MessageTh
|
||||
override val threadId: MessageThreadId
|
||||
get() = chatIdWithThreadId.second
|
||||
|
||||
/** Creates an identifier from separate [chatId] and [threadId] values. */
|
||||
constructor(chatId: RawChatId, threadId: MessageThreadId): this(chatId to threadId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Numeric Telegram chat identifier carrying a default channel direct-message thread.
|
||||
*
|
||||
* @property chatIdWithThreadId Raw chat identifier and direct-message-thread identifier pair.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
@@ -82,8 +130,15 @@ value class ChatIdWithChannelDirectMessageThreadId(val chatIdWithThreadId: Pair<
|
||||
override val directMessageThreadId: DirectMessageThreadId
|
||||
get() = chatIdWithThreadId.second
|
||||
|
||||
/** Creates an identifier from separate [chatId] and [threadId] values. */
|
||||
constructor(chatId: RawChatId, threadId: DirectMessageThreadId): this(chatId to threadId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Numeric Telegram chat identifier carrying a default business connection.
|
||||
*
|
||||
* @property chatIdWithBusinessConnectionId Raw chat identifier and business-connection identifier pair.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
@@ -93,12 +148,16 @@ value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, B
|
||||
override val businessConnectionId: BusinessConnectionId
|
||||
get() = chatIdWithBusinessConnectionId.second
|
||||
|
||||
/** Creates an identifier from separate [chatId] and [businessConnectionId] values. */
|
||||
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
|
||||
*
|
||||
* @property chatIdWithReceiverUserAndEphemeralMessageId Raw chat identifier, receiver identifier, and optional
|
||||
* ephemeral-message identifier triple.
|
||||
*/
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@@ -113,24 +172,37 @@ value class EphemeralChatId(
|
||||
override val ephemeralMessageId: EphemeralMessageId?
|
||||
get() = chatIdWithReceiverUserAndEphemeralMessageId.third
|
||||
|
||||
/** Creates an identifier from separate chat, receiver, and optional ephemeral-message identifiers. */
|
||||
constructor(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null): this(Triple(chatId, receiverUser, ephemeralMessageId))
|
||||
}
|
||||
|
||||
/** Returns the embedded message thread, or `null` when no message thread is available. */
|
||||
val ChatIdentifier.threadId: MessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.threadId
|
||||
|
||||
/** Returns the embedded channel direct-message thread, or `null` when no direct-message thread is available. */
|
||||
val ChatIdentifier.directMessageThreadId: DirectMessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.directMessageThreadId
|
||||
|
||||
val ChatIdentifier.directMessageThreadIdOrMessageThreadIdAsDirectMessageThreadId: DirectMessageThreadId?
|
||||
get() = directMessageThreadId ?: (threadId ?.directMessageThreadId())
|
||||
|
||||
val ChatIdentifier.threadIdOrDirectMessageThreadIdAsThreadId: MessageThreadId?
|
||||
get() = threadId ?: (directMessageThreadId ?.messageThreadId())
|
||||
|
||||
/** Returns the embedded business connection, or `null` when no business connection is available. */
|
||||
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
|
||||
get() = (this as? IdChatIdentifier) ?.businessConnectionId
|
||||
|
||||
/** Returns the embedded ephemeral-message receiver, or `null` when no receiver is available. */
|
||||
val ChatIdentifier.receiverUser: UserId?
|
||||
get() = (this as? IdChatIdentifier) ?.receiverUser
|
||||
|
||||
/** Returns the embedded ephemeral-message identifier, or `null` when no identifier is available. */
|
||||
val ChatIdentifier.ephemeralMessageId: EphemeralMessageId?
|
||||
get() = (this as? IdChatIdentifier) ?.ephemeralMessageId
|
||||
|
||||
/** Drops all embedded request context and returns a plain [ChatId]. */
|
||||
fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is ChatId -> this
|
||||
is ChatIdWithThreadId -> ChatId(chatId)
|
||||
@@ -139,9 +211,16 @@ fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is EphemeralChatId -> ChatId(chatId)
|
||||
}
|
||||
|
||||
/** Replaces embedded request context with the supplied message [threadId]. */
|
||||
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
|
||||
|
||||
/** Replaces embedded request context with the supplied channel direct-message [threadId]. */
|
||||
fun IdChatIdentifier.toChatIdWithChannelDirectMessageThreadId(threadId: DirectMessageThreadId) = ChatIdWithChannelDirectMessageThreadId(chatId, threadId)
|
||||
|
||||
/** Replaces embedded request context with the supplied [businessConnectionId]. */
|
||||
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
|
||||
|
||||
/** Replaces embedded request context with ephemeral delivery context for [receiverUser]. */
|
||||
fun IdChatIdentifier.toEphemeralChatId(receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = IdChatIdentifier(chatId, receiverUser, ephemeralMessageId)
|
||||
|
||||
/**
|
||||
@@ -156,14 +235,24 @@ val RawChatId.userLink: String
|
||||
@Warning("This API have restrictions in Telegram System")
|
||||
val UserId.userLink: String
|
||||
get() = chatId.userLink
|
||||
|
||||
/** Telegram URI opening the represented [User]. */
|
||||
val User.userLink: String
|
||||
get() = id.toChatId().userLink
|
||||
|
||||
/** Numeric chat identifier used where Telegram expects a user identifier. */
|
||||
typealias UserId = IdChatIdentifier
|
||||
|
||||
/** Wraps a raw numeric identifier as [ChatId]. */
|
||||
fun RawChatId.toChatId(): ChatId = ChatId(this)
|
||||
|
||||
/** Converts a [Long] value to [ChatId]. */
|
||||
fun Long.toChatId(): ChatId = ChatId(RawChatId(this))
|
||||
|
||||
/** Converts an [Int] value to a numeric chat identifier. */
|
||||
fun Int.toChatId(): IdChatIdentifier = RawChatId(toLong()).toChatId()
|
||||
|
||||
/** Converts a [Byte] value to a numeric chat identifier. */
|
||||
fun Byte.toChatId(): IdChatIdentifier = RawChatId(toLong()).toChatId()
|
||||
|
||||
/**
|
||||
@@ -209,6 +298,7 @@ value class Username (
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** Serializes [Username] without the leading `@` and accepts input with or without the prefix. */
|
||||
object WithoutAtSerializer : KSerializer<Username> {
|
||||
override val descriptor: SerialDescriptor = String.serializer().descriptor
|
||||
override fun deserialize(decoder: Decoder): Username = Username.prepare(decoder.decodeString())
|
||||
@@ -229,8 +319,26 @@ value class Username (
|
||||
}
|
||||
}
|
||||
|
||||
/** Converts a string with or without a leading `@` to [Username]. */
|
||||
fun String.toUsername(): Username = Username.prepare(this)
|
||||
|
||||
/**
|
||||
* A custom serializer for the [ChatIdentifier] sealed interface.
|
||||
*
|
||||
* This serializer manages the conversion between the [ChatIdentifier] data structure
|
||||
* and its JSON representation, enabling compatibility with the serialization and deserialization
|
||||
* processes.
|
||||
*
|
||||
* It supports two primary types of [ChatIdentifier]: [IdChatIdentifier] and [Username].
|
||||
* - For [IdChatIdentifier], it serializes to a numeric ID (e.g., `Long`).
|
||||
* - For [Username], it serializes to a string prefixed with "@".
|
||||
*
|
||||
* Deserialization logic determines whether the input is a numeric ID or a string,
|
||||
* and converts it to the corresponding subtype of [ChatIdentifier].
|
||||
*
|
||||
* Marked with the [RiskFeature] annotation, this class may have certain limitations
|
||||
* and specific usage considerations tied to the underlying Telegram system.
|
||||
*/
|
||||
@RiskFeature
|
||||
object ChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
private val internalSerializer = JsonPrimitive.serializer()
|
||||
@@ -253,6 +361,19 @@ object ChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes every [ChatIdentifier] subtype while preserving embedded request context.
|
||||
*
|
||||
* Numeric identifiers use the following JSON representations:
|
||||
* - [ChatId]: a JSON number;
|
||||
* - [ChatIdWithThreadId]: `"<chatId>/<threadId>"`;
|
||||
* - [ChatIdWithChannelDirectMessageThreadId]: `"<chatId>/cdm/<directMessageThreadId>"`;
|
||||
* - [BusinessChatId]: `"<chatId>//<businessConnectionId>"`;
|
||||
* - [EphemeralChatId]: `"<chatId>/eph/<receiverUserId>/<ephemeralMessageId>"`.
|
||||
*
|
||||
* [Username] uses the complete username string. Unlike [ChatIdentifierSerializer], numeric subtype context survives a
|
||||
* serialization round trip.
|
||||
*/
|
||||
@Suppress("unused")
|
||||
@RiskFeature
|
||||
object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
|
||||
@@ -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"
|
||||
@@ -609,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"
|
||||
@@ -626,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"
|
||||
|
||||
@@ -759,6 +766,7 @@ 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"
|
||||
@@ -776,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"
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
/**
|
||||
* A format string sent as the `date_time_format` wire value for a Telegram date-time entity.
|
||||
*
|
||||
* Telegram requires the value to match `r|w?[dD]?[tT]?`; the complete format specification is
|
||||
* available in the [Telegram Bot API documentation](https://core.telegram.org/bots/api#date-time-entity-formatting).
|
||||
* An empty value preserves the entity text as supplied while still allowing clients to expose the
|
||||
* associated date in the user's local format. [LOCAL_CONTROL_KEY] requests a relative-time display
|
||||
* and cannot be combined with another control key. The remaining keys optionally add a localized
|
||||
* weekday, a short or long date, and a short or long time.
|
||||
*
|
||||
* Prefer [local] or [invoke] when constructing a supported value. The public constructor accepts a
|
||||
* custom [string] for forward compatibility, but unsupported combinations can violate Telegram's
|
||||
* strict format and can consequently be rejected or rendered unexpectedly.
|
||||
*
|
||||
* @property string Exact string serialized as `date_time_format`.
|
||||
*/
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class DateTimeEntityFormatting @Warning(
|
||||
"Custom formatting may violate Telegram date-time format restrictions"
|
||||
) constructor(
|
||||
val string: String
|
||||
) {
|
||||
/** Whether [string] contains [LOCAL_CONTROL_KEY], which requests a relative-time display. */
|
||||
val useLocal: Boolean
|
||||
get() = LOCAL_CONTROL_KEY in string
|
||||
|
||||
/** Whether [string] contains [WEEK_CONTROL_KEY], which requests the localized weekday. */
|
||||
val useWeek: Boolean
|
||||
get() = WEEK_CONTROL_KEY in string
|
||||
|
||||
/**
|
||||
* `true` when [string] contains [DATE_LONG_CONTROL_KEY], `false` when [string] contains only
|
||||
* [DATE_SHORT_CONTROL_KEY], or `null` when neither date key is present.
|
||||
*
|
||||
* A custom invalid value containing both date keys reports `true`; the long key has precedence.
|
||||
*/
|
||||
val useDateLong: Boolean?
|
||||
get() = when {
|
||||
DATE_LONG_CONTROL_KEY in string -> true
|
||||
DATE_SHORT_CONTROL_KEY in string -> false
|
||||
else -> null
|
||||
}
|
||||
|
||||
/**
|
||||
* `true` when [string] contains [TIME_LONG_CONTROL_KEY], `false` when [string] contains only
|
||||
* [TIME_SHORT_CONTROL_KEY], or `null` when neither time key is present.
|
||||
*
|
||||
* A custom invalid value containing both time keys reports `true`; the long key has precedence.
|
||||
*/
|
||||
val useTimeLong: Boolean?
|
||||
get() = when {
|
||||
TIME_LONG_CONTROL_KEY in string -> true
|
||||
TIME_SHORT_CONTROL_KEY in string -> false
|
||||
else -> null
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** Control key for relative-time display; a valid format cannot combine the key with another key. */
|
||||
const val LOCAL_CONTROL_KEY: String = "r"
|
||||
|
||||
/** Control key for the day of the week in the user's localized language. */
|
||||
const val WEEK_CONTROL_KEY: String = "w"
|
||||
|
||||
/** Control key for a short date, for example `17.03.22`. */
|
||||
const val DATE_SHORT_CONTROL_KEY: String = "d"
|
||||
|
||||
/** Control key for a long date, for example `March 17, 2022`. */
|
||||
const val DATE_LONG_CONTROL_KEY: String = "D"
|
||||
|
||||
/** Control key for a short time, for example `22:45`. */
|
||||
const val TIME_SHORT_CONTROL_KEY: String = "t"
|
||||
|
||||
/** Control key for a long time, for example `22:45:00`. */
|
||||
const val TIME_LONG_CONTROL_KEY: String = "T"
|
||||
|
||||
/** A valid relative-time format containing only [LOCAL_CONTROL_KEY]. */
|
||||
val local: DateTimeEntityFormatting = DateTimeEntityFormatting(LOCAL_CONTROL_KEY)
|
||||
|
||||
/**
|
||||
* Creates a Telegram-compatible non-relative format in weekday-date-time key order.
|
||||
*
|
||||
* @param useWeek `true` adds [WEEK_CONTROL_KEY]; `false` leaves the weekday unset.
|
||||
* @param useDateLong `true` adds [DATE_LONG_CONTROL_KEY], `false` adds
|
||||
* [DATE_SHORT_CONTROL_KEY], and `null` leaves the date unset.
|
||||
* @param useTimeLong `true` adds [TIME_LONG_CONTROL_KEY], `false` adds
|
||||
* [TIME_SHORT_CONTROL_KEY], and `null` leaves the time unset.
|
||||
* @return A value matching `w?[dD]?[tT]?`; all unset parameters produce an empty format.
|
||||
*/
|
||||
operator fun invoke(
|
||||
useWeek: Boolean = false,
|
||||
useDateLong: Boolean? = null,
|
||||
useTimeLong: Boolean? = null
|
||||
): DateTimeEntityFormatting = DateTimeEntityFormatting(
|
||||
buildString {
|
||||
if (useWeek) {
|
||||
append(WEEK_CONTROL_KEY)
|
||||
}
|
||||
when (useDateLong) {
|
||||
true -> append(DATE_LONG_CONTROL_KEY)
|
||||
false -> append(DATE_SHORT_CONTROL_KEY)
|
||||
null -> Unit
|
||||
}
|
||||
when (useTimeLong) {
|
||||
true -> append(TIME_LONG_CONTROL_KEY)
|
||||
false -> append(TIME_SHORT_CONTROL_KEY)
|
||||
null -> Unit
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun toString(): String = string
|
||||
}
|
||||
+118
-30
@@ -1,113 +1,201 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationException
|
||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
|
||||
/**
|
||||
* Common interface for parts of date time format. Used for [dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource]
|
||||
* Common interface for safe [DateTimeEntityFormatting] parts. Used for
|
||||
* [dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource].
|
||||
*
|
||||
* @see TgDateTimeFormatBuilder
|
||||
* @see buildDateTimeFormat
|
||||
*/
|
||||
@Serializable
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
sealed interface DateTimeFormatPart {
|
||||
/**
|
||||
* Character that represents this part in the format string. Used by [TgDateTimeFormatBuilder.build]
|
||||
* Character that represents the part in [DateTimeEntityFormatting].
|
||||
*/
|
||||
val controlCharacter: String
|
||||
/**
|
||||
* Represents relative time format (e.g. "2 hours ago"). Control character: "r"
|
||||
*/
|
||||
@Serializable
|
||||
data object Relative : DateTimeFormatPart { override val controlCharacter: String get() = "r" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object Relative : DateTimeFormatPart {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.LOCAL_CONTROL_KEY
|
||||
}
|
||||
/**
|
||||
* Represents day of the week format (e.g. "Monday"). Control character: "w"
|
||||
*/
|
||||
@Serializable
|
||||
data object WeekDay : DateTimeFormatPart { override val controlCharacter: String get() = "w" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object WeekDay : DateTimeFormatPart {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.WEEK_CONTROL_KEY
|
||||
}
|
||||
/**
|
||||
* Group for date-related format parts
|
||||
*/
|
||||
@Serializable
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
sealed interface Date : DateTimeFormatPart {
|
||||
/**
|
||||
* Represents short date format (e.g. "01.01.2023"). Control character: "d"
|
||||
*/
|
||||
@Serializable
|
||||
data object Short : Date { override val controlCharacter: String get() = "d" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object Short : Date {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.DATE_SHORT_CONTROL_KEY
|
||||
}
|
||||
/**
|
||||
* Represents long date format (e.g. "January 1, 2023"). Control character: "D"
|
||||
*/
|
||||
@Serializable
|
||||
data object Long : Date { override val controlCharacter: String get() = "D" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object Long : Date {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.DATE_LONG_CONTROL_KEY
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Group for time-related format parts
|
||||
*/
|
||||
@Serializable
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
sealed interface Time : DateTimeFormatPart {
|
||||
/**
|
||||
* Represents short time format (e.g. "12:00"). Control character: "t"
|
||||
*/
|
||||
@Serializable
|
||||
data object Short : Time { override val controlCharacter: String get() = "t" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object Short : Time {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.TIME_SHORT_CONTROL_KEY
|
||||
}
|
||||
/**
|
||||
* Represents long time format (e.g. "12:00:00"). Control character: "T"
|
||||
*/
|
||||
@Serializable
|
||||
data object Long : Time { override val controlCharacter: String get() = "T" }
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(DateTimeFormatPart.Serializer::class)
|
||||
data object Long : Time {
|
||||
override val controlCharacter: String
|
||||
get() = DateTimeEntityFormatting.TIME_LONG_CONTROL_KEY
|
||||
}
|
||||
}
|
||||
|
||||
object Serializer : KSerializer<DateTimeFormatPart> {
|
||||
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor(
|
||||
"DateTimeFormatPart",
|
||||
PrimitiveKind.STRING
|
||||
)
|
||||
|
||||
override fun serialize(encoder: Encoder, value: DateTimeFormatPart) {
|
||||
encoder.encodeString(value.controlCharacter)
|
||||
}
|
||||
|
||||
override fun deserialize(decoder: Decoder): DateTimeFormatPart = when (val controlCharacter = decoder.decodeString()) {
|
||||
DateTimeEntityFormatting.LOCAL_CONTROL_KEY -> Relative
|
||||
DateTimeEntityFormatting.WEEK_CONTROL_KEY -> WeekDay
|
||||
DateTimeEntityFormatting.DATE_SHORT_CONTROL_KEY -> Date.Short
|
||||
DateTimeEntityFormatting.DATE_LONG_CONTROL_KEY -> Date.Long
|
||||
DateTimeEntityFormatting.TIME_SHORT_CONTROL_KEY -> Time.Short
|
||||
DateTimeEntityFormatting.TIME_LONG_CONTROL_KEY -> Time.Long
|
||||
else -> throw SerializationException("Unknown date time format part: $controlCharacter")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for date time format string. Use [buildDateTimeFormat] for convenience
|
||||
* Builder for [DateTimeEntityFormatting]. Use [buildDateTimeFormat] for convenience.
|
||||
* [DateTimeFormatPart.Relative] is mutually exclusive with all component parts. Component output uses Telegram's
|
||||
* required week-date-time order regardless of the order of builder calls.
|
||||
*/
|
||||
class TgDateTimeFormatBuilder {
|
||||
private val parts = mutableSetOf<DateTimeFormatPart>()
|
||||
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.Relative] to the format
|
||||
* Selects [DateTimeFormatPart.Relative] and removes all component parts.
|
||||
*/
|
||||
fun relative() = apply { parts.add(DateTimeFormatPart.Relative) }
|
||||
fun relative() = apply {
|
||||
parts.clear()
|
||||
parts.add(DateTimeFormatPart.Relative)
|
||||
}
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.WeekDay] to the format
|
||||
* Adds [DateTimeFormatPart.WeekDay] and removes [DateTimeFormatPart.Relative].
|
||||
*/
|
||||
fun weekDay() = apply { parts.add(DateTimeFormatPart.WeekDay) }
|
||||
fun weekDay() = apply {
|
||||
parts.remove(DateTimeFormatPart.Relative)
|
||||
parts.add(DateTimeFormatPart.WeekDay)
|
||||
}
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.Date.Short] to the format. Removes any other [DateTimeFormatPart.Date] parts
|
||||
* Adds [DateTimeFormatPart.Date.Short] and removes [DateTimeFormatPart.Relative] plus any other
|
||||
* [DateTimeFormatPart.Date] part.
|
||||
*/
|
||||
fun dateShort() = apply {
|
||||
parts.remove(DateTimeFormatPart.Relative)
|
||||
parts.removeAll { it is DateTimeFormatPart.Date }
|
||||
parts.add(DateTimeFormatPart.Date.Short)
|
||||
}
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.Time.Short] to the format. Removes any other [DateTimeFormatPart.Time] parts
|
||||
* Adds [DateTimeFormatPart.Time.Short] and removes [DateTimeFormatPart.Relative] plus any other
|
||||
* [DateTimeFormatPart.Time] part.
|
||||
*/
|
||||
fun timeShort() = apply {
|
||||
parts.remove(DateTimeFormatPart.Relative)
|
||||
parts.removeAll { it is DateTimeFormatPart.Time }
|
||||
parts.add(DateTimeFormatPart.Time.Short)
|
||||
}
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.Date.Long] to the format. Removes any other [DateTimeFormatPart.Date] parts
|
||||
* Adds [DateTimeFormatPart.Date.Long] and removes [DateTimeFormatPart.Relative] plus any other
|
||||
* [DateTimeFormatPart.Date] part.
|
||||
*/
|
||||
fun dateLong() = apply {
|
||||
parts.remove(DateTimeFormatPart.Relative)
|
||||
parts.removeAll { it is DateTimeFormatPart.Date }
|
||||
parts.add(DateTimeFormatPart.Date.Long)
|
||||
}
|
||||
/**
|
||||
* Adds [DateTimeFormatPart.Time.Long] to the format. Removes any other [DateTimeFormatPart.Time] parts
|
||||
* Adds [DateTimeFormatPart.Time.Long] and removes [DateTimeFormatPart.Relative] plus any other
|
||||
* [DateTimeFormatPart.Time] part.
|
||||
*/
|
||||
fun timeLong() = apply {
|
||||
parts.remove(DateTimeFormatPart.Relative)
|
||||
parts.removeAll { it is DateTimeFormatPart.Time }
|
||||
parts.add(DateTimeFormatPart.Time.Long)
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins all added parts into a single format string
|
||||
* Builds a safe [DateTimeEntityFormatting] value in Telegram's required canonical order.
|
||||
*/
|
||||
fun build() = parts.joinToString("")
|
||||
fun build(): DateTimeEntityFormatting = if (DateTimeFormatPart.Relative in parts) {
|
||||
DateTimeEntityFormatting.local
|
||||
} else {
|
||||
DateTimeEntityFormatting(
|
||||
useWeek = DateTimeFormatPart.WeekDay in parts,
|
||||
useDateLong = when {
|
||||
DateTimeFormatPart.Date.Long in parts -> true
|
||||
DateTimeFormatPart.Date.Short in parts -> false
|
||||
else -> null
|
||||
},
|
||||
useTimeLong = when {
|
||||
DateTimeFormatPart.Time.Long in parts -> true
|
||||
DateTimeFormatPart.Time.Short in parts -> false
|
||||
else -> null
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenient way to build date time format string
|
||||
* Builds [DateTimeEntityFormatting] with the safe [TgDateTimeFormatBuilder] contract.
|
||||
*/
|
||||
fun buildDateTimeFormat(block: TgDateTimeFormatBuilder.() -> Unit): String = TgDateTimeFormatBuilder().apply(block).build()
|
||||
fun buildDateTimeFormat(block: TgDateTimeFormatBuilder.() -> Unit): DateTimeEntityFormatting =
|
||||
TgDateTimeFormatBuilder().apply(block).build()
|
||||
+17
@@ -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
|
||||
)
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.WithPreviewChat
|
||||
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)
|
||||
override val chat: PreviewChat,
|
||||
@SerialName(messageThreadIdField)
|
||||
val messageThreadId: MessageThreadId? = null,
|
||||
@SerialName(draftIdField)
|
||||
val draftId: DraftId
|
||||
) : WithPreviewChat
|
||||
@@ -30,6 +30,8 @@ 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,
|
||||
@@ -69,6 +71,8 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_MANAGED_BOT,
|
||||
|
||||
UPDATE_SUBSCRIPTION,
|
||||
|
||||
UPDATE_STOPPED_MESSAGE_GENERATION,
|
||||
)
|
||||
|
||||
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(
|
||||
|
||||
+28
@@ -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
|
||||
|
||||
+2
@@ -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)
|
||||
|
||||
+13
-4
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
+7
-1
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -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]
|
||||
*/
|
||||
|
||||
+2
@@ -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
|
||||
|
||||
+5
-2
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
+2
@@ -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
|
||||
+2
@@ -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
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package dev.inmo.tgbotapi.types.communities
|
||||
|
||||
import dev.inmo.tgbotapi.types.communityField
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Service message about a chat being joined by a user from a community.
|
||||
*/
|
||||
@Serializable
|
||||
data class CommunityChatJoined(
|
||||
@SerialName(communityField)
|
||||
val community: Community
|
||||
) : CommonEvent
|
||||
+79
-24
@@ -237,7 +237,7 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
* * For all other kinds see [UniqueGift.Common]
|
||||
*/
|
||||
@Serializable(UniqueGift.Companion::class)
|
||||
sealed interface UniqueGift : GiftSentOrReceivedEvent {
|
||||
sealed interface UniqueGift : GiftSentOrReceivedEvent, TextedInput {
|
||||
override val gift: Gift.Unique
|
||||
val origin: String?
|
||||
val originTyped: Origin?
|
||||
@@ -246,6 +246,7 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
val lastResaleCurrency: String?
|
||||
val lastResaleAmount: Long?
|
||||
val transferStarCount: Int?
|
||||
val isPrivate: Boolean
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(Origin.Companion::class)
|
||||
@@ -307,11 +308,21 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
@SerialName(transferStarCountField)
|
||||
override val transferStarCount: Int? = null,
|
||||
@SerialName(nextTransferDateField)
|
||||
override val nextTransferDate: TelegramDate? = null
|
||||
override val nextTransferDate: TelegramDate? = null,
|
||||
@SerialName(textField)
|
||||
override val text: String? = null,
|
||||
@SerialName(entitiesField)
|
||||
private val entities: RawMessageEntities? = null,
|
||||
@SerialName(isPrivateField)
|
||||
override val isPrivate: Boolean = false
|
||||
) : UniqueGift {
|
||||
override val ownedGiftId: GiftId?
|
||||
get() = null
|
||||
|
||||
override val textSources: List<TextSource> by lazy {
|
||||
entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList()
|
||||
}
|
||||
|
||||
@Transient
|
||||
override val origin: String? = originTyped ?.string
|
||||
|
||||
@@ -322,15 +333,21 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
lastResaleCurrency: Currency? = null,
|
||||
lastResaleAmount: Long? = null,
|
||||
transferStarCount: Int? = null,
|
||||
nextTransferDate: TelegramDate? = null
|
||||
nextTransferDate: TelegramDate? = null,
|
||||
text: String? = null,
|
||||
entities: RawMessageEntities? = null,
|
||||
isPrivate: Boolean = false
|
||||
) : this(
|
||||
gift,
|
||||
origin ?.let { Origin.fromString(it) },
|
||||
lastResaleStarCount,
|
||||
lastResaleCurrency,
|
||||
lastResaleAmount,
|
||||
transferStarCount,
|
||||
nextTransferDate
|
||||
gift = gift,
|
||||
originTyped = origin ?.let { Origin.fromString(it) },
|
||||
lastResaleStarCount = lastResaleStarCount,
|
||||
lastResaleCurrency = lastResaleCurrency,
|
||||
lastResaleAmount = lastResaleAmount,
|
||||
transferStarCount = transferStarCount,
|
||||
nextTransferDate = nextTransferDate,
|
||||
text = text,
|
||||
entities = entities,
|
||||
isPrivate = isPrivate
|
||||
)
|
||||
}
|
||||
|
||||
@@ -352,11 +369,21 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
@SerialName(transferStarCountField)
|
||||
override val transferStarCount: Int? = null,
|
||||
@SerialName(nextTransferDateField)
|
||||
override val nextTransferDate: TelegramDate? = null
|
||||
override val nextTransferDate: TelegramDate? = null,
|
||||
@SerialName(textField)
|
||||
override val text: String? = null,
|
||||
@SerialName(entitiesField)
|
||||
private val entities: RawMessageEntities? = null,
|
||||
@SerialName(isPrivateField)
|
||||
override val isPrivate: Boolean = false
|
||||
) : UniqueGift, GiftSentOrReceivedEvent.ReceivedInBusinessAccount {
|
||||
@Transient
|
||||
override val origin: String? = originTyped ?.string
|
||||
|
||||
override val textSources: List<TextSource> by lazy {
|
||||
entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList()
|
||||
}
|
||||
|
||||
constructor(
|
||||
gift: Gift.Unique,
|
||||
ownedGiftId: GiftId,
|
||||
@@ -365,7 +392,10 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
lastResaleCurrency: Currency? = null,
|
||||
lastResaleAmount: Long? = null,
|
||||
transferStarCount: Int? = null,
|
||||
nextTransferDate: TelegramDate? = null
|
||||
nextTransferDate: TelegramDate? = null,
|
||||
text: String? = null,
|
||||
entities: RawMessageEntities? = null,
|
||||
isPrivate: Boolean = false
|
||||
) : this(
|
||||
gift = gift,
|
||||
ownedGiftId = ownedGiftId,
|
||||
@@ -374,7 +404,10 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
lastResaleCurrency = lastResaleCurrency,
|
||||
lastResaleAmount = lastResaleAmount,
|
||||
transferStarCount = transferStarCount,
|
||||
nextTransferDate = nextTransferDate
|
||||
nextTransferDate = nextTransferDate,
|
||||
text = text,
|
||||
entities = entities,
|
||||
isPrivate = isPrivate
|
||||
)
|
||||
}
|
||||
|
||||
@@ -396,7 +429,13 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
@SerialName(transferStarCountField)
|
||||
val transferStarCount: Int? = null,
|
||||
@SerialName(nextTransferDateField)
|
||||
val nextTransferDate: TelegramDate? = null
|
||||
val nextTransferDate: TelegramDate? = null,
|
||||
@SerialName(textField)
|
||||
val text: String? = null,
|
||||
@SerialName(entitiesField)
|
||||
val entities: RawMessageEntities? = null,
|
||||
@SerialName(isPrivateField)
|
||||
val isPrivate: Boolean = false
|
||||
)
|
||||
|
||||
override val descriptor: SerialDescriptor
|
||||
@@ -421,7 +460,10 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
lastResaleCurrency = surrogate.lastResaleCurrency,
|
||||
lastResaleAmount = surrogate.lastResaleAmount,
|
||||
transferStarCount = surrogate.transferStarCount,
|
||||
nextTransferDate = surrogate.nextTransferDate
|
||||
nextTransferDate = surrogate.nextTransferDate,
|
||||
text = surrogate.text,
|
||||
entities = surrogate.entities,
|
||||
isPrivate = surrogate.isPrivate
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
@@ -433,7 +475,10 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
lastResaleCurrency = surrogate.lastResaleCurrency,
|
||||
lastResaleAmount = surrogate.lastResaleAmount,
|
||||
transferStarCount = surrogate.transferStarCount,
|
||||
nextTransferDate = surrogate.nextTransferDate
|
||||
nextTransferDate = surrogate.nextTransferDate,
|
||||
text = surrogate.text,
|
||||
entities = surrogate.entities,
|
||||
isPrivate = surrogate.isPrivate
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -443,18 +488,28 @@ sealed interface GiftSentOrReceivedEvent : CommonEvent {
|
||||
gift: Gift.Unique,
|
||||
origin: String? = null,
|
||||
ownedGiftId: GiftId? = null,
|
||||
transferStarCount: Int? = null
|
||||
transferStarCount: Int? = null,
|
||||
text: String? = null,
|
||||
textSources: TextSourcesList = emptyList(),
|
||||
position: Int = 0,
|
||||
isPrivate: Boolean = false
|
||||
) = ownedGiftId ?.let {
|
||||
ReceivedInBusinessAccount(
|
||||
gift,
|
||||
ownedGiftId,
|
||||
origin,
|
||||
transferStarCount,
|
||||
gift = gift,
|
||||
ownedGiftId = ownedGiftId,
|
||||
origin = origin,
|
||||
transferStarCount = transferStarCount,
|
||||
text = text,
|
||||
entities = textSources.toRawMessageEntities(position),
|
||||
isPrivate = isPrivate
|
||||
)
|
||||
} ?: Common(
|
||||
gift,
|
||||
origin,
|
||||
transferStarCount,
|
||||
gift = gift,
|
||||
origin = origin,
|
||||
transferStarCount = transferStarCount,
|
||||
text = text,
|
||||
entities = textSources.toRawMessageEntities(position),
|
||||
isPrivate = isPrivate
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.media
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
|
||||
sealed interface PhotoedTelegramMedia : TelegramMedia {
|
||||
val photo: InputFile
|
||||
}
|
||||
+1
-1
@@ -57,7 +57,7 @@ data class TelegramMediaDocument internal constructor(
|
||||
override val thumb: InputFile? = null,
|
||||
@SerialName(disableContentTypeDetectionField)
|
||||
val disableContentTypeDetection: Boolean? = null
|
||||
) : TelegramFreeMedia, DocumentMediaGroupMemberTelegramMedia, ThumbedTelegramMedia, InputPollMedia {
|
||||
) : TelegramFreeMedia, DocumentMediaGroupMemberTelegramMedia, RichMessageMemberTelegramMedia, ThumbedTelegramMedia, InputPollMedia {
|
||||
@EncodeDefault
|
||||
override val type: String = TYPE
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
||||
+3
-2
@@ -50,7 +50,7 @@ fun TelegramMediaLivePhoto(
|
||||
data class TelegramMediaLivePhoto internal constructor(
|
||||
override val file: InputFile,
|
||||
@SerialName(photoField)
|
||||
val photo: InputFile,
|
||||
override val photo: InputFile,
|
||||
@SerialName(captionField)
|
||||
override val text: String? = null,
|
||||
@SerialName(parseModeField)
|
||||
@@ -64,7 +64,8 @@ data class TelegramMediaLivePhoto internal constructor(
|
||||
) : TelegramFreeMedia,
|
||||
VisualMediaGroupMemberTelegramMedia,
|
||||
InputPollMedia,
|
||||
InputPollOptionMedia {
|
||||
InputPollOptionMedia,
|
||||
PhotoedTelegramMedia {
|
||||
@EncodeDefault
|
||||
override val type: String = TYPE
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ import kotlinx.serialization.*
|
||||
data class TelegramPaidMediaLivePhoto(
|
||||
override val file: InputFile,
|
||||
@SerialName(photoField)
|
||||
val photo: InputFile,
|
||||
) : VisualTelegramPaidMedia {
|
||||
override val photo: InputFile,
|
||||
) : VisualTelegramPaidMedia, PhotoedTelegramMedia {
|
||||
override val type: String = TYPE
|
||||
|
||||
@SerialName(mediaField)
|
||||
|
||||
@@ -11,6 +11,7 @@ import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
|
||||
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.dice.Dice
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
@@ -210,6 +211,7 @@ internal data class RawMessage(
|
||||
|
||||
// Communities
|
||||
private val community_chat_added: CommunityChatAdded? = null,
|
||||
private val community_chat_joined: CommunityChatJoined? = null,
|
||||
private val community_chat_removed: CommunityChatRemoved? = null,
|
||||
|
||||
// Channel direct messages
|
||||
@@ -378,6 +380,7 @@ internal data class RawMessage(
|
||||
checklist_tasks_done != null -> checklist_tasks_done
|
||||
checklist_tasks_added != null -> checklist_tasks_added
|
||||
community_chat_added != null -> community_chat_added
|
||||
community_chat_joined != null -> community_chat_joined
|
||||
community_chat_removed != null -> community_chat_removed
|
||||
direct_message_price_changed != null -> direct_message_price_changed
|
||||
suggested_post_approved != null -> suggested_post_approved
|
||||
|
||||
+5
-1
@@ -2,11 +2,15 @@ package dev.inmo.tgbotapi.types.message
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||
import dev.inmo.tgbotapi.types.DateTimeEntityFormatting
|
||||
import dev.inmo.tgbotapi.types.UnixTimeStamp
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.message.textsources.*
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* @property date_time_format Optional [DateTimeEntityFormatting] for a `date_time` entity.
|
||||
*/
|
||||
@Serializable
|
||||
@Warning("This thing is subject of changes. Library do not guarantee stability of this class")
|
||||
data class RawMessageEntity(
|
||||
@@ -18,7 +22,7 @@ data class RawMessageEntity(
|
||||
val language: String? = null,
|
||||
val custom_emoji_id: CustomEmojiId? = null,
|
||||
val unix_time: UnixTimeStamp? = null,
|
||||
val date_time_format: String? = null
|
||||
val date_time_format: DateTimeEntityFormatting? = null
|
||||
) {
|
||||
internal val range by lazy {
|
||||
offset until (offset + length)
|
||||
|
||||
+9
-2
@@ -1,26 +1,33 @@
|
||||
package dev.inmo.tgbotapi.types.message.textsources
|
||||
|
||||
import dev.inmo.tgbotapi.types.DateTimeEntityFormatting
|
||||
import dev.inmo.tgbotapi.types.UnixTimeStamp
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.internal.*
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* A text source containing a date-time entity with optional [DateTimeEntityFormatting].
|
||||
*
|
||||
* @property dateTimeFormat Controls the rendered date-time format; `null` leaves the format unset.
|
||||
* @see linkTextSource
|
||||
*/
|
||||
@Serializable
|
||||
data class DateTimeTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor (
|
||||
override val source: String,
|
||||
val unixTimeStamp: UnixTimeStamp,
|
||||
val dateTimeFormat: String?
|
||||
val dateTimeFormat: DateTimeEntityFormatting?
|
||||
) : TextSource {
|
||||
override val markdown: String by lazy { source.dateTimeMarkdown(unixTimeStamp, dateTimeFormat) }
|
||||
override val markdownV2: String by lazy { source.dateTimeMarkdownV2(unixTimeStamp, dateTimeFormat) }
|
||||
override val html: String by lazy { source.dateTimeHTML(unixTimeStamp, dateTimeFormat) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [DateTimeTextSource] with optional [DateTimeEntityFormatting].
|
||||
*/
|
||||
fun dateTimeTextSource(
|
||||
text: String,
|
||||
unixTimeStamp: UnixTimeStamp,
|
||||
dateTimeFormat: String?
|
||||
dateTimeFormat: DateTimeEntityFormatting?
|
||||
) = DateTimeTextSource(text, unixTimeStamp, dateTimeFormat)
|
||||
@@ -54,14 +54,17 @@ object InputRichBlockSerializer : JsonContentPolymorphicSerializer<InputRichBloc
|
||||
InputRichBlockAnchor.TYPE -> InputRichBlockAnchor.serializer()
|
||||
InputRichBlockList.TYPE -> InputRichBlockList.serializer()
|
||||
InputRichBlockBlockQuotation.TYPE -> InputRichBlockBlockQuotation.serializer()
|
||||
InputRichBlockExpandableBlockQuotation.TYPE -> InputRichBlockExpandableBlockQuotation.serializer()
|
||||
InputRichBlockPullQuotation.TYPE -> InputRichBlockPullQuotation.serializer()
|
||||
InputRichBlockCollage.TYPE -> InputRichBlockCollage.serializer()
|
||||
InputRichBlockSlideshow.TYPE -> InputRichBlockSlideshow.serializer()
|
||||
InputRichBlockTable.TYPE -> InputRichBlockTable.serializer()
|
||||
InputRichBlockDetails.TYPE -> InputRichBlockDetails.serializer()
|
||||
InputRichBlockMap.TYPE -> InputRichBlockMap.serializer()
|
||||
InputRichBlockButtons.TYPE -> InputRichBlockButtons.serializer()
|
||||
InputRichBlockAnimation.TYPE -> InputRichBlockAnimation.serializer()
|
||||
InputRichBlockAudio.TYPE -> InputRichBlockAudio.serializer()
|
||||
InputRichBlockDocument.TYPE -> InputRichBlockDocument.serializer()
|
||||
InputRichBlockPhoto.TYPE -> InputRichBlockPhoto.serializer()
|
||||
InputRichBlockVideo.TYPE -> InputRichBlockVideo.serializer()
|
||||
InputRichBlockVoiceNote.TYPE -> InputRichBlockVoiceNote.serializer()
|
||||
|
||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user