1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-08-15 21:56:29 +00:00

Compare commits

...

45 Commits

Author SHA1 Message Date
b913f66b1e fixes 2026-08-15 14:22:35 +06:00
6fbe2e5649 improve replies with ephemeral 2026-08-15 00:15:12 +06:00
8b0e0bf820 fix of Replyparameters calls 2026-08-14 20:16:47 +06:00
4f19cb7626 improvemens? 2026-08-13 17:51:33 +06:00
d48e951232 Require ephemeral receiver/message id and add EphemeralChatId variants
Ephemeral edit/delete/replyToEphemeral requests no longer derive receiverUserId
and ephemeralMessageId from a throwing default: both are plain required
parameters again. Each chatId-taking form instead gained a convenience variant
accepting an EphemeralChatId, which sources both values from the identifier and
delegates to the required-parameter form, so a missing ephemeralMessageId fails
in the thin overload rather than during serialization.

Adds EphemeralChatIdRequestsTest covering the delegation of the core variants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 19:24:56 +06:00
a1d2ebb4dc Add EphemeralChatId and identifier-sourced ephemeral defaults
New EphemeralChatId inheritor of IdChatIdentifier carrying receiverUser and
ephemeralMessageId (mirroring ChatIdWithThreadId), with ChatIdentifier.receiverUser/
ephemeralMessageId extensions like ChatIdentifier.threadId. Every send/reply/edit/
delete method that takes receiverUserId/ephemeralMessageId now defaults them from
the chat identifier, so passing an EphemeralChatId auto-fills them the same way a
ChatIdWithThreadId fills threadId.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 12:05:18 +06:00
bc52be7b40 Document the plan/code/check agent pipeline in HELPERS
Add a rule describing the three-phase subagent pipeline (Plan/Architect ->
Coding -> Check) and the best/high/medium model tiers (Fable/Opus/Sonnet).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 11:23:13 +06:00
a2f670834e Note support of Telegram Bot API 10.2
Bump README supported-version badge to 10.2 and add the Bot API 10.2 support
banner to the 36.0.0 changelog entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 21:08:19 +06:00
3d47034f54 Add Bot API 10.2 subscription updates support
New BotSubscriptionUpdated payload (user, invoicePayload, typed state:
Canceled/Active/Failed/Unknown) in dev.inmo.tgbotapi.types.payments and the
BotSubscriptionUpdatedUpdate for the new subscription update
(UPDATE_SUBSCRIPTION), FlowsUpdatesFilter.botSubscriptionUpdatedUpdatesFlow,
onBotSubscriptionUpdated trigger, waitBotSubscriptionUpdated expectation and
class casts. Notes the Telegram-side Mini App method-origin security hardening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 21:07:42 +06:00
0c329326f7 Add Bot API 10.2 Communities support
New communities domain: Community + CommunityId, CommunityChatAdded and
CommunityChatRemoved service messages (CommonEvent) wired through RawMessage,
ChatFullInfo/ExtendedChat.community (including ExtendedBot), plus
onCommunityChatAdded/onCommunityChatRemoved triggers and wait expectations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 20:47:15 +06:00
838caae7f5 Add Bot API 10.2 Ephemeral Messages support
New ephemeral messaging surface: EphemeralMessageId, Message.receiverUser/
ephemeralMessageId (PossiblyEphemeralMessage on group message impls),
BotCommand.isEphemeral, receiverUserId/callbackQueryId parameters across the 13
covered send methods (core requests, per-type api extensions and the
Sends/Replies/RepliesWithChatsAndMessages aggregators), editEphemeralMessageText/
Media/Caption/ReplyMarkup and deleteEphemeralMessage, plus replyToEphemeral
helpers and smart-branch ephemeral replies.

BREAKING: ReplyParameters.messageId and chatIdentifier are now nullable and the
WithMessageId supertype was dropped so ephemeral_message_id-only replies can be
expressed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 20:25:59 +06:00
16be206b0f Add Bot API 10.2 Rich Messages support
Input-side rich messages: InputRichMessage.blocks/media fields, 21
InputRichBlock* block types + InputRichBlockSerializer, InputRichBlockListItem,
InputRichMessageMedia, TelegramMediaVoiceNote + RichMessageMemberTelegramMedia
marker on Animation/Audio/Photo/Video, DSL builders, and multipart upload for
SendRichMessage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:16:07 +06:00
0b3a5bb0af start 36.0.0 2026-07-18 18:31:03 +06:00
c7761fd294 Merge pull request #1053 from InsanusMokrassar/35.1.0
35.1.0
2026-07-01 18:01:07 +06:00
0e9f9111eb Update dependencies and migrate to Gradle 9 / Dokka v2
Dependency bumps: Kotlin 2.3.20->2.3.21, Coroutines 1.10.2->1.11.0,
Ktor 3.4.2->3.5.1, KSP 2.3.6->2.3.9, MicroUtils 0.29.2->0.30.0,
Dokka 2.0.0->2.2.0, Versions plugin 0.53.0->0.54.0, NMCP 1.4.4->1.6.0.

Gradle wrapper 8.13->9.6.1 with build-script fixes for Gradle 9:
Project.exec() -> providers.exec(), tasks.whenTaskAdded -> tasks.configureEach.

Dokka migrated to the Dokka Gradle Plugin v2. The docs module is now
included as the KDocs aggregator (dokka {} DSL with sourceRoots, new URI,
ProcessIsolation heap for the generator worker), excluded from binary
compatibility validation, and the kdocs workflow runs :docs:dokkaGenerate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:54:13 +06:00
763b07fc3c start 35.1.0 2026-07-01 16:08:25 +06:00
481a3b4ff1 Merge pull request #1052 from InsanusMokrassar/35.0.0
35.0.0
2026-07-01 15:43:02 +06:00
fc764d1f95 add note about support of telegram bot api 10.1 and fix changelogs 2026-07-01 15:42:11 +06:00
68987feabb improve richblocks api and let rich message content to be correctly resendable if there are no any media block inside 2026-07-01 14:25:39 +06:00
5341b2eccf apiDump 2026-07-01 13:27:09 +06:00
7e4efcd645 rewrite RichMessageContent.createResend onto sending of simple rich message 2026-07-01 12:52:55 +06:00
390770ca80 refactor/fixes in rich parts 2026-07-01 12:46:16 +06:00
b054f3d1b5 Revert "Modify markdown function to add newlines"
This reverts commit 3a05a88d4f.
2026-07-01 11:25:43 +06:00
3a05a88d4f Modify markdown function to add newlines 2026-07-01 01:16:36 +06:00
edad79ace8 Add HELPERS rules: work in main worktree, one subagent per subtask
Document two working rules: all work must be done in the normal (main)
worktree rather than a separate `.claude/worktrees` worktree, and a prompt
that lists several subtasks must run each subtask as its own subagent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 22:33:33 +06:00
c3495d8817 Add HELPERS rule preferring members over when-dispatch extensions
Document that a property/method which can live on an interface/class must be
declared there and overridden per implementation, instead of a common
extension that dispatches with a when over every subtype; shared logic goes
into a companion-object function or an internal top-level helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 22:01:20 +06:00
88a54350df Rename RichText source to rawText and move it into members
Replace the RichText.source extension property (a when over every subtype)
with a rawText member declared on RichText and implemented directly by each
inheritor: RichTextPlain.rawText = text, the wrapping entities delegate to
text.rawText, and custom emoji / mathematical expression / anchor fall back
to their own representation. Update the RichBlockPreformatted and media
markdown builders and the formatting tests accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 21:59:18 +06:00
8acd7453a6 Move rich markdown and html bodies into companion objects
For every RichText and RichBlock type the markdown and html rendering now
lives in companion-object functions taking the relevant fields, and the
property overrides are plain value initializers that reuse those functions
(e.g. RichTextEmailAddress.markdown(text, emailAddress)). Class-specific
render helpers (list, table, map, block quotation, details open attribute)
move into the matching companions; helpers shared across several types
(credit cite, media and media container rendering) stay internal top-level
functions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 21:41:32 +06:00
e793eea943 Move RichText/RichBlock markdown and html into members
Add markdown and html as members of the RichText and RichBlock sealed
interfaces and override them in every inheritor (RichTextPlain,
RichTextGroup and all 21 RichBlock subtypes), mirroring the existing
RichTextEntity implementation. The former RichText/RichBlock.markdown
and .html extension properties (which dispatched via a when over each
subtype) are removed; the shared RichBlock render helpers become
internal so the overrides can reuse them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 20:55:46 +06:00
6b4999095e Add rich text / rich block DSL builder
Add a type-safe Kotlin DSL for building rich messages:
* buildRichText { } - RichTextBuilder with plain() plus a function for every
  RichTextEntity (String and nested RichTextBuilder overloads where text-bearing);
* buildRichBlocks { } / buildRichTextInfo { } - RichBlocksBuilder with the
  text-bearing and container blocks (paragraph, heading, list, blockQuotation,
  details, ...), nesting RichText or further blocks per block kind;
* RichBlockListBuilder for list items.

Container blocks expose nested block/text builders; file/cell-heavy blocks (media,
table, collage, slideshow, map) are appended via add() / unary plus. A
@DslMarker (RichTextDsl) keeps the nested scopes from leaking receivers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:29:47 +06:00
23578d25ef Add rich block markdown and html source builders
Add List<RichBlock>.toRichMarkdown() / toRichHtml() (and per-block RichBlock
.markdown / .html plus RichTextInfo.markdown / .html convenience) that render the
Rich Markdown style and Rich HTML style source strings for a whole rich message,
ready to feed into InputRichMessageMarkdown / InputRichMessageHTML.

All 21 block types are covered, including lists (bullet/ordered/task), tables,
block/pull quotations, details, collages, slideshows, maps and media. Media
blocks use the Telegram file_id as the source (documented), since Telegram only
accepts HTTP(S) URLs for rich media and the parsed model carries no public URL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:21:19 +06:00
b5238320a5 Add tests for rich text entity markdown and html
Cover markdown and html output of all 25 RichTextEntity subtypes plus the
recursive RichText.markdown / RichText.html / RichText.source extensions
(nested groups, plain-text escaping, plain-text extraction).

Note: plainHtmlEscapesAngleBrackets asserts the current String.toHtml()
behaviour, which escapes '&' last and therefore over-escapes '<'/'>' (e.g.
"a<b" -> "a&amp;lt;b"). This matches the rest of the library's HTML output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:11:14 +06:00
4cfc054526 Implement markdown and html for RichTextEntity inheritors
Add Rich Markdown style and Rich HTML style serialization for every
RichTextEntity subtype, following the Bot API rich formatting spec
(https://core.telegram.org/bots/api#rich-markdown-style and #rich-html-style).

New RichTextFormatting.kt provides:
* String.escapeRichMarkdown() escaping the rich-markdown special characters;
* RichText.source - plain unformatted text of any RichText;
* RichText.markdown / RichText.html - recursive dispatch over RichTextPlain,
  RichTextGroup and RichTextEntity so inner texts render correctly.

Each of the 25 entity types now overrides markdown and html. Auto-detected
entities (mention, hashtag, cashtag, bank card, bot command) emit their visible
text; the rest wrap inner text in the corresponding markers/tags.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:02:03 +06:00
1091dbdb5e Rename RichMessage -> RichTextInfo
The Telegram type backing rich-formatted message info is RichMessage, but the
class name collided conceptually with the in-progress rich-message builders.
Rename the data class (and its file) to RichTextInfo and update all references
(RawMessage, RichMessageContent, serialization test) plus the API dump.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 16:56:58 +06:00
313fcb3325 fix of sendrichmessagedraft 2026-06-29 23:37:14 +06:00
1c06ec8687 apiDump 2026-06-29 17:04:03 +06:00
9fc80fdd4d Fix RichTextBotCommand SerialName to bot_command
RichTextBotCommand.botCommand reused botCommandField ("command", shared
with BotCommand.command) but Bot API docs require "bot_command". Add
botCommandFullField = "bot_command" and switch RichTextBotCommand to it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 16:17:56 +06:00
df5018ecf5 Make ChatJoinRequestQueryResult inheritors data objects + serializable
- Approve/Decline/Queue are now data object
- each inheritor (and Unknown) annotated with the shared
  ChatJoinRequestQueryResult.Companion serializer
- companion PrimitiveSerialDescriptor serial name is "ChatJoinRequestQueryResult"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 18:49:42 +06:00
0188c65319 Rework ChatJoinRequestQueryResult + EditChatMessageText nullable text
- ChatJoinRequestQueryResult: enum -> sealed interface (Approve/Decline/
  Queue objects + Unknown) with a companion KSerializer using a
  PrimitiveKind.STRING descriptor (encodeString/decodeString), not
  String.serializer()
- EditChatMessageText: text is now nullable per API; add EditChatMessageRichText
  factory for rich edits; widen EditTextChatMessage.text to String?

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 18:42:25 +06:00
c2b1a5d44b Add behaviour-builder coverage for receiving Rich Messages
- onRichMessage trigger (ContentTriggers)
- waitRichMessage / waitRichMessageMessage expectations
- Flow<ContentMessage<*>>.onlyRichMessageContentMessages() util

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:52:10 +06:00
6bdd217530 Add Bot API 10.1 Rich Messages support
Adds the full Rich Messages type system and methods:
- RichText hierarchy: RichTextPlain, RichTextGroup, RichTextEntity and all
  24 RichText* entity types, with a recursive serializer handling plain
  strings, arrays and typed objects
- RichBlock hierarchy: all 21 RichBlock* types plus RichBlockCaption,
  RichBlockTableCell and RichBlockListItem (JsonContentPolymorphic by type)
- RichMessage type and RichMessageContent message content; rich_message
  parsed in RawMessage; RichMessageContentMessage typealias
- InputRichMessage (internal constructor + InputRichMessageHTML /
  InputRichMessageMarkdown factories) and InputRichMessageContent usable as
  InputMessageContent
- SendRichMessage and SendRichMessageDraft requests with API bindings
- richMessage parameter on EditChatMessageText
- Serialization round-trip test for RichMessage/RichText/RichBlock

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:32:56 +06:00
f6d5b3ea71 Add Bot API 10.1 Join Request Queries support
Adds:
- ChatJoinRequestQueryId value class and ChatJoinRequest.queryId field
- ExtendedBot.supportsJoinRequestQueries (User.supports_join_request_queries)
- ExtendedChat.guardBot (ChatFullInfo.guard_bot), parsed for public chats
- AnswerChatJoinRequestQuery request + ChatJoinRequestQueryResult enum
- SendChatJoinRequestWebApp request
- answerChatJoinRequestQuery / sendChatJoinRequestWebApp TelegramBot extensions

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:03:26 +06:00
628e877064 Add Bot API 10.1 Polls support (Link, InputMediaLink)
Adds the Link type implementing PollMedia (the url attached to a poll
option), parses the new `link` field in PollMedia, and adds
TelegramMediaLink (InputMediaLink) usable as InputPollOptionMedia.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 16:53:59 +06:00
8ba13ea5fc start 35.0.0 2026-06-19 16:27:54 +06:00
b8e995f36d Merge pull request #1047 from InsanusMokrassar/34.0.0
34.0.0
2026-06-13 14:34:21 +06:00
148 changed files with 20201 additions and 3825 deletions

View File

@@ -12,10 +12,10 @@ jobs:
with:
java-version: 17
- name: Build
run: ./gradlew dokkaHtmlMultiModule
run: ./gradlew :docs:dokkaGenerate
- name: Publish KDocs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/dokka/htmlMultiModule
publish_dir: ./docs/build/dokka/html
publish_branch: kdocs

View File

@@ -1,5 +1,107 @@
# TelegramBotAPI changelog
## 36.0.0
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.2](https://core.telegram.org/bots/api-changelog#july-14-2026)**
**Breaking changes**:
* `ReplyParameters` is now a sealed interface with nested `ReplyParameters.Chat` and `ReplyParameters.Ephemeral` implementations; overloaded `ReplyParameters(...)` companion factories construct both regular-message and ephemeral-message variants
* The 4 group-family message implementations (`CommonGroupContentMessageImpl`, `CommonForumContentMessageImpl`, `CommonChannelDirectMessagesContentMessageImpl`, `CommonSuggestedChannelDirectMessagesContentMessageImpl`) gained trailing `receiverUser`/`ephemeralMessageId` primary-constructor parameters (defaulted to `null`) — positional construction of these classes must be updated
* `reply(to = ...)` overloads for the 13 ephemeral-capable senders (see below) now detect an ephemeral `to` target (`to is PossiblyEphemeralMessage && to.ephemeralMessageId != null`) and automatically address the reply through `ephemeral_message_id`, sending the outgoing message itself as ephemeral to the same receiver — this is a behavior change for any existing code that replies to a message carrying a non-null `ephemeralMessageId`
**Migration advice**: Keep `ReplyParameters(...)` for both chat-message and ephemeral-message targets; explicit `ReplyParameters.Ephemeral(...)` subtype construction also remains available; pass `receiverUser`/`ephemeralMessageId` explicitly (or rely on their `null` default) when constructing the 4 group-family message implementations positionally
* `Core`:
* (`Rich Messages`) Added `InputRichBlock` hierarchy with all 21 `InputRichBlock*` types (mirroring the received `RichBlock*` hierarchy and reusing `RichText`/`RichBlockCaption`/`RichBlockTableCell`), the label-less `InputRichBlockListItem` and the `InputRichBlockSerializer`; every `InputRichBlock` exposes `subBlocks` navigation
* (`Rich Messages`) Added `TelegramMediaVoiceNote` (`InputMediaVoiceNote`) and the `RichMessageMemberTelegramMedia` marker interface implemented by it, `TelegramMediaAnimation`, `TelegramMediaAudio`, `TelegramMediaPhoto` and `TelegramMediaVideo`; added `VoiceFile.toTelegramMediaVoiceNote` converters
* (`Rich Messages`) Added `InputRichMessageMedia` type (media referenced from `InputRichMessage.html`/`.markdown` via `tg://photo?id=`, `tg://video?id=` and `tg://audio?id=` links)
* (`Rich Messages`) `InputRichMessage` gained `blocks` and `media` fields ("exactly one of `html`, `markdown` or `blocks` must be used") and the `InputRichMessageBlocks` factory; `InputRichMessageHTML`/`InputRichMessageMarkdown` gained a trailing `media` parameter
* (`Rich Messages`) Added Rich Messages input DSL builders `buildInputRichBlocks`/`InputRichBlocksBuilder`, `InputRichBlockListBuilder` and the `InputRichMessageBlocks { }` builder overload (marked with the `@RichTextDsl` DSL marker)
* (`Rich Messages`) `SendRichMessage` now supports `attach://` upload of new files referenced from `InputRichMessage.blocks`/`.media`; `SendRichMessageDraft` now rejects rich messages that require direct file upload (unsupported by the method)
* (`Ephemeral Messages`) Added `EphemeralMessageId` value class, `PossiblyEphemeralMessage` (`receiverUser`/`ephemeralMessageId`) and `EphemeralMessageAction` (`receiverUserId`/`ephemeralMessageId`) abstractions
* (`Ephemeral Messages`) `RawMessage` parses `receiver_user`/`ephemeral_message_id`; the 4 group-family `Common*ContentMessage` types (`CommonGroupContentMessage`, `CommonForumContentMessage`, `CommonChannelDirectMessagesContentMessage`, `CommonSuggestedChannelDirectMessagesContentMessage`, via the shared `PotentiallyFromUserGroupContentMessage`) now also implement `PossiblyEphemeralMessage`
* (`Ephemeral Messages`) `BotCommand` gained the `isEphemeral` field
* (`Ephemeral Messages`) `ReplyParameters` became a sealed interface with nested `Chat` and `Ephemeral` implementations and a shared surrogate-backed serializer preserving the flat Bot API JSON shape; added the `Message.ephemeralReplyParametersOrNull()`/`Message.ephemeralReplyReceiverUserIdOrNull` helpers used by the `reply(to = ...)` smart-branch
* (`Ephemeral Messages`) `ReplyParameters.Ephemeral` and `Message.ephemeralReplyParametersOrNull()` support and forward `allowSendingWithoutReply`, `checklistTaskId`, and `pollOptionId` together with `ephemeralMessageId`
* (`Ephemeral Messages`) Added `receiverUserId`/`callbackQueryId` params (via the new `OptionallyEphemeralSendRequest`) to the 13 ephemeral-capable send requests: `SendTextMessage`, `SendContact`, `SendLocation` (`Static`/`Live`), `SendVenue`, `SendPhotoData`, `SendLivePhotoData`, `SendAudioData`, `SendDocumentData`, `SendVideoData`, `SendAnimationData`, `SendVoiceData`, `SendVideoNoteData`, `SendStickerByFileId`
* (`Ephemeral Messages`) Added `EditEphemeralMessageText`/`EditEphemeralMessageMedia`/`EditEphemeralMessageCaption`/`EditEphemeralMessageReplyMarkup` and `DeleteEphemeralMessage` requests (all return `Unit`, mirroring the inline-message edit family); `EditEphemeralMessageMedia` rejects `MultipartFile` media (new file upload is not supported for ephemeral edits)
* (`Ephemeral Messages`) Added `EphemeralChatId` (`IdChatIdentifier`, carrying `chatId`/`receiverUser`/`ephemeralMessageId`) and the `ChatIdentifier.receiverUser`/`ChatIdentifier.ephemeralMessageId` extensions (mirroring `ChatIdentifier.threadId`); `FullChatIdentifierSerializer` gained the `chatId/eph/receiverUserChatId/ephemeralMessageId` string format. The nullable `receiverUserId` param of the 13 ephemeral-capable send requests still defaults from the passed `chatId` when it is an `EphemeralChatId`; `DeleteEphemeralMessage` and `EditEphemeralMessageText`/`EditEphemeralMessageCaption`/`EditEphemeralMessageMedia`/`EditEphemeralMessageReplyMarkup` instead keep `receiverUserId`/`ephemeralMessageId` REQUIRED on their primary constructor/factory form, gaining `EphemeralChatId`-taking secondary constructors/factory overloads that source both params from the identifier (throwing `IllegalArgumentException` if it carries no `ephemeralMessageId`)
* (`Communities`) Added `CommunityId` value class and `Community` type (`id`/`name`)
* (`Communities`) Added `CommunityChatAdded` (`community`) and `CommunityChatRemoved` (fieldless) chat events (`CommonEvent`); `RawMessage` parses `community_chat_added`/`community_chat_removed`
* (`Communities`) Added `community` field to `ExtendedChat` (`ChatFullInfo.community`), parsed for `ExtendedChannelChatImpl`, `ExtendedGroupChatImpl`, `ExtendedSupergroupChatImpl`, `ExtendedForumChatImpl`, `ExtendedChannelDirectMessagesChatImpl` and `ExtendedBot`
* (`Bot Subscriptions`) Added `BotSubscriptionUpdated` (`user`, `invoicePayload`, `state`) and `BotSubscriptionUpdatedUpdate`; `state` is modeled as the typed sealed `BotSubscriptionUpdated.State` (`Canceled`/`Active`/`Failed`, with an `Unknown` fallback), mirroring `TransactionType`
* (`Bot Subscriptions`) `RawUpdate` parses the new `subscription` field; added `UPDATE_SUBSCRIPTION` to `ALL_UPDATES_LIST_WITHOUT_REACTIONS`; `FlowsUpdatesFilter` gained `botSubscriptionUpdatedUpdatesFlow`
* `API`:
* (`Ephemeral Messages`) Threaded `receiverUserId`/`callbackQueryId` through the `sendXxx`/`send`/`reply`/`replyWithXxx` extensions for the 13 ephemeral-capable senders (`send/Sends.kt`, `send/Replies.kt`, `send/RepliesWithChatsAndMessages.kt` and their per-type extension files); `reply(to = ...)` now automatically sends an ephemeral reply when `to` is itself ephemeral (see Breaking changes)
* (`Ephemeral Messages`) Ephemeral-capable `reply(to = ...)` overloads gained `replyToEphemeralMessageId`, defaulting from `PossiblyEphemeralMessage.ephemeralMessageId`; direct and dispatcher overloads forward the explicit target into `ephemeralReplyParametersOrNull`
* (`Ephemeral Messages`) Added 48 ephemeral-only `reply`/`replyWithXxx` overloads in `RepliesWithEphemeral.kt` without a `ChatMessage`; each overload requires `replyInChatId`, `receiverUserId`, and `replyToEphemeralMessageId`, with complete content-form and dispatcher parity across the 13 ephemeral-capable senders
* (`Ephemeral Messages`) Added `editEphemeralMessageText`/`editEphemeralMessageMedia`/`editEphemeralMessageCaption`/`editEphemeralMessageReplyMarkup` and `deleteEphemeralMessage` `TelegramBot` extensions (the latter also accepts a `PossiblyEphemeralMessage` directly)
* (`Ephemeral Messages`) Added explicit `replyToEphemeral`/`replyToEphemeralWithXxx` `TelegramBot` extensions for the 13 ephemeral-capable senders, replying to an ephemeral message by `chatId`/`ephemeralMessageId` without requiring the original `Message` object
* (`Ephemeral Messages`) `receiverUserId`/`ephemeralMessageId` params of the edit/delete/`replyToEphemeral*` extensions remain REQUIRED on the `chatId: ChatIdentifier`/`chat: Chat` forms; each `chatId: ChatIdentifier` form additionally gained a convenience overload taking `chatId: EphemeralChatId` (dropping `receiverUserId`/`ephemeralMessageId`) that sources both from the identifier, throwing `IllegalArgumentException` if it carries no `ephemeralMessageId` (the `chat: Chat` forms got no such overload, since `Chat.id` is statically only an `IdChatIdentifier`); `Replies.kt`'s `receiverUserId` default now also checks `replyInChatId.receiverUser` before falling back to `to.ephemeralReplyReceiverUserIdOrNull`
* (`Ephemeral Messages`) Not covered by this iteration (follow-up): `createResend`/`ResendMessage` do not carry ephemeral fields (a resend is always a regular message); `handleLiveLocation` and the generic `reply(mediaFile = ...)`/`reply(content = ...)` dispatchers in `RepliesWithChatsAndMessages.kt`'s `copyMessage`/live-location branches are unaffected; `behaviour_builder` triggers/waiters gained no ephemeral-specific helpers
* `BehaviourBuilder`:
* (`Communities`) Added `onCommunityChatAdded`/`onCommunityChatRemoved` triggers
* (`Communities`) Added `waitCommunityChatAdded`/`waitCommunityChatRemoved` and `waitCommunityChatAddedEventsMessages`/`waitCommunityChatRemovedEventsMessages` expectations
* (`Bot Subscriptions`) Added `onBotSubscriptionUpdated` trigger, `waitBotSubscriptionUpdated` expectation and `ByUserBotSubscriptionUpdatedMarkerFactory`
* `Utils`:
* (`Bot Subscriptions`) Added class casts for `BotSubscriptionUpdatedUpdate` (`whenBotSubscriptionUpdatedUpdate`/`asBotSubscriptionUpdatedUpdate`/`requireBotSubscriptionUpdatedUpdate`); regenerated class casts extensions (`botSubscriptionUpdatedUpdateOrNull`/`OrThrow`, `botSubscriptionUpdatedOrNull`/`OrThrow`)
* `WebApps`:
* Telegram hardened Mini App method-origin security, auto-enabling for all Mini Apps on July 20, 2026; no library change required
## 35.1.0
* `Dependencies`:
* `Kotlin`: `2.3.20` -> `2.3.21`
* `Coroutines`: `1.10.2` -> `1.11.0`
* `Ktor`: `3.4.2` -> `3.5.1`
* `KSP`: `2.3.6` -> `2.3.9`
* `MicroUtils`: `0.29.2` -> `0.30.0`
* `Dokka`: `2.0.0` -> `2.2.0`
* `Versions`: `0.53.0` -> `0.54.0`
* `NMCP`: `1.4.4` -> `1.6.0`
* `Build`:
* Updated Gradle wrapper `8.13` -> `9.6.1` and migrated build scripts to be Gradle 9 compatible (`Project.exec` -> `providers.exec`, `tasks.whenTaskAdded` -> `tasks.configureEach`)
* Migrated Dokka documentation to the Dokka Gradle Plugin v2: the `docs` module is now included in the build as the KDocs aggregator (`./gradlew :docs:dokkaGenerate`) and the `Publish KDocs` workflow was updated accordingly
## 35.0.0
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026)**
**Breaking changes**:
* `EditTextChatMessage.text` changed from `String` to `String?` (rich edits carry no text) — implementations overriding it must widen the type and readers must handle `null`
* `EditChatMessageText.text` changed from `String` to `String?`; its `textSources` is now `null` when there is no text — code reading `text` as non-null must handle `null`
* `ExtendedBot` gained the `supportsJoinRequestQueries` field inserted between `supportsGuestQueries` and `canConnectToBusiness` — positional constructor calls and `componentN` destructuring shift and must be updated
**Migration advice**: Handle nullable `text` on `EditTextChatMessage`/`EditChatMessageText`; construct `ExtendedBot` with named arguments
* `Core`:
* (`Rich Messages`) Added `RichText` (`RichTextPlain`, `RichTextGroup`, `RichTextEntity`) hierarchy with all 25 `RichText*` entity types and a recursive serializer supporting plain strings, arrays and typed objects; every `RichText` exposes `rawText`, `markdown` and `html` renderings
* (`Rich Messages`) Added `RichBlock` hierarchy with all 21 `RichBlock*` types plus `RichBlockCaption`, `RichBlockTableCell` and `RichBlockListItem`; every `RichBlock` exposes `markdown`/`html` source, the `RichBlockMedia` marker interface and `subBlocks`/`search` navigation helpers
* (`Rich Messages`) Added `RichTextInfo` type (with `markdown`/`html` source built from its blocks) and `RichMessageContent` message content; `RichMessageContent.createResend` re-sends the content (forwarded when it contains media blocks, otherwise re-built through `SendRichMessage`); parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias
* (`Rich Messages`) Added `InputRichMessage` (internal constructor with `InputRichMessageHTML`/`InputRichMessageMarkdown` factories) and `InputRichMessageContent` usable as `InputMessageContent`
* (`Rich Messages`) Added Rich Messages DSL builders `buildRichText`/`RichTextBuilder`, `buildRichBlocks`/`RichBlocksBuilder`, `buildRichTextInfo` and `RichBlockListBuilder` (marked with the `@RichTextDsl` DSL marker)
* (`Rich Messages`) Added Rich Markdown/HTML source helpers `String.escapeRichMarkdown()` and `List<RichBlock>.toRichMarkdown()`/`toRichHtml()`
* (`Rich Messages`) Added `SendRichMessage` and `SendRichMessageDraft` requests
* (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText`; its `text` is now nullable (per API) and the `EditChatMessageRichText` factory builds a rich edit; widened `EditTextChatMessage.text` to nullable
* (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option
* (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization
* (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media
* (`Join Request Queries`) Added `ChatJoinRequestQueryId` value class and `queryId` field to `ChatJoinRequest`
* (`Join Request Queries`) Added `supportsJoinRequestQueries` flag to `ExtendedBot` (`User.supports_join_request_queries`)
* (`Join Request Queries`) Added `guardBot` field to `ExtendedChat` (`ChatFullInfo.guard_bot`), parsed for public chats
* (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` sealed interface (`Approve`/`Decline`/`Queue`/`Unknown`) serialized as a plain string
* (`Join Request Queries`) Added `SendChatJoinRequestWebApp` request
* `API`:
* (`Rich Messages`) Added `sendRichMessage` and `sendRichMessageDraft` `TelegramBot` extensions
* (`Join Request Queries`) Added `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp` `TelegramBot` extensions
* `BehaviourBuilder`:
* (`Rich Messages`) Added `onRichMessage` trigger and `waitRichMessage`/`waitRichMessageMessage` expectations
* `Utils`:
* (`Rich Messages`) Added `Flow<ContentMessage<*>>.onlyRichMessageContentMessages()`
* (`Join Request Queries`) Added `ChatJoinRequest.query_id` raw accessor
## 34.0.0
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.0](https://core.telegram.org/bots/api-changelog#may-8-2026)**

View File

@@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-10.0-blue)](https://core.telegram.org/bots/api-changelog#may-8-2026)
# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-10.2-blue)](https://core.telegram.org/bots/api-changelog#july-14-2026)
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@@ -48,3 +48,25 @@ Each section can be ommited if there are no any changes in the section. In case
* `Core`:
* (`Guest mode`) // change data
```
---
When a property (or method) can be declared on an interface/class and implemented by each inheritor - it MUST be declared there and overridden per implementation. DO NOT implement such behaviour as a common extension property/function that dispatches with a `when (this)` over every subtype: those branches silently drift out of sync when new subtypes are added and are not part of the type contract. If a part of the implementation is reused across several inheritors, keep that part in a shared helper (a companion-object function of the owner, or an `internal` top-level function for logic shared between different types) and let the overrides reuse it.
---
All work MUST be performed in the normal (main) working worktree of the repository. DO NOT create or do the work inside a separate worktree (for example `.claude/worktrees/...`): commits made there leave the main checkout behind and force an extra fast-forward/pull to land the changes. If some environment forces an isolated worktree, fast-forward the main branch onto those commits and continue in the main worktree.
---
When a prompt contains a list of several subtasks, run each subtask as its own subagent (one subagent per subtask) instead of doing all of them inline in the main thread.
---
For any substantial change, drive it through a three-phase agent pipeline, each phase run as its own subagent(s), and each section/subtask committed separately:
1. **Plan / Architect** the changes — model range best → medium, best is the most suitable.
2. **Coding / implementation** — model range medium → high, medium is the most suitable.
3. **Check / validation** — model range high → best, high is the most suitable.
Model tiers: **best = Fable**, **high = Opus**, **medium = Sonnet**. (Tier names, not the concrete models, are the contract — remap the models if the roster changes.)

View File

@@ -21,6 +21,11 @@ plugins {
alias(libs.plugins.nmcp.aggregation)
}
// docs is a dokka-only aggregator module, exclude it from binary compatibility validation
apiValidation {
ignoredProjects += ["docs"]
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
nmcpAggregation {
@@ -44,7 +49,7 @@ allprojects {
mavenLocal()
}
if (it != rootProject.findProject("docs")) {
tasks.whenTaskAdded { task ->
tasks.configureEach { task ->
if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") {
task.enabled = false
}
@@ -54,13 +59,9 @@ allprojects {
apply from: "./extensions.gradle"
private String getCurrentVersionChangelog() {
OutputStream changelogDataOS = new ByteArrayOutputStream()
exec {
standardOutput = changelogDataOS
return providers.exec {
commandLine './changelog_info_retriever', "$library_version", 'CHANGELOG.md'
}
return changelogDataOS.toString().trim()
}.standardOutput.asText.get().trim()
}

View File

@@ -39,14 +39,10 @@ private List<SourceDirectorySet> findSourcesWithName(String... approximateNames)
}.collect { it.kotlin }
}
Object callback = {
switch (true) {
case project.hasProperty("DOKKA_PATH"):
outputDirectory = project.property("DOKKA_PATH").toString()
break
case System.getenv("DOKKA_PATH") != null:
outputDirectory = System.getenv("DOKKA_PATH")
break
dokka {
// aggregating every module's sources into one publication needs more heap than the worker default
dokkaGeneratorIsolation = ProcessIsolation {
it.maxHeapSize.set("4g")
}
dokkaSourceSets {
@@ -55,7 +51,7 @@ Object callback = {
sourceLink {
localDirectory.set(file("../"))
remoteUrl.set(new URL("https://github.com/InsanusMokrassar/ktgbotapi"))
remoteUrl.set(new URI("https://github.com/InsanusMokrassar/ktgbotapi"))
remoteLineSuffix.set("#L")
}
}
@@ -73,6 +69,3 @@ Object callback = {
}
}
}
tasks.dokkaGfm(callback)
tasks.dokkaHtml(callback)

View File

@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true
library_group=dev.inmo
library_version=34.0.0
library_version=36.0.0

View File

@@ -1,28 +1,28 @@
[versions]
kotlin = "2.3.20"
kotlin = "2.3.21"
kotlin-serialization = "1.11.0"
kotlin-coroutines = "1.10.2"
kotlin-coroutines = "1.11.0"
javax-activation = "1.1.1"
korlibs = "5.4.0"
uuid = "0.8.4"
ktor = "3.4.2"
ktor = "3.5.1"
ksp = "2.3.6"
ksp = "2.3.9"
kotlin-poet = "2.3.0"
microutils = "0.29.2"
microutils = "0.30.0"
kslog = "1.6.1"
versions = "0.53.0"
versions = "0.54.0"
github-release-plugin = "2.5.2"
dokka = "2.0.0"
dokka = "2.2.0"
validator = "0.18.1"
nmcp = "1.4.4"
nmcp = "1.6.0"
[libraries]

Binary file not shown.

View File

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip

315
gradlew vendored
View File

@@ -1,78 +1,129 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn ( ) {
warn () {
echo "$*"
}
} >&2
die ( ) {
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -81,92 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

78
gradlew.bat vendored
View File

@@ -1,4 +1,22 @@
@if "%DEBUG%" == "" @echo off
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -9,25 +27,29 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -35,48 +57,36 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View File

@@ -1,11 +1,4 @@
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.jetbrains.dokka") {
useModule("org.jetbrains.dokka:dokka-gradle-plugin:${requested.version}")
}
}
}
repositories {
gradlePluginPortal()
}
@@ -19,3 +12,4 @@ include ":tgbotapi.behaviour_builder"
include ":tgbotapi.behaviour_builder.fsm"
include ":tgbotapi"
include ":tgbotapi.webapps"
include ":docs"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.DeleteEphemeralMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.EphemeralChatId
import dev.inmo.tgbotapi.types.EphemeralMessageId
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEphemeralMessage
public suspend fun TelegramBot.deleteEphemeralMessage(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId
): Unit = execute(
DeleteEphemeralMessage(chatId, receiverUserId, ephemeralMessageId)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.deleteEphemeralMessage(
chatId: EphemeralChatId
): Unit = execute(
DeleteEphemeralMessage(chatId)
)
public suspend fun TelegramBot.deleteEphemeralMessage(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId
): Unit = deleteEphemeralMessage(chat.id, receiverUserId, ephemeralMessageId)
/**
* Convenience overload requiring [message] to carry non-null [PossiblyEphemeralMessage.receiverUser] and
* [PossiblyEphemeralMessage.ephemeralMessageId] (as returned by any of the ephemeral send requests)
*/
public suspend fun TelegramBot.deleteEphemeralMessage(
message: PossiblyEphemeralMessage
): Unit = deleteEphemeralMessage(
message.chat.id,
message.receiverUser ?.id ?: error("Message ${message.messageId} in chat ${message.chat.id} is not ephemeral: receiverUser is null"),
message.ephemeralMessageId ?: error("Message ${message.messageId} in chat ${message.chat.id} is not ephemeral: ephemeralMessageId is null")
)

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.AnswerChatJoinRequestQuery
import dev.inmo.tgbotapi.requests.chat.invite_links.ChatJoinRequestQueryResult
import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
public suspend fun TelegramBot.answerChatJoinRequestQuery(
chatJoinRequestQueryId: ChatJoinRequestQueryId,
result: ChatJoinRequestQueryResult
): Unit = execute(AnswerChatJoinRequestQuery(chatJoinRequestQueryId, result))
public suspend fun TelegramBot.answerChatJoinRequestQuery(
chatJoinRequest: ChatJoinRequest,
result: ChatJoinRequestQueryResult
): Unit = answerChatJoinRequestQuery(
requireNotNull(chatJoinRequest.queryId) {
"ChatJoinRequest.queryId is null, this request can't be answered with answerChatJoinRequestQuery"
},
result
)
public suspend fun TelegramBot.answerChatJoinRequestQuery(
chatJoinRequestUpdate: ChatJoinRequestUpdate,
result: ChatJoinRequestQueryResult
): Unit = answerChatJoinRequestQuery(chatJoinRequestUpdate.data, result)

View File

@@ -0,0 +1,27 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.SendChatJoinRequestWebApp
import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
public suspend fun TelegramBot.sendChatJoinRequestWebApp(
chatJoinRequestQueryId: ChatJoinRequestQueryId,
webAppUrl: String
): Unit = execute(SendChatJoinRequestWebApp(chatJoinRequestQueryId, webAppUrl))
public suspend fun TelegramBot.sendChatJoinRequestWebApp(
chatJoinRequest: ChatJoinRequest,
webAppUrl: String
): Unit = sendChatJoinRequestWebApp(
requireNotNull(chatJoinRequest.queryId) {
"ChatJoinRequest.queryId is null, this request can't be processed with sendChatJoinRequestWebApp"
},
webAppUrl
)
public suspend fun TelegramBot.sendChatJoinRequestWebApp(
chatJoinRequestUpdate: ChatJoinRequestUpdate,
webAppUrl: String
): Unit = sendChatJoinRequestWebApp(chatJoinRequestUpdate.data, webAppUrl)

View File

@@ -0,0 +1,103 @@
package dev.inmo.tgbotapi.extensions.api.edit.caption
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.caption.EditEphemeralMessageCaption
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
caption: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageCaption(chatId, receiverUserId, ephemeralMessageId, caption, parseMode, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chatId: EphemeralChatId,
caption: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageCaption(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
caption,
parseMode,
replyMarkup
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
caption: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageCaption(chat.id, receiverUserId, ephemeralMessageId, caption, parseMode, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageCaption(chatId, receiverUserId, ephemeralMessageId, entities, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chatId: EphemeralChatId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageCaption(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
entities,
replyMarkup
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageCaption(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageCaption(chat.id, receiverUserId, ephemeralMessageId, entities, replyMarkup)

View File

@@ -0,0 +1,49 @@
package dev.inmo.tgbotapi.extensions.api.edit.media
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.media.EditEphemeralMessageMedia
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageMedia(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
media: TelegramFreeMedia,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageMedia(chatId, receiverUserId, ephemeralMessageId, media, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageMedia(
chatId: EphemeralChatId,
media: TelegramFreeMedia,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageMedia(chatId, media, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageMedia(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
media: TelegramFreeMedia,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageMedia(chat.id, receiverUserId, ephemeralMessageId, media, replyMarkup)

View File

@@ -0,0 +1,45 @@
package dev.inmo.tgbotapi.extensions.api.edit.reply_markup
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.reply_markup.EditEphemeralMessageReplyMarkup
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageReplyMarkup(chatId, receiverUserId, ephemeralMessageId, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
chatId: EphemeralChatId,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageReplyMarkup(chatId, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageReplyMarkup(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageReplyMarkup(chat.id, receiverUserId, ephemeralMessageId, replyMarkup)

View File

@@ -0,0 +1,200 @@
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.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.utils.EntitiesBuilderBody
import dev.inmo.tgbotapi.utils.buildEntities
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
text: String,
parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, text, parseMode, linkPreviewOptions, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: EphemeralChatId,
text: String,
parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageText(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
text,
parseMode,
linkPreviewOptions,
replyMarkup
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
text: String,
parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, text, parseMode, linkPreviewOptions, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = execute(
EditEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, entities, linkPreviewOptions, replyMarkup)
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: EphemeralChatId,
entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageText(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
entities,
linkPreviewOptions,
replyMarkup
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, entities, linkPreviewOptions, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: EphemeralChatId,
separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chatId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
separator: String,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chatId, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chatId: EphemeralChatId,
separator: String,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chatId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
separator: TextSource? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
public suspend fun TelegramBot.editEphemeralMessageText(
chat: Chat,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
separator: String,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
): Unit = editEphemeralMessageText(chat.id, receiverUserId, ephemeralMessageId, buildEntities(separator, builderBody), linkPreviewOptions, replyMarkup)

View File

@@ -58,6 +58,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -75,6 +77,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -96,6 +100,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -111,6 +117,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -274,6 +282,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -290,6 +300,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -311,6 +323,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -326,6 +340,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -352,6 +368,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -369,6 +387,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -391,6 +411,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -407,6 +429,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -429,6 +453,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -472,6 +498,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -524,6 +552,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -546,6 +576,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -569,6 +601,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -591,6 +625,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -608,6 +644,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -623,6 +661,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -754,6 +794,8 @@ public suspend inline fun TelegramBot.replyWithAnimation(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -777,6 +819,8 @@ public suspend inline fun TelegramBot.replyWithAnimation(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -801,6 +845,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -823,6 +869,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -847,6 +895,8 @@ public suspend inline fun TelegramBot.replyWithAnimation(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -869,6 +919,8 @@ public suspend inline fun TelegramBot.replyWithAnimation(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -892,6 +944,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -913,6 +967,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -939,6 +995,8 @@ public suspend inline fun TelegramBot.replyWithAudio(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -960,6 +1018,8 @@ public suspend inline fun TelegramBot.replyWithAudio(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -980,6 +1040,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -998,6 +1060,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1020,6 +1084,8 @@ public suspend inline fun TelegramBot.replyWithAudio(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1040,6 +1106,8 @@ public suspend inline fun TelegramBot.replyWithAudio(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1059,6 +1127,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1076,6 +1146,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1099,6 +1171,8 @@ public suspend inline fun TelegramBot.replyWithDocument(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1118,6 +1192,8 @@ public suspend inline fun TelegramBot.replyWithDocument(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1138,6 +1214,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1156,6 +1234,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1176,6 +1256,8 @@ public suspend inline fun TelegramBot.replyWithDocument(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1194,6 +1276,8 @@ public suspend inline fun TelegramBot.replyWithDocument(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1213,6 +1297,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1230,6 +1316,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1379,6 +1467,8 @@ public suspend inline fun TelegramBot.replyWithPhoto(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1398,6 +1488,8 @@ public suspend inline fun TelegramBot.replyWithPhoto(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1419,6 +1511,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1438,6 +1532,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1459,6 +1555,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1478,6 +1576,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1499,6 +1599,8 @@ public suspend inline fun TelegramBot.replyWithPhoto(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1517,6 +1619,8 @@ public suspend inline fun TelegramBot.replyWithPhoto(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1537,6 +1641,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1555,6 +1661,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1575,6 +1683,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1593,6 +1703,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1613,6 +1725,8 @@ public suspend inline fun TelegramBot.replyWithSticker(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -1629,6 +1743,8 @@ public suspend inline fun TelegramBot.replyWithSticker(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -1647,6 +1763,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -1663,6 +1781,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -1692,6 +1812,8 @@ public suspend inline fun TelegramBot.replyWithVideo(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1715,6 +1837,8 @@ public suspend inline fun TelegramBot.replyWithVideo(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1736,6 +1860,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1755,6 +1881,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1779,6 +1907,8 @@ public suspend inline fun TelegramBot.replyWithVideo(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1801,6 +1931,8 @@ public suspend inline fun TelegramBot.replyWithVideo(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1821,6 +1953,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1839,6 +1973,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1864,6 +2000,8 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1884,6 +2022,8 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1905,6 +2045,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1924,6 +2066,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1945,6 +2089,8 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -1964,6 +2110,8 @@ public suspend inline fun TelegramBot.replyWithLivePhoto(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1984,6 +2132,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2002,6 +2152,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2025,6 +2177,8 @@ public suspend inline fun TelegramBot.replyWithVideoNote(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2043,6 +2197,8 @@ public suspend inline fun TelegramBot.replyWithVideoNote(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2060,6 +2216,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2075,6 +2233,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2098,6 +2258,8 @@ public suspend inline fun TelegramBot.replyWithVoice(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2116,6 +2278,8 @@ public suspend inline fun TelegramBot.replyWithVoice(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2135,6 +2299,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2152,6 +2318,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2172,6 +2340,8 @@ public suspend inline fun TelegramBot.replyWithVoice(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2189,6 +2359,8 @@ public suspend inline fun TelegramBot.replyWithVoice(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -2207,6 +2379,8 @@ public suspend inline fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -2223,6 +2397,8 @@ public suspend inline fun TelegramBot.reply(
threadId = replyInThreadId,
directMessageThreadId = replyInDirectMessageThreadId,
businessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3318,6 +3494,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -3337,6 +3515,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3355,6 +3535,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3373,6 +3555,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3391,6 +3575,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3409,6 +3595,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3427,6 +3615,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3445,6 +3635,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3463,6 +3655,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3481,6 +3675,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3499,6 +3695,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3522,6 +3720,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -3543,6 +3743,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3563,6 +3765,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3583,6 +3787,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3603,6 +3809,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3623,6 +3831,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3643,6 +3853,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3663,6 +3875,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3685,6 +3899,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInDirectMessageThreadId: DirectMessageThreadId? = replyInChatId.directMessageThreadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId,
receiverUserId: UserId? = replyInChatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -3705,6 +3921,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3724,6 +3942,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3743,6 +3963,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3761,6 +3983,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3780,6 +4004,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3799,6 +4025,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3818,6 +4046,8 @@ public suspend fun TelegramBot.reply(
replyInThreadId = replyInThreadId,
replyInDirectMessageThreadId = replyInDirectMessageThreadId,
replyInBusinessConnectionId = replyInBusinessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -0,0 +1,553 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.api.send.media.*
import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage
import dev.inmo.tgbotapi.types.message.content.*
/**
* 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.
*
* 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
* [IllegalArgumentException] if it does not carry an `ephemeralMessageId`).
*
* @see dev.inmo.tgbotapi.types.ephemeralReplyParametersOrNull
*/
/**
* @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,
ephemeralMessageId: EphemeralMessageId,
text: String,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<TextContent> = sendMessage(
chatId = chatId,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
public suspend fun TelegramBot.replyToEphemeral(
chatId: EphemeralChatId,
text: String,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<TextContent> = replyToEphemeral(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<PhotoContent> = sendPhoto(
chatId = chatId,
fileId = photo,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithPhoto(
chatId: EphemeralChatId,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<PhotoContent> = replyToEphemeralWithPhoto(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
photo = photo,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
livePhoto: InputFile,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<LivePhotoContent> = sendLivePhoto(
chatId = chatId,
livePhoto = livePhoto,
photo = photo,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithLivePhoto(
chatId: EphemeralChatId,
livePhoto: InputFile,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<LivePhotoContent> = replyToEphemeralWithLivePhoto(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
livePhoto = livePhoto,
photo = photo,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithAudio(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
audio: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<AudioContent> = sendAudio(
chatId = chatId,
audio = audio,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithAudio(
chatId: EphemeralChatId,
audio: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<AudioContent> = replyToEphemeralWithAudio(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
audio = audio,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithDocument(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
document: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<DocumentContent> = sendDocument(
chatId = chatId,
document = document,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithDocument(
chatId: EphemeralChatId,
document: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<DocumentContent> = replyToEphemeralWithDocument(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
document = document,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithVideo(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
video: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VideoContent> = sendVideo(
chatId = chatId,
video = video,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithVideo(
chatId: EphemeralChatId,
video: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VideoContent> = replyToEphemeralWithVideo(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
video = video,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
animation: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<AnimationContent> = sendAnimation(
chatId = chatId,
animation = animation,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithAnimation(
chatId: EphemeralChatId,
animation: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<AnimationContent> = replyToEphemeralWithAnimation(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
animation = animation,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithVoice(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
voice: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VoiceContent> = sendVoice(
chatId = chatId,
voice = voice,
text = text,
parseMode = parseMode,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithVoice(
chatId: EphemeralChatId,
voice: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VoiceContent> = replyToEphemeralWithVoice(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
voice = voice,
text = text,
parseMode = parseMode,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
videoNote: InputFile,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VideoNoteContent> = sendVideoNote(
chatId = chatId,
videoNote = videoNote,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithVideoNote(
chatId: EphemeralChatId,
videoNote: InputFile,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VideoNoteContent> = replyToEphemeralWithVideoNote(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
videoNote = videoNote,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithSticker(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
sticker: InputFile,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<StickerContent> = sendSticker(
chatId = chatId,
sticker = sticker,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithSticker(
chatId: EphemeralChatId,
sticker: InputFile,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<StickerContent> = replyToEphemeralWithSticker(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
sticker = sticker,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
/**
* Sends a static location (`live_period` is not supported for ephemeral messages, see [SendLocation.Live])
*/
public suspend fun TelegramBot.replyToEphemeralWithLocation(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
latitude: Double,
longitude: Double,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<StaticLocationContent> = sendStaticLocation(
chatId = chatId,
latitude = latitude,
longitude = longitude,
receiverUserId = receiverUserId,
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
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithLocation(
chatId: EphemeralChatId,
latitude: Double,
longitude: Double,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<StaticLocationContent> = replyToEphemeralWithLocation(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
latitude = latitude,
longitude = longitude,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithVenue(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
latitude: Double,
longitude: Double,
title: String,
address: String,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VenueContent> = sendVenue(
chatId = chatId,
latitude = latitude,
longitude = longitude,
title = title,
address = address,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithVenue(
chatId: EphemeralChatId,
latitude: Double,
longitude: Double,
title: String,
address: String,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<VenueContent> = replyToEphemeralWithVenue(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
latitude = latitude,
longitude = longitude,
title = title,
address = address,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)
public suspend fun TelegramBot.replyToEphemeralWithContact(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
phoneNumber: String,
firstName: String,
lastName: String? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<ContactContent> = sendContact(
chatId = chatId,
phoneNumber = phoneNumber,
firstName = firstName,
lastName = lastName,
receiverUserId = receiverUserId,
replyParameters = ReplyParameters.Ephemeral(ephemeralMessageId, allowSendingWithoutReply),
replyMarkup = replyMarkup
)
/**
* Convenience overload sourcing `receiverUserId`/`ephemeralMessageId` from [chatId]. Throws
* [IllegalArgumentException] if [chatId] does not carry an ephemeralMessageId
*/
public suspend fun TelegramBot.replyToEphemeralWithContact(
chatId: EphemeralChatId,
phoneNumber: String,
firstName: String,
lastName: String? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<ContactContent> = replyToEphemeralWithContact(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
phoneNumber = phoneNumber,
firstName = firstName,
lastName = lastName,
allowSendingWithoutReply = allowSendingWithoutReply,
replyMarkup = replyMarkup
)

View File

@@ -24,6 +24,8 @@ public suspend fun TelegramBot.sendContact(
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,
@@ -40,6 +42,8 @@ public suspend fun TelegramBot.sendContact(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -60,6 +64,8 @@ public suspend fun TelegramBot.sendContact(
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,
@@ -74,6 +80,8 @@ public suspend fun TelegramBot.sendContact(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -96,6 +104,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -111,6 +121,8 @@ public suspend fun TelegramBot.sendContact(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -130,6 +142,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -143,6 +157,8 @@ public suspend fun TelegramBot.sendContact(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -27,6 +27,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -46,6 +48,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -70,6 +74,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -88,6 +94,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -112,6 +120,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -130,6 +140,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -153,6 +165,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -171,6 +185,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -195,6 +211,8 @@ public suspend fun TelegramBot.sendLiveLocation(
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,
@@ -213,6 +231,8 @@ public suspend fun TelegramBot.sendLiveLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -236,6 +256,8 @@ public suspend fun TelegramBot.sendLiveLocation(
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,
@@ -254,6 +276,8 @@ public suspend fun TelegramBot.sendLiveLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -278,6 +302,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -296,6 +322,8 @@ public suspend fun TelegramBot.sendLiveLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -319,6 +347,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -337,6 +367,8 @@ public suspend fun TelegramBot.sendLiveLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -29,6 +29,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -45,6 +47,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -67,6 +71,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -82,6 +88,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -103,6 +111,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -118,6 +128,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -140,6 +152,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -155,6 +169,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -175,6 +191,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -190,6 +208,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -211,6 +231,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -226,6 +248,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -247,6 +271,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -262,6 +288,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -282,6 +310,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -296,6 +326,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -316,6 +348,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -331,6 +365,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -352,6 +388,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -367,6 +405,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -387,6 +427,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -401,6 +443,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -421,6 +465,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -436,6 +482,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -457,6 +505,8 @@ public suspend fun TelegramBot.sendMessage(
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,
@@ -472,6 +522,8 @@ public suspend fun TelegramBot.sendMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -493,6 +545,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -507,6 +561,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -527,6 +583,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -542,6 +600,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -563,6 +623,8 @@ public suspend fun TelegramBot.sendTextMessage(
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,
@@ -578,6 +640,8 @@ public suspend fun TelegramBot.sendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -0,0 +1,70 @@
package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendRichMessage
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage
import dev.inmo.tgbotapi.types.message.content.RichMessageContent
import dev.inmo.tgbotapi.types.rich.InputRichMessage
public suspend fun TelegramBot.sendRichMessage(
chatId: ChatIdentifier,
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,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<RichMessageContent> = execute(
SendRichMessage(
chatId = chatId,
richMessage = richMessage,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
)
public suspend fun TelegramBot.sendRichMessage(
chat: Chat,
richMessage: InputRichMessage,
threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ChatContentMessage<RichMessageContent> = sendRichMessage(
chatId = chat.id,
richMessage = richMessage,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)

View File

@@ -0,0 +1,21 @@
package dev.inmo.tgbotapi.extensions.api.send
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.SendRichMessageDraft
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.rich.InputRichMessage
public suspend fun TelegramBot.sendRichMessageDraft(
chatId: ChatId,
draftId: Long,
richMessage: InputRichMessage,
threadId: MessageThreadId? = chatId.threadId
): Unit = execute(
SendRichMessageDraft(
chatId = chatId,
draftId = draftId,
richMessage = richMessage,
threadId = threadId
)
)

View File

@@ -25,6 +25,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -40,6 +42,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -60,6 +64,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -74,6 +80,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -94,6 +102,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -108,6 +118,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -127,6 +139,8 @@ public suspend fun TelegramBot.sendLocation(
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,
@@ -141,6 +155,8 @@ public suspend fun TelegramBot.sendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -161,6 +177,8 @@ public suspend fun TelegramBot.sendStaticLocation(
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,
@@ -175,6 +193,8 @@ public suspend fun TelegramBot.sendStaticLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -194,6 +214,8 @@ public suspend fun TelegramBot.sendStaticLocation(
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,
@@ -208,6 +230,8 @@ public suspend fun TelegramBot.sendStaticLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -228,6 +252,8 @@ public suspend fun TelegramBot.sendStaticLocation(
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,
@@ -242,6 +268,8 @@ public suspend fun TelegramBot.sendStaticLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -261,6 +289,8 @@ public suspend fun TelegramBot.sendStaticLocation(
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,
@@ -275,6 +305,8 @@ public suspend fun TelegramBot.sendStaticLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -31,6 +31,8 @@ public suspend fun TelegramBot.sendVenue(
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,
@@ -52,6 +54,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -79,6 +83,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -99,6 +105,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -124,6 +132,8 @@ public suspend fun TelegramBot.sendVenue(
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,
@@ -144,6 +154,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -169,6 +181,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -189,6 +203,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -208,6 +224,8 @@ public suspend fun TelegramBot.sendVenue(
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,
@@ -222,6 +240,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -242,6 +262,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -255,6 +277,8 @@ public suspend fun TelegramBot.sendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -71,6 +71,8 @@ public suspend fun TelegramBot.send(
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,
@@ -91,6 +93,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -118,6 +122,8 @@ public suspend fun TelegramBot.send(
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,
@@ -138,6 +144,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -164,6 +172,8 @@ public suspend fun TelegramBot.send(
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,
@@ -183,6 +193,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -209,6 +221,8 @@ public suspend fun TelegramBot.send(
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,
@@ -228,6 +242,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -251,6 +267,8 @@ public suspend fun TelegramBot.send(
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,
@@ -267,6 +285,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -290,6 +310,8 @@ public suspend fun TelegramBot.send(
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,
@@ -306,6 +328,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -328,6 +352,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -343,6 +369,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -365,6 +393,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -380,6 +410,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -402,6 +434,8 @@ public suspend fun TelegramBot.send(
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,
@@ -417,6 +451,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -437,6 +473,8 @@ public suspend fun TelegramBot.send(
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,
@@ -450,6 +488,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -472,6 +512,8 @@ public suspend fun TelegramBot.send(
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,
@@ -487,6 +529,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -507,6 +551,8 @@ public suspend fun TelegramBot.send(
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,
@@ -520,6 +566,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -652,6 +700,8 @@ public suspend fun TelegramBot.send(
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,
@@ -668,6 +718,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -691,6 +743,8 @@ public suspend fun TelegramBot.send(
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,
@@ -707,6 +761,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -729,6 +785,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -744,6 +802,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -766,6 +826,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -780,6 +842,8 @@ public suspend inline fun TelegramBot.send(
entities = entities,
threadId = threadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -991,6 +1055,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1005,6 +1071,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1025,6 +1093,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1038,6 +1108,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1059,6 +1131,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1073,6 +1147,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1093,6 +1169,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1106,6 +1184,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1128,6 +1208,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1143,6 +1225,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1165,6 +1249,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1180,6 +1266,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1201,6 +1289,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1215,6 +1305,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1235,6 +1327,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1250,6 +1344,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1271,6 +1367,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1286,6 +1384,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1308,6 +1408,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1322,6 +1424,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1474,6 +1578,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1489,6 +1595,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1510,6 +1618,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1525,6 +1635,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1549,6 +1661,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1566,6 +1680,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1750,6 +1866,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1767,6 +1885,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1791,6 +1911,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1808,6 +1930,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1832,6 +1956,8 @@ public suspend fun TelegramBot.send(
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,
@@ -1849,6 +1975,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1872,6 +2000,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -1888,6 +2018,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1911,6 +2043,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -1927,6 +2061,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1950,6 +2086,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -1966,6 +2104,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -1989,6 +2129,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -2005,6 +2147,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3162,6 +3306,8 @@ public suspend fun TelegramBot.send(
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
receiverUserId: UserId? = chatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -3176,6 +3322,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -3197,6 +3345,8 @@ public suspend fun TelegramBot.send(
threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
receiverUserId: UserId? = chat.id.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -3211,6 +3361,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -3238,6 +3390,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3256,6 +3410,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3280,6 +3436,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3297,6 +3455,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3322,6 +3482,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3340,6 +3502,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3364,6 +3528,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3381,6 +3547,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3408,6 +3576,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3428,6 +3598,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3455,6 +3627,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3475,6 +3649,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3501,6 +3677,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3520,6 +3698,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3546,6 +3726,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3565,6 +3747,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3585,6 +3769,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3598,6 +3784,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3618,6 +3806,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3631,6 +3821,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3656,6 +3848,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3674,6 +3868,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3699,6 +3895,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3717,6 +3915,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3741,6 +3941,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -3758,6 +3960,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3782,6 +3986,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -3799,6 +4005,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3823,6 +4031,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3840,6 +4050,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3864,6 +4076,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3881,6 +4095,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3904,6 +4120,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -3920,6 +4138,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3943,6 +4163,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -3959,6 +4181,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -3979,6 +4203,8 @@ public suspend fun TelegramBot.send(
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,
@@ -3991,6 +4217,8 @@ public suspend fun TelegramBot.send(
videoNote = videoNote,
threadId = threadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -4012,6 +4240,8 @@ public suspend fun TelegramBot.send(
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,
@@ -4025,6 +4255,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -4047,6 +4279,8 @@ public suspend fun TelegramBot.send(
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,
@@ -4062,6 +4296,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -4084,6 +4320,8 @@ public suspend fun TelegramBot.send(
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,
@@ -4099,6 +4337,8 @@ public suspend fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -4120,6 +4360,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -4134,6 +4376,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -4155,6 +4399,8 @@ public suspend inline fun TelegramBot.send(
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,
@@ -4169,6 +4415,8 @@ public suspend inline fun TelegramBot.send(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -34,6 +34,8 @@ public suspend fun TelegramBot.sendAnimation(
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,
@@ -56,6 +58,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -83,6 +87,8 @@ public suspend fun TelegramBot.sendAnimation(
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,
@@ -104,6 +110,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -131,6 +139,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -152,6 +162,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -178,6 +190,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -198,6 +212,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -225,6 +241,8 @@ public suspend fun TelegramBot.sendAnimation(
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,
@@ -246,6 +264,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -272,6 +292,8 @@ public suspend fun TelegramBot.sendAnimation(
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,
@@ -292,6 +314,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -318,6 +342,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -338,6 +364,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -363,6 +391,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -382,6 +412,8 @@ public suspend fun TelegramBot.sendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -30,6 +30,8 @@ public suspend fun TelegramBot.sendAudio(
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,
@@ -50,6 +52,8 @@ public suspend fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -76,6 +80,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -95,6 +101,8 @@ public suspend fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -117,6 +125,8 @@ public suspend fun TelegramBot.sendAudio(
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,
@@ -136,6 +146,8 @@ public suspend fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -158,6 +170,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -174,6 +188,8 @@ public suspend fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -199,6 +215,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -218,6 +236,8 @@ public suspend inline fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -243,6 +263,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -261,6 +283,8 @@ public suspend inline fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -282,6 +306,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -300,6 +326,8 @@ public suspend inline fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -321,6 +349,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -336,6 +366,8 @@ public suspend inline fun TelegramBot.sendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -27,6 +27,8 @@ public suspend fun TelegramBot.sendDocument(
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,
@@ -45,6 +47,8 @@ public suspend fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -69,6 +73,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -86,6 +92,8 @@ public suspend fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -108,6 +116,8 @@ public suspend fun TelegramBot.sendDocument(
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,
@@ -125,6 +135,8 @@ public suspend fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -147,6 +159,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -163,6 +177,8 @@ public suspend fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -185,6 +201,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -202,6 +220,8 @@ public suspend inline fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -225,6 +245,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -241,6 +263,8 @@ public suspend inline fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -262,6 +286,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -278,6 +304,8 @@ public suspend inline fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -299,6 +327,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -314,6 +344,8 @@ public suspend inline fun TelegramBot.sendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -31,6 +31,8 @@ public suspend fun TelegramBot.sendLivePhoto(
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,
@@ -50,6 +52,8 @@ public suspend fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -74,6 +78,8 @@ public suspend fun TelegramBot.sendLivePhoto(
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,
@@ -92,6 +98,8 @@ public suspend fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -116,6 +124,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -134,6 +144,8 @@ public suspend fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -157,6 +169,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -174,6 +188,8 @@ public suspend fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -197,6 +213,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -215,6 +233,8 @@ public suspend inline fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -238,6 +258,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -255,6 +277,8 @@ public suspend inline fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -278,6 +302,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -295,6 +321,8 @@ public suspend inline fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -317,6 +345,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -333,6 +363,8 @@ public suspend inline fun TelegramBot.sendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -30,6 +30,8 @@ public suspend fun TelegramBot.sendPhoto(
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,
@@ -48,6 +50,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -72,6 +76,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -89,6 +95,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -112,6 +120,8 @@ public suspend fun TelegramBot.sendPhoto(
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,
@@ -129,6 +139,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -152,6 +164,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -169,6 +183,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -192,6 +208,8 @@ public suspend fun TelegramBot.sendPhoto(
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,
@@ -209,6 +227,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -232,6 +252,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -249,6 +271,8 @@ public suspend fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -272,6 +296,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -289,6 +315,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -312,6 +340,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -328,6 +358,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -350,6 +382,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -366,6 +400,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -388,6 +424,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -404,6 +442,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -426,6 +466,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -442,6 +484,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -464,6 +508,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -480,6 +526,8 @@ public suspend inline fun TelegramBot.sendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -24,6 +24,8 @@ public suspend fun TelegramBot.sendSticker(
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
receiverUserId: UserId? = chatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -39,6 +41,8 @@ public suspend fun TelegramBot.sendSticker(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -60,6 +64,8 @@ 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,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -74,6 +80,8 @@ public suspend fun TelegramBot.sendSticker(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -94,6 +102,8 @@ public suspend fun TelegramBot.sendSticker(
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
receiverUserId: UserId? = chatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -108,6 +118,8 @@ public suspend fun TelegramBot.sendSticker(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -128,6 +140,8 @@ 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,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -142,6 +156,8 @@ public suspend fun TelegramBot.sendSticker(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,

View File

@@ -37,6 +37,8 @@ public suspend fun TelegramBot.sendVideo(
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,
@@ -62,6 +64,8 @@ public suspend fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -87,6 +91,8 @@ public suspend fun TelegramBot.sendVideo(
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,
@@ -111,6 +117,8 @@ public suspend fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -141,6 +149,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -165,6 +175,8 @@ public suspend fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -190,6 +202,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -208,6 +222,8 @@ public suspend fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -237,6 +253,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -261,6 +279,8 @@ public suspend inline fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -285,6 +305,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -308,6 +330,8 @@ public suspend inline fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -337,6 +361,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -360,6 +386,8 @@ public suspend inline fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -384,6 +412,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -401,6 +431,8 @@ public suspend inline fun TelegramBot.sendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -25,6 +25,8 @@ public suspend fun TelegramBot.sendVideoNote(
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,
@@ -42,6 +44,8 @@ public suspend fun TelegramBot.sendVideoNote(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -62,6 +66,8 @@ public suspend fun TelegramBot.sendVideoNote(
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,
@@ -78,6 +84,8 @@ public suspend fun TelegramBot.sendVideoNote(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -100,6 +108,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -116,6 +126,8 @@ public suspend fun TelegramBot.sendVideoNote(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -135,6 +147,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -148,6 +162,8 @@ public suspend fun TelegramBot.sendVideoNote(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -27,6 +27,8 @@ public suspend fun TelegramBot.sendVoice(
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,
@@ -44,6 +46,8 @@ public suspend fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -67,6 +71,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -83,6 +89,8 @@ public suspend fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -104,6 +112,8 @@ public suspend fun TelegramBot.sendVoice(
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,
@@ -120,6 +130,8 @@ public suspend fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -141,6 +153,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -156,6 +170,8 @@ public suspend fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -178,6 +194,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -193,6 +211,8 @@ public suspend inline fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
duration = duration,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -216,6 +236,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -231,6 +253,8 @@ public suspend inline fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -251,6 +275,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -266,6 +292,8 @@ public suspend inline fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -285,6 +313,8 @@ 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,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
@@ -299,6 +329,8 @@ public suspend inline fun TelegramBot.sendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -83,6 +83,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
public fun getAllowedUpdates ()Ljava/util/List;
public fun getAsUpdateReceiver ()Lkotlin/jvm/functions/Function2;
public fun getBot ()Ldev/inmo/tgbotapi/bot/RequestsExecutor;
public fun getBotSubscriptionUpdatedUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
public fun getBusinessConnectionUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
public fun getBusinessMessageUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
public fun getCallbackQueriesFlow ()Lkotlinx/coroutines/flow/Flow;

View File

@@ -166,6 +166,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/B
public static synthetic fun expectOne$default (Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitBotSubscriptionUpdatedKt {
public static final fun waitBotSubscriptionUpdated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitBotSubscriptionUpdated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitBusinessConnectionKt {
public static final fun waitBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
@@ -394,6 +399,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitPhoto$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 waitPoll (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 waitPoll$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 waitRichMessage (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 waitRichMessage$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 waitStaticLocation (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 waitStaticLocation$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 waitSticker (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -467,6 +474,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitPhotoMessage$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 waitPollMessage (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 waitPollMessage$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 waitRichMessageMessage (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 waitRichMessageMessage$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 waitStaticLocationMessage (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 waitStaticLocationMessage$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 waitStickerMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -654,6 +663,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommonEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommonEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommunityChatAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommunityChatAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommunityChatRemoved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommunityChatRemoved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitDeleteChatPhotoEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitDeleteChatPhotoEvents$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitForumTopicClosed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -775,6 +788,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public static synthetic fun waitChatSharedRequestEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommonEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommonEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommunityChatAddedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommunityChatAddedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitCommunityChatRemovedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitCommunityChatRemovedEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitDeleteChatPhotoEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static synthetic fun waitDeleteChatPhotoEventsMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
public static final fun waitForumTopicClosedEventsMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -1020,6 +1037,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/filters/Messag
public static final fun getMessageFilterForums ()Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BotSubscriptionUpdatedTriggersKt {
public static final fun onBotSubscriptionUpdated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onBotSubscriptionUpdated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggersKt {
public static final fun onBusinessConnection (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onBusinessConnection$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
@@ -1299,6 +1321,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onPhoto$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 onPoll (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 onPoll$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 onRichMessage (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 onRichMessage$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 onStaticLocation (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 onStaticLocation$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 onSticker (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;
@@ -1413,6 +1437,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public static synthetic fun onChecklistTasksDone$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommonEvent (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommonEvent$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommunityChatAdded (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommunityChatAdded$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommunityChatRemoved (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommunityChatRemoved$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onDeleteChatPhoto (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onDeleteChatPhoto$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onForumTopicClosed (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
@@ -1864,6 +1892,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
public fun invoke-ErVIubg (Ldev/inmo/tgbotapi/types/polls/Poll;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBotSubscriptionUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBotSubscriptionUpdatedMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/payments/BotSubscriptionUpdated;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserBusinessConnectionUpdatedMarkerFactory;
public fun invoke (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.botSubscriptionUpdatedUpdateOrNull
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
import kotlinx.coroutines.flow.Flow
fun BehaviourContext.waitBotSubscriptionUpdated(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
): Flow<BotSubscriptionUpdated> = expectFlow(
initRequest,
errorFactory
) {
(it.botSubscriptionUpdatedUpdateOrNull() ?.data).let(::listOfNotNull)
}

View File

@@ -66,6 +66,10 @@ fun BehaviourContext.waitStory(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitContent(initRequest, errorFactory).mapContent<StoryContent>()
fun BehaviourContext.waitRichMessage(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitContent(initRequest, errorFactory).mapContent<RichMessageContent>()
fun BehaviourContext.waitVenue(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }

View File

@@ -75,6 +75,10 @@ fun BehaviourContext.waitStoryMessage(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitContentMessage(initRequest, errorFactory).mapWithContent<StoryContent>()
fun BehaviourContext.waitRichMessageMessage(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitContentMessage(initRequest, errorFactory).mapWithContent<RichMessageContent>()
fun BehaviourContext.waitVenueMessage(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }

View File

@@ -10,6 +10,8 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
@@ -327,6 +329,16 @@ fun BehaviourContext.waitSuggestedPostRefunded(
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<SuggestedPostRefunded>(initRequest, errorFactory)
fun BehaviourContext.waitCommunityChatAdded(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<CommunityChatAdded>(initRequest, errorFactory)
fun BehaviourContext.waitCommunityChatRemoved(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<CommunityChatRemoved>(initRequest, errorFactory)
fun BehaviourContext.waitSuggestedPostDeclined(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }

View File

@@ -7,6 +7,8 @@ import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
@@ -251,3 +253,13 @@ fun BehaviourContext.waitUniqueGiftSentOrReceivedMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<GiftSentOrReceivedEvent.UniqueGift>(initRequest, errorFactory)
fun BehaviourContext.waitCommunityChatAddedEventsMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<CommunityChatAdded>(initRequest, errorFactory)
fun BehaviourContext.waitCommunityChatRemovedEventsMessages(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEventsMessages<CommunityChatRemoved>(initRequest, errorFactory)

View File

@@ -0,0 +1,34 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserBotSubscriptionUpdatedMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.utils.botSubscriptionUpdatedUpdateOrNull
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
import dev.inmo.tgbotapi.types.update.abstracts.Update
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onBotSubscriptionUpdated(
initialFilter: SimpleFilter<BotSubscriptionUpdated>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, BotSubscriptionUpdated, Update>? = null,
markerFactory: MarkerFactory<in BotSubscriptionUpdated, Any>? = ByUserBotSubscriptionUpdatedMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, BotSubscriptionUpdated>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, BotSubscriptionUpdated>
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
(it.botSubscriptionUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull)
}

View File

@@ -304,6 +304,33 @@ fun <BC : BehaviourContext> BC.onStory(
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.onRichMessage(
initialFilter: CommonMessageFilter<RichMessageContent>? = CommonMessageFilterExcludeMediaGroups,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, RichMessageContentMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in RichMessageContentMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, RichMessageContentMessage>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, RichMessageContentMessage>
) = onContentMessageWithType(
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,

View File

@@ -15,6 +15,8 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
@@ -1452,3 +1454,45 @@ fun <BC : BehaviourContext> BC.onSuggestedPostRefunded(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onCommunityChatAdded(
initialFilter: SimpleFilter<ChatEventMessage<CommunityChatAdded>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommunityChatAdded>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<CommunityChatAdded>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<CommunityChatAdded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommunityChatAdded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
* to combinate several filters
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
* "stream"
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
* data
*/
fun <BC : BehaviourContext> BC.onCommunityChatRemoved(
initialFilter: SimpleFilter<ChatEventMessage<CommunityChatRemoved>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChatEventMessage<CommunityChatRemoved>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChatEventMessage<CommunityChatRemoved>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<CommunityChatRemoved>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<CommunityChatRemoved>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
import dev.inmo.tgbotapi.types.payments.BotSubscriptionUpdated
object ByUserBotSubscriptionUpdatedMarkerFactory : MarkerFactory<BotSubscriptionUpdated, Any> {
override suspend fun invoke(data: BotSubscriptionUpdated) = data.user
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.EphemeralMessageId
import dev.inmo.tgbotapi.types.UserId
interface EphemeralMessageAction : ChatRequest {
val receiverUserId: UserId
val ephemeralMessageId: EphemeralMessageId
}

View File

@@ -0,0 +1,37 @@
package dev.inmo.tgbotapi.requests
import dev.inmo.tgbotapi.abstracts.types.EphemeralMessageAction
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer
@Serializable
data class DeleteEphemeralMessage(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(receiverUserIdField)
@EncodeDefault
override val receiverUserId: UserId,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(ephemeralMessageIdField)
@EncodeDefault
override val ephemeralMessageId: EphemeralMessageId
) : SimpleRequest<Unit>, EphemeralMessageAction {
constructor(
chatId: EphemeralChatId
): this(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" }
)
override fun method(): String = "deleteEphemeralMessage"
override val resultDeserializer: DeserializationStrategy<Unit>
get() = UnitFromBooleanSerializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -0,0 +1,96 @@
package dev.inmo.tgbotapi.requests.chat.invite_links
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId
import dev.inmo.tgbotapi.types.chatJoinRequestQueryIdField
import dev.inmo.tgbotapi.types.resultField
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
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
/**
* Result of an [AnswerChatJoinRequestQuery]. Serialized as a plain string.
*
* @see <a href="https://core.telegram.org/bots/api#answerchatjoinrequestquery">answerChatJoinRequestQuery</a>
*/
@Serializable(ChatJoinRequestQueryResult.Companion::class)
sealed interface ChatJoinRequestQueryResult {
val name: String
/**
* Allow the user to join the chat.
*/
@Serializable(ChatJoinRequestQueryResult.Companion::class)
data object Approve : ChatJoinRequestQueryResult {
override val name: String = "approve"
}
/**
* Disallow the user to join the chat.
*/
@Serializable(ChatJoinRequestQueryResult.Companion::class)
data object Decline : ChatJoinRequestQueryResult {
override val name: String = "decline"
}
/**
* Leave the decision to other administrators.
*/
@Serializable(ChatJoinRequestQueryResult.Companion::class)
data object Queue : ChatJoinRequestQueryResult {
override val name: String = "queue"
}
/**
* Any other result which is currently unknown to this library.
*/
@Serializable(ChatJoinRequestQueryResult.Companion::class)
data class Unknown(override val name: String) : ChatJoinRequestQueryResult
companion object : KSerializer<ChatJoinRequestQueryResult> {
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("ChatJoinRequestQueryResult", PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: ChatJoinRequestQueryResult) {
encoder.encodeString(value.name)
}
override fun deserialize(decoder: Decoder): ChatJoinRequestQueryResult {
return when (val name = decoder.decodeString()) {
Approve.name -> Approve
Decline.name -> Decline
Queue.name -> Queue
else -> Unknown(name)
}
}
}
}
/**
* Use this method to process a received chat join request query.
*
* @see <a href="https://core.telegram.org/bots/api#answerchatjoinrequestquery">answerChatJoinRequestQuery</a>
*/
@Serializable
data class AnswerChatJoinRequestQuery(
@SerialName(chatJoinRequestQueryIdField)
val chatJoinRequestQueryId: ChatJoinRequestQueryId,
@SerialName(resultField)
val result: ChatJoinRequestQueryResult
) : SimpleRequest<Unit> {
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val resultDeserializer: DeserializationStrategy<Unit>
get() = UnitFromBooleanSerializer
override fun method(): String = "answerChatJoinRequestQuery"
}

View File

@@ -0,0 +1,34 @@
package dev.inmo.tgbotapi.requests.chat.invite_links
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId
import dev.inmo.tgbotapi.types.chatJoinRequestQueryIdField
import dev.inmo.tgbotapi.types.webAppUrlField
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
/**
* Use this method to process a received chat join request query by showing a Mini App to the user before deciding the
* outcome. Call [AnswerChatJoinRequestQuery] to resolve the join request query based on the user interaction with the
* Mini App.
*
* @see <a href="https://core.telegram.org/bots/api#sendchatjoinrequestwebapp">sendChatJoinRequestWebApp</a>
*/
@Serializable
data class SendChatJoinRequestWebApp(
@SerialName(chatJoinRequestQueryIdField)
val chatJoinRequestQueryId: ChatJoinRequestQueryId,
@SerialName(webAppUrlField)
val webAppUrl: String
) : SimpleRequest<Unit> {
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val resultDeserializer: DeserializationStrategy<Unit>
get() = UnitFromBooleanSerializer
override fun method(): String = "sendChatJoinRequestWebApp"
}

View File

@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.requests.edit.abstracts
import dev.inmo.tgbotapi.abstracts.types.EphemeralMessageAction
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.builtins.serializer
interface EditEphemeralMessage : SimpleRequest<Unit>, EphemeralMessageAction {
override val resultDeserializer: DeserializationStrategy<Unit>
get() = UnitFromBooleanSerializer
}

View File

@@ -3,5 +3,5 @@ package dev.inmo.tgbotapi.requests.edit.abstracts
import dev.inmo.tgbotapi.abstracts.TextedOutput
interface EditTextChatMessage : TextedOutput {
override val text: String
override val text: String?
}

View File

@@ -0,0 +1,105 @@
package dev.inmo.tgbotapi.requests.edit.caption
import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.*
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.extensions.makeString
import kotlinx.serialization.*
const val editEphemeralMessageCaptionMethod = "editEphemeralMessageCaption"
fun EditEphemeralMessageCaption(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
caption: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageCaption(
chatId = chatId,
receiverUserId = receiverUserId,
ephemeralMessageId = ephemeralMessageId,
text = caption,
parseMode = parseMode,
rawEntities = null,
replyMarkup = replyMarkup
)
fun EditEphemeralMessageCaption(
chatId: EphemeralChatId,
caption: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageCaption(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
caption = caption,
parseMode = parseMode,
replyMarkup = replyMarkup
)
fun EditEphemeralMessageCaption(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageCaption(
chatId = chatId,
receiverUserId = receiverUserId,
ephemeralMessageId = ephemeralMessageId,
text = entities.makeString(),
parseMode = null,
rawEntities = entities.toRawMessageEntities(),
replyMarkup = replyMarkup
)
fun EditEphemeralMessageCaption(
chatId: EphemeralChatId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageCaption(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
entities = entities,
replyMarkup = replyMarkup
)
@ConsistentCopyVisibility
@Serializable
data class EditEphemeralMessageCaption internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(receiverUserIdField)
@EncodeDefault
override val receiverUserId: UserId,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(ephemeralMessageIdField)
@EncodeDefault
override val ephemeralMessageId: EphemeralMessageId,
@SerialName(captionField)
override val text: String? = null,
@SerialName(parseModeField)
override val parseMode: ParseMode? = null,
@SerialName(captionEntitiesField)
private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditEphemeralMessage, EditTextChatMessage, EditReplyMessage {
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)
}
override fun method(): String = editEphemeralMessageCaptionMethod
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -0,0 +1,51 @@
package dev.inmo.tgbotapi.requests.edit.media
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.media.TelegramFreeMedia
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
const val editEphemeralMessageMediaMethod = "editEphemeralMessageMedia"
@Serializable
data class EditEphemeralMessageMedia(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(receiverUserIdField)
@EncodeDefault
override val receiverUserId: UserId,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(ephemeralMessageIdField)
@EncodeDefault
override val ephemeralMessageId: EphemeralMessageId,
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(mediaField)
override val media: TelegramFreeMedia,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditEphemeralMessage, EditReplyMessage, EditMediaMessage {
constructor(
chatId: EphemeralChatId,
media: TelegramFreeMedia,
replyMarkup: InlineKeyboardMarkup? = null
): this(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
media,
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 fun method(): String = editEphemeralMessageMediaMethod
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -0,0 +1,39 @@
package dev.inmo.tgbotapi.requests.edit.reply_markup
import dev.inmo.tgbotapi.requests.edit.abstracts.EditEphemeralMessage
import dev.inmo.tgbotapi.requests.edit.abstracts.EditReplyMessage
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import kotlinx.serialization.*
const val editEphemeralMessageReplyMarkupMethod = "editEphemeralMessageReplyMarkup"
@Serializable
data class EditEphemeralMessageReplyMarkup(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(receiverUserIdField)
@EncodeDefault
override val receiverUserId: UserId,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(ephemeralMessageIdField)
@EncodeDefault
override val ephemeralMessageId: EphemeralMessageId,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditEphemeralMessage, EditReplyMessage {
constructor(
chatId: EphemeralChatId,
replyMarkup: InlineKeyboardMarkup? = null
): this(
chatId,
chatId.receiverUser,
requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
replyMarkup
)
override fun method(): String = editEphemeralMessageReplyMarkupMethod
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -13,6 +13,7 @@ import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.types.rich.InputRichMessage
import dev.inmo.tgbotapi.utils.extensions.makeString
import kotlinx.serialization.*
@@ -55,6 +56,24 @@ fun EditChatMessageText(
replyMarkup
)
fun EditChatMessageRichText(
chatId: ChatIdentifier,
messageId: MessageId,
richMessage: InputRichMessage,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
) = EditChatMessageText(
chatId = chatId,
messageId = messageId,
text = null,
parseMode = null,
rawEntities = null,
businessConnectionId = businessConnectionId,
linkPreviewOptions = null,
replyMarkup = replyMarkup,
richMessage = richMessage
)
@ConsistentCopyVisibility
@Serializable
data class EditChatMessageText internal constructor(
@@ -63,7 +82,7 @@ data class EditChatMessageText internal constructor(
@SerialName(messageIdField)
override val messageId: MessageId,
@SerialName(textField)
override val text: String,
override val text: String? = null,
@SerialName(parseModeField)
override val parseMode: ParseMode? = null,
@SerialName(entitiesField)
@@ -73,10 +92,12 @@ data class EditChatMessageText internal constructor(
@SerialName(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(richMessageField)
val richMessage: InputRichMessage? = null
) : EditChatMessage<TextContent>, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text)
text ?.let { rawEntities ?.asTextSources(it) }
}
override fun method(): String = editMessageTextMethod

View File

@@ -0,0 +1,122 @@
package dev.inmo.tgbotapi.requests.edit.text
import dev.inmo.tgbotapi.requests.edit.abstracts.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.parseModeField
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.*
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.extensions.makeString
import dev.inmo.tgbotapi.utils.throwRangeError
import kotlinx.serialization.*
const val editEphemeralMessageTextMethod = "editEphemeralMessageText"
fun EditEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
text: String,
parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageText(
chatId = chatId,
receiverUserId = receiverUserId,
ephemeralMessageId = ephemeralMessageId,
text = text,
parseMode = parseMode,
rawEntities = null,
linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
)
fun EditEphemeralMessageText(
chatId: EphemeralChatId,
text: String,
parseMode: ParseMode? = null,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageText(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
text = text,
parseMode = parseMode,
linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
)
fun EditEphemeralMessageText(
chatId: ChatIdentifier,
receiverUserId: UserId,
ephemeralMessageId: EphemeralMessageId,
entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageText(
chatId = chatId,
receiverUserId = receiverUserId,
ephemeralMessageId = ephemeralMessageId,
text = entities.makeString(),
parseMode = null,
rawEntities = entities.toRawMessageEntities(),
linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
)
fun EditEphemeralMessageText(
chatId: EphemeralChatId,
entities: TextSourcesList,
linkPreviewOptions: LinkPreviewOptions? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = EditEphemeralMessageText(
chatId = chatId,
receiverUserId = chatId.receiverUser,
ephemeralMessageId = requireNotNull(chatId.ephemeralMessageId) { "chatId ($chatId) does not carry an ephemeralMessageId" },
entities = entities,
linkPreviewOptions = linkPreviewOptions,
replyMarkup = replyMarkup
)
@ConsistentCopyVisibility
@Serializable
data class EditEphemeralMessageText internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(receiverUserIdField)
@EncodeDefault
override val receiverUserId: UserId,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(ephemeralMessageIdField)
@EncodeDefault
override val ephemeralMessageId: EphemeralMessageId,
@SerialName(textField)
override val text: String,
@SerialName(parseModeField)
override val parseMode: ParseMode? = null,
@SerialName(entitiesField)
private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditEphemeralMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text)
}
init {
if (text.length !in textLength) {
throwRangeError("Text length", textLength, text.length)
}
}
override fun method(): String = editEphemeralMessageTextMethod
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -1,5 +1,6 @@
package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyEphemeralSendRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
@@ -36,6 +37,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -51,7 +56,8 @@ data class SendContact(
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendContentMessageRequest<ChatContentMessage<ContactContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<ContactContent>>
ReplyingMarkupSendMessageRequest<ChatContentMessage<ContactContent>>,
OptionallyEphemeralSendRequest
{
constructor(
chatId: ChatIdentifier,
@@ -59,6 +65,8 @@ data class SendContact(
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,
@@ -74,6 +82,8 @@ data class SendContact(
threadId,
directMessageThreadId,
businessConnectionId,
receiverUserId,
callbackQueryId,
disableNotification,
protectContent,
allowPaidBroadcast,
@@ -95,6 +105,8 @@ fun Contact.toRequest(
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,
@@ -108,6 +120,8 @@ fun Contact.toRequest(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -34,6 +34,8 @@ fun SendLocation(
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,
@@ -48,6 +50,8 @@ fun SendLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -64,6 +68,8 @@ fun SendStaticLocation(
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,
@@ -78,6 +84,8 @@ fun SendStaticLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -87,6 +95,11 @@ fun SendStaticLocation(
replyMarkup = replyMarkup
)
/**
* @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]
* for ephemeral locations.
*/
fun SendLiveLocation(
chatId: ChatIdentifier,
latitude: Double,
@@ -98,6 +111,8 @@ fun SendLiveLocation(
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,
@@ -116,6 +131,8 @@ fun SendLiveLocation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -132,9 +149,15 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
HorizontallyAccured,
Livable,
ProximityAlertable,
Headed {
Headed,
OptionallyEphemeralSendRequest {
override fun method(): String = "sendLocation"
/**
* @property livePeriod According to Telegram Bots API, must be `0` when sending as an ephemeral message (with
* [receiverUserId] set), as ephemeral messages do not support live location updates. Prefer [Static]
* for ephemeral locations.
*/
@Serializable
data class Live (
@SerialName(chatIdField)
@@ -165,6 +188,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -215,6 +242,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -267,6 +298,10 @@ 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(disableNotificationField)
val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -297,6 +332,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
threadId = surrogate.threadId,
directMessageThreadId = surrogate.directMessageThreadId,
businessConnectionId = surrogate.businessConnectionId,
receiverUserId = surrogate.receiverUserId,
callbackQueryId = surrogate.callbackQueryId,
disableNotification = surrogate.disableNotification,
protectContent = surrogate.protectContent,
allowPaidBroadcast = surrogate.allowPaidBroadcast,
@@ -316,6 +353,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
threadId = surrogate.threadId,
directMessageThreadId = surrogate.directMessageThreadId,
businessConnectionId = surrogate.businessConnectionId,
receiverUserId = surrogate.receiverUserId,
callbackQueryId = surrogate.callbackQueryId,
disableNotification = surrogate.disableNotification,
protectContent = surrogate.protectContent,
allowPaidBroadcast = surrogate.allowPaidBroadcast,
@@ -340,6 +379,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -30,6 +30,8 @@ fun SendTextMessage(
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,
@@ -45,6 +47,8 @@ fun SendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
linkPreviewOptions = linkPreviewOptions,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -62,6 +66,8 @@ fun SendTextMessage(
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,
@@ -77,6 +83,8 @@ fun SendTextMessage(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
linkPreviewOptions = linkPreviewOptions,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -108,6 +116,10 @@ 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(linkPreviewOptionsField)
override val linkPreviewOptions: LinkPreviewOptions? = null,
@SerialName(disableNotificationField)
@@ -127,7 +139,8 @@ data class SendTextMessage internal constructor(
) : SendContentMessageRequest<ChatContentMessage<TextContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<TextContent>>,
TextableSendMessageRequest<ChatContentMessage<TextContent>>,
LinkPreviewOptionsContainer
LinkPreviewOptionsContainer,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text)

View File

@@ -0,0 +1,73 @@
package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.abstracts.MultipartRequest
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.*
import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.RichMessageContent
import dev.inmo.tgbotapi.types.rich.InputRichMessage
import dev.inmo.tgbotapi.types.rich.multipartFiles
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.EncodeDefault
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
internal val RichMessageContentMessageResultDeserializer: DeserializationStrategy<ChatContentMessage<RichMessageContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
/**
* Use this method to send rich messages.
*
* @see <a href="https://core.telegram.org/bots/api#sendrichmessage">sendRichMessage</a>
*/
@Serializable
data class SendRichMessage(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(richMessageField)
val richMessage: InputRichMessage,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(messageThreadIdField)
@EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
override val protectContent: Boolean = false,
@SerialName(allowPaidBroadcastField)
override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendContentMessageRequest<ChatContentMessage<RichMessageContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<RichMessageContent>>,
MultipartRequest.Common<ChatContentMessage<RichMessageContent>> {
override fun method(): String = "sendRichMessage"
override val resultDeserializer: DeserializationStrategy<ChatContentMessage<RichMessageContent>>
get() = RichMessageContentMessageResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val data: SimpleRequest<ChatContentMessage<RichMessageContent>>
get() = this
override val mediaMap: Map<String, MultipartFile> by lazy { richMessage.multipartFiles }
}

View File

@@ -0,0 +1,55 @@
package dev.inmo.tgbotapi.requests.send
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chatIdField
import dev.inmo.tgbotapi.types.draftIdField
import dev.inmo.tgbotapi.types.messageThreadIdField
import dev.inmo.tgbotapi.types.richMessageField
import dev.inmo.tgbotapi.types.rich.InputRichMessage
import dev.inmo.tgbotapi.types.rich.multipartFiles
import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationStrategy
/**
* Use this method to stream a partial rich message to a user while the message is being generated. The streamed draft is
* 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.
*
* @see <a href="https://core.telegram.org/bots/api#sendrichmessagedraft">sendRichMessageDraft</a>
*/
@Serializable
data class SendRichMessageDraft(
@SerialName(chatIdField)
val chatId: ChatId,
/**
* Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated.
*/
@SerialName(draftIdField)
val draftId: Long,
@SerialName(richMessageField)
val richMessage: InputRichMessage,
@SerialName(messageThreadIdField)
val threadId: MessageThreadId? = chatId.threadId
) : SimpleRequest<Unit> {
init {
require(draftId != 0L) {
"draftId of SendRichMessageDraft must be non-zero"
}
require(richMessage.multipartFiles.isEmpty()) {
"sendRichMessageDraft does not support direct upload of new files"
}
}
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
override val resultDeserializer: DeserializationStrategy<Unit>
get() = UnitFromBooleanSerializer
override fun method(): String = "sendRichMessageDraft"
}

View File

@@ -45,6 +45,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -62,7 +66,8 @@ data class SendVenue(
) : SendContentMessageRequest<ChatContentMessage<VenueContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<VenueContent>>,
TitledSendMessageRequest<ChatContentMessage<VenueContent>>,
PositionedSendMessageRequest<ChatContentMessage<VenueContent>>
PositionedSendMessageRequest<ChatContentMessage<VenueContent>>,
OptionallyEphemeralSendRequest
{
constructor(
chatId: ChatIdentifier,
@@ -70,6 +75,8 @@ data class SendVenue(
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,
@@ -90,6 +97,8 @@ data class SendVenue(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -111,6 +120,8 @@ fun Venue.toRequest(
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,
@@ -124,6 +135,8 @@ fun Venue.toRequest(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,

View File

@@ -0,0 +1,13 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.types.CallbackQueryId
import dev.inmo.tgbotapi.types.UserId
/**
* 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.
*/
interface OptionallyEphemeralSendRequest {
val receiverUserId: UserId?
val callbackQueryId: CallbackQueryId?
}

View File

@@ -38,6 +38,8 @@ fun SendAnimation(
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,
@@ -64,6 +66,8 @@ fun SendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -96,6 +100,8 @@ fun SendAnimation(
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,
@@ -122,6 +128,8 @@ fun SendAnimation(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -179,6 +187,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -201,7 +213,8 @@ data class SendAnimationData internal constructor(
DuratedSendMessageRequest<ChatContentMessage<AnimationContent>>,
SizedSendMessageRequest<ChatContentMessage<AnimationContent>>,
WithCustomizableCaptionRequest<ChatContentMessage<AnimationContent>>,
OptionallyWithSpoilerRequest
OptionallyWithSpoilerRequest,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -37,6 +37,8 @@ fun SendAudio(
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,
@@ -61,6 +63,8 @@ fun SendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -91,6 +95,8 @@ fun SendAudio(
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,
@@ -115,6 +121,8 @@ fun SendAudio(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -168,6 +176,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -189,7 +201,8 @@ data class SendAudioData internal constructor(
ThumbedSendMessageRequest<ChatContentMessage<AudioContent>>,
TitledSendMessageRequest<ChatContentMessage<AudioContent>>,
DuratedSendMessageRequest<ChatContentMessage<AudioContent>>,
Performerable
Performerable,
OptionallyEphemeralSendRequest
{
override val textSources: List<TextSource>? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -42,6 +42,8 @@ fun SendDocument(
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,
@@ -64,6 +66,8 @@ fun SendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -101,6 +105,8 @@ fun SendDocument(
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,
@@ -123,6 +129,8 @@ fun SendDocument(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -180,6 +188,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -200,7 +212,8 @@ data class SendDocumentData internal constructor(
SendContentMessageRequest<ChatContentMessage<DocumentContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<DocumentContent>>,
TextableSendMessageRequest<ChatContentMessage<DocumentContent>>,
ThumbedSendMessageRequest<ChatContentMessage<DocumentContent>>
ThumbedSendMessageRequest<ChatContentMessage<DocumentContent>>,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -35,6 +35,8 @@ fun SendLivePhoto(
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,
@@ -58,6 +60,8 @@ fun SendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -87,6 +91,8 @@ fun SendLivePhoto(
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,
@@ -110,6 +116,8 @@ fun SendLivePhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -161,6 +169,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -180,7 +192,8 @@ data class SendLivePhotoData internal constructor(
ReplyingMarkupSendMessageRequest<ChatContentMessage<LivePhotoContent>>,
TextableSendMessageRequest<ChatContentMessage<LivePhotoContent>>,
WithCustomizableCaptionRequest<ChatContentMessage<LivePhotoContent>>,
OptionallyWithSpoilerRequest
OptionallyWithSpoilerRequest,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -33,6 +33,8 @@ fun SendPhoto(
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,
@@ -52,6 +54,8 @@ fun SendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -79,6 +83,8 @@ fun SendPhoto(
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,
@@ -98,6 +104,8 @@ fun SendPhoto(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -147,6 +155,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -166,7 +178,8 @@ data class SendPhotoData internal constructor(
ReplyingMarkupSendMessageRequest<ChatContentMessage<PhotoContent>>,
TextableSendMessageRequest<ChatContentMessage<PhotoContent>>,
WithCustomizableCaptionRequest<ChatContentMessage<PhotoContent>>,
OptionallyWithSpoilerRequest
OptionallyWithSpoilerRequest,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send.media
import dev.inmo.tgbotapi.requests.abstracts.*
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyEphemeralSendRequest
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
@@ -22,6 +23,8 @@ fun SendSticker(
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
receiverUserId: UserId? = chatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
emoji: String? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -36,6 +39,8 @@ fun SendSticker(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
emoji = emoji,
disableNotification = disableNotification,
protectContent = protectContent,
@@ -74,6 +79,10 @@ 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(emojiField)
val emoji: String? = null,
@SerialName(disableNotificationField)
@@ -90,7 +99,7 @@ data class SendStickerByFileId internal constructor(
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendContentMessageRequest<ChatContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ChatContentMessage<StickerContent>> {
) : SendContentMessageRequest<ChatContentMessage<StickerContent>>, ReplyingMarkupSendMessageRequest<ChatContentMessage<StickerContent>>, OptionallyEphemeralSendRequest {
override fun method(): String = "sendSticker"
override val resultDeserializer: DeserializationStrategy<ChatContentMessage<StickerContent>>
get() = commonResultDeserializer

View File

@@ -43,6 +43,8 @@ fun SendVideo(
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,
@@ -73,6 +75,8 @@ fun SendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -108,6 +112,8 @@ fun SendVideo(
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,
@@ -138,6 +144,8 @@ fun SendVideo(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -201,6 +209,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -226,7 +238,8 @@ data class SendVideoData internal constructor(
CoveredSendMessageRequest<ChatContentMessage<VideoContent>>,
WithCustomStartMediaData,
OptionallyWithSpoilerRequest,
OptionallyStreamable
OptionallyStreamable,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -25,6 +25,8 @@ fun SendVideoNote(
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,
@@ -45,6 +47,8 @@ fun SendVideoNote(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -90,6 +94,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -109,7 +117,8 @@ data class SendVideoNoteData internal constructor(
ReplyingMarkupSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
ThumbedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
DuratedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
SizedSendMessageRequest<ChatContentMessage<VideoNoteContent>>
SizedSendMessageRequest<ChatContentMessage<VideoNoteContent>>,
OptionallyEphemeralSendRequest
{
override val height: Int?
get() = width

View File

@@ -31,6 +31,8 @@ fun SendVoice(
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,
@@ -51,6 +53,8 @@ fun SendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -77,6 +81,8 @@ fun SendVoice(
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
receiverUserId: UserId? = chatId.receiverUser,
callbackQueryId: CallbackQueryId? = null,
duration: Long? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
@@ -98,6 +104,8 @@ fun SendVoice(
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
receiverUserId = receiverUserId,
callbackQueryId = callbackQueryId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
@@ -145,6 +153,10 @@ 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(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
@@ -163,7 +175,8 @@ data class SendVoiceData internal constructor(
SendContentMessageRequest<ChatContentMessage<VoiceContent>>,
ReplyingMarkupSendMessageRequest<ChatContentMessage<VoiceContent>>,
TextableSendMessageRequest<ChatContentMessage<VoiceContent>>,
DuratedSendMessageRequest<ChatContentMessage<VoiceContent>>
DuratedSendMessageRequest<ChatContentMessage<VoiceContent>>,
OptionallyEphemeralSendRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)

View File

@@ -14,7 +14,9 @@ data class BotCommand(
@SerialName(botCommandField)
val command: String,
@SerialName(descriptionField)
val description: String
val description: String,
@SerialName(isEphemeralField)
val isEphemeral: Boolean = false
) {
init {
if (command.length !in botCommandLengthLimit) {

View File

@@ -39,6 +39,10 @@ sealed interface IdChatIdentifier : ChatIdentifier {
get() = null
val directMessageThreadId: DirectMessageThreadId?
get() = null
val receiverUser: UserId?
get() = null
val ephemeralMessageId: EphemeralMessageId?
get() = null
companion object {
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
@@ -48,6 +52,7 @@ sealed interface IdChatIdentifier : ChatIdentifier {
} ?: ChatId(chatId)
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId) = ChatIdWithThreadId(chatId, threadId)
operator fun invoke(chatId: RawChatId, businessConnectionId: BusinessConnectionId) = BusinessChatId(chatId, businessConnectionId)
operator fun invoke(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = EphemeralChatId(chatId, receiverUser, ephemeralMessageId)
}
}
@@ -91,6 +96,26 @@ value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, B
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
}
/**
* Chat id of group/supergroup additionally carrying ephemeral [receiverUser] (and optional [ephemeralMessageId]);
* used to default `receiverUserId`/`ephemeralMessageId` params of ephemeral-related requests
*/
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(ChatIdentifierSerializer::class)
@JvmInline
value class EphemeralChatId(
val chatIdWithReceiverUserAndEphemeralMessageId: Triple<RawChatId, UserId, EphemeralMessageId?>
) : IdChatIdentifier {
override val chatId: RawChatId
get() = chatIdWithReceiverUserAndEphemeralMessageId.first
override val receiverUser: UserId
get() = chatIdWithReceiverUserAndEphemeralMessageId.second
override val ephemeralMessageId: EphemeralMessageId?
get() = chatIdWithReceiverUserAndEphemeralMessageId.third
constructor(chatId: RawChatId, receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null): this(Triple(chatId, receiverUser, ephemeralMessageId))
}
val ChatIdentifier.threadId: MessageThreadId?
get() = (this as? IdChatIdentifier) ?.threadId
@@ -100,16 +125,24 @@ val ChatIdentifier.directMessageThreadId: DirectMessageThreadId?
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
get() = (this as? IdChatIdentifier) ?.businessConnectionId
val ChatIdentifier.receiverUser: UserId?
get() = (this as? IdChatIdentifier) ?.receiverUser
val ChatIdentifier.ephemeralMessageId: EphemeralMessageId?
get() = (this as? IdChatIdentifier) ?.ephemeralMessageId
fun IdChatIdentifier.toChatId() = when (this) {
is ChatId -> this
is ChatIdWithThreadId -> ChatId(chatId)
is ChatIdWithChannelDirectMessageThreadId -> ChatId(chatId)
is BusinessChatId -> ChatId(chatId)
is EphemeralChatId -> ChatId(chatId)
}
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
fun IdChatIdentifier.toChatIdWithChannelDirectMessageThreadId(threadId: DirectMessageThreadId) = ChatIdWithChannelDirectMessageThreadId(chatId, threadId)
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
fun IdChatIdentifier.toEphemeralChatId(receiverUser: UserId, ephemeralMessageId: EphemeralMessageId? = null) = IdChatIdentifier(chatId, receiverUser, ephemeralMessageId)
/**
* https://core.telegram.org/bots/api#formatting-options
@@ -256,6 +289,17 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
)
}
}
4 -> {
val (chatId, intermediateDelimiter, receiverUserChatId, ephemeralMessageId) = splitted
when (intermediateDelimiter) {
"eph" -> EphemeralChatId(
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
receiverUserChatId.toLongOrNull() ?.let { ChatId(RawChatId(it)) } ?: return@let null,
ephemeralMessageId.toLongOrNull() ?.let(::EphemeralMessageId)
)
else -> null
}
}
else -> null
}
} ?: id.content.let {
@@ -269,6 +313,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessConnectionId}")
is ChatIdWithChannelDirectMessageThreadId -> encoder.encodeString("${value.chatId}/cdm/${value.directMessageThreadId}")
is EphemeralChatId -> encoder.encodeString("${value.chatId}/eph/${value.receiverUser.chatId}/${value.ephemeralMessageId?.long ?: ""}")
is Username -> encoder.encodeString(value.full)
}
}

View File

@@ -0,0 +1,19 @@
package dev.inmo.tgbotapi.types
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
/**
* Identifier of a join request query.
*
* @see <a href="https://core.telegram.org/bots/api#chatjoinrequest">ChatJoinRequest.query_id</a>
*/
@Serializable
@JvmInline
value class ChatJoinRequestQueryId(
val string: String
) {
override fun toString(): String {
return string
}
}

View File

@@ -463,8 +463,10 @@ const val inputMessageContentField = "input_message_content"
const val hideUrlField = "hide_url"
const val botCommandField = "command"
const val botCommandFullField = "bot_command"
const val botCommandsField = "commands"
const val scopeField = "scope"
const val isEphemeralField = "is_ephemeral"
const val isMemberField = "is_member"
const val isForumField = "is_forum"
@@ -556,6 +558,7 @@ const val stickerField = "sticker"
const val oldStickerField = "old_sticker"
const val keywordsField = "keywords"
const val urlField = "url"
const val linkField = "link"
const val addressField = "address"
const val actionField = "action"
const val positionField = "position"
@@ -567,6 +570,45 @@ const val payloadField = "payload"
const val vcardField = "vcard"
const val resultsField = "results"
const val resultField = "result"
const val guardBotField = "guard_bot"
const val supportsJoinRequestQueriesField = "supports_join_request_queries"
const val queryIdField = "query_id"
const val chatJoinRequestQueryIdField = "chat_join_request_query_id"
const val webAppUrlField = "web_app_url"
const val richMessageField = "rich_message"
const val isRtlField = "is_rtl"
const val skipEntityDetectionField = "skip_entity_detection"
const val markdownField = "markdown"
const val htmlField = "html"
const val unixTimeField = "unix_time"
const val dateTimeFormatField = "date_time_format"
const val alternativeTextField = "alternative_text"
const val expressionField = "expression"
const val emailAddressField = "email_address"
const val hashtagField = "hashtag"
const val cashtagField = "cashtag"
const val bankCardNumberField = "bank_card_number"
const val anchorNameField = "anchor_name"
const val referenceNameField = "reference_name"
const val blocksField = "blocks"
const val itemsField = "items"
const val summaryField = "summary"
const val sizeField = "size"
const val languageField = "language"
const val creditField = "credit"
const val cellsField = "cells"
const val isHeaderField = "is_header"
const val colspanField = "colspan"
const val rowspanField = "rowspan"
const val alignField = "align"
const val valignField = "valign"
const val zoomField = "zoom"
const val voiceNoteField = "voice_note"
const val hasCheckboxField = "has_checkbox"
const val isCheckedField = "is_checked"
const val isOpenField = "is_open"
const val isBorderedField = "is_bordered"
const val isStripedField = "is_striped"
const val certificateField = "certificate"
const val questionField = "question"
const val questionEntitiesField = "question_entities"
@@ -715,6 +757,9 @@ const val mainFrameTimestampField = "main_frame_timestamp"
const val firstProfileAudioField = "first_profile_audio"
const val paidMessageStarCountField = "paid_message_star_count"
const val senderTagField = "sender_tag"
const val receiverUserField = "receiver_user"
const val receiverUserIdField = "receiver_user_id"
const val ephemeralMessageIdField = "ephemeral_message_id"
const val countField = "count"
const val ratingField = "rating"
const val uniqueGiftColorsField = "unique_gift_colors"
@@ -901,4 +946,6 @@ const val temperatureField = "temperature"
const val backgroundColorField = "background_color"
const val keepOriginalDetailsField = "keep_original_details"
const val communityField = "community"
const val codecField = "codec"

View File

@@ -0,0 +1,16 @@
package dev.inmo.tgbotapi.types
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
@Serializable
@JvmInline
value class EphemeralMessageId(
val long: Long
) {
override fun toString(): String {
return long.toString()
}
}
fun Long.asEphemeralMessageId() = EphemeralMessageId(this)

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent
import dev.inmo.tgbotapi.types.richMessageField
import dev.inmo.tgbotapi.types.rich.InputRichMessage
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represents the content of a rich message to be sent as the result of an inline query.
*
* @see <a href="https://core.telegram.org/bots/api#inputrichmessagecontent">InputRichMessageContent</a>
*/
@Serializable
data class InputRichMessageContent(
@SerialName(richMessageField)
val richMessage: InputRichMessage
) : InputMessageContent

View File

@@ -22,6 +22,7 @@ object InputMessageContentSerializer : KSerializer<InputMessageContent> {
is InputTextMessageContent -> InputTextMessageContent.serializer().serialize(encoder, value)
is InputVenueMessageContent -> InputVenueMessageContent.serializer().serialize(encoder, value)
is InputInvoiceMessageContent -> InputInvoiceMessageContent.serializer().serialize(encoder, value)
is InputRichMessageContent -> InputRichMessageContent.serializer().serialize(encoder, value)
}
}

View File

@@ -0,0 +1,16 @@
package dev.inmo.tgbotapi.types
import dev.inmo.tgbotapi.types.media.PollMedia
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represents an HTTP link.
*
* @see <a href="https://core.telegram.org/bots/api#link">Link</a>
*/
@Serializable
data class Link(
@SerialName(urlField)
val url: String
) : PollMedia

View File

@@ -2,195 +2,351 @@ package dev.inmo.tgbotapi.types
import dev.inmo.tgbotapi.abstracts.TextedInput
import dev.inmo.tgbotapi.abstracts.WithMessageId
import dev.inmo.tgbotapi.types.chat.Bot
import dev.inmo.tgbotapi.types.chat.PreviewBot
import dev.inmo.tgbotapi.types.checklists.ChecklistTaskId
import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEphemeralMessage
import dev.inmo.tgbotapi.types.message.asTextSources
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
@ConsistentCopyVisibility
@Serializable
data class ReplyParameters internal constructor(
@SerialName(chatIdField)
val chatIdentifier: ChatIdentifier,
@SerialName(messageIdField)
override val messageId: MessageId,
@SerialName(allowSendingWithoutReplyField)
val allowSendingWithoutReply: Boolean? = null,
@SerialName(quoteField)
val quote: String? = null,
@SerialName(quoteParseModeField)
val quoteParseMode: ParseMode? = null,
@SerialName(quoteEntitiesField)
private val quoteEntities: List<RawMessageEntity>? = null,
@SerialName(quotePositionField)
val quotePosition: Int? = null,
@SerialName(checklistTaskIdField)
val checklistTaskId: ChecklistTaskId? = null,
@SerialName(pollOptionIdField)
val pollOptionId: PollOptionPersistentId? = null,
) : WithMessageId, TextedInput {
override val text: String?
get() = quote
override val textSources: List<TextSource> by lazy {
quoteEntities ?.asTextSources(quote ?: return@lazy emptyList()) ?: emptyList()
@Serializable(ReplyParameters.Serializer::class)
sealed interface ReplyParameters {
val messageId: MessageId?
val allowSendingWithoutReply: Boolean?
val checklistTaskId: ChecklistTaskId?
val pollOptionId: PollOptionPersistentId?
/**
* Reply parameters targeting a regular message identified by [messageId]. A `null` [chatIdentifier] targets a
* message in the current chat; a non-null [chatIdentifier] targets a message in a different chat. Public
* construction uses the `ReplyParameters(...)` companion factories.
*/
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@ConsistentCopyVisibility
@Serializable(ReplyParameters.Serializer::class)
data class Chat internal constructor(
val chatIdentifier: ChatIdentifier?,
override val messageId: MessageId,
override val allowSendingWithoutReply: Boolean? = null,
val quote: String? = null,
val quoteParseMode: ParseMode? = null,
internal val quoteEntities: List<RawMessageEntity>? = null,
val quotePosition: Int? = null,
override val checklistTaskId: ChecklistTaskId? = null,
override val pollOptionId: PollOptionPersistentId? = null,
) : WithMessageId, ReplyParameters, TextedInput {
override val text: String?
get() = quote
override val textSources: List<TextSource> by lazy {
quoteEntities ?.asTextSources(quote ?: return@lazy emptyList()) ?: emptyList()
}
}
constructor(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
chatIdentifier,
messageId,
allowSendingWithoutReply,
entities.makeSourceString(),
null,
entities.toRawMessageEntities(),
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
metaInfo: Message.MetaInfo,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
metaInfo.chatId,
metaInfo.messageId,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
message: Message,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
message.metaInfo,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
chatIdentifier,
messageId,
allowSendingWithoutReply,
quote,
quoteParseMode,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
metaInfo: Message.MetaInfo,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
metaInfo.chatId,
metaInfo.messageId,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
message: Message,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
message.metaInfo,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
chatIdentifier,
messageId,
allowSendingWithoutReply,
null,
null,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
metaInfo: Message.MetaInfo,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
metaInfo.chatId,
metaInfo.messageId,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
constructor(
message: Message,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
) : this(
message.metaInfo,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(ReplyParameters.Serializer::class)
/**
* Reply parameters targeting an incoming ephemeral message identified by [ephemeralMessageId]. The outgoing
* reply must also be ephemeral; chat and quote fields are unsupported for ephemeral replies. Type-neutral
* construction is available through the `ReplyParameters(...)` companion factory.
*/
data class Ephemeral(
val ephemeralMessageId: EphemeralMessageId,
override val allowSendingWithoutReply: Boolean? = null,
override val checklistTaskId: ChecklistTaskId? = null,
override val pollOptionId: PollOptionPersistentId? = null,
) : ReplyParameters {
override val messageId: MessageId? = null
}
companion object {
operator fun invoke(
ephemeralMessageId: EphemeralMessageId,
allowSendingWithoutReply: Boolean? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Ephemeral = Ephemeral(
ephemeralMessageId,
allowSendingWithoutReply,
checklistTaskId,
pollOptionId
)
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
entities.makeSourceString(),
null,
entities.toRawMessageEntities(),
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
entities: TextSourcesList,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
entities,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
quote,
quoteParseMode,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
quote: String,
quoteParseMode: ParseMode,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
quote,
quoteParseMode,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
chatIdentifier: ChatIdentifier,
messageId: MessageId,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = Chat(
chatIdentifier,
messageId,
allowSendingWithoutReply,
null,
null,
null,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
metaInfo: Message.MetaInfo,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
metaInfo.chatId,
metaInfo.messageId,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
operator fun invoke(
message: Message,
allowSendingWithoutReply: Boolean? = null,
quotePosition: Int? = null,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): Chat = invoke(
message.metaInfo,
allowSendingWithoutReply,
quotePosition,
checklistTaskId,
pollOptionId
)
}
object Serializer : KSerializer<ReplyParameters> {
@Serializable
private data class Surrogate(
@SerialName(chatIdField) val chatIdentifier: ChatIdentifier? = null,
@SerialName(messageIdField) val messageId: MessageId? = null,
@SerialName(allowSendingWithoutReplyField) val allowSendingWithoutReply: Boolean? = null,
@SerialName(quoteField) val quote: String? = null,
@SerialName(quoteParseModeField) val quoteParseMode: ParseMode? = null,
@SerialName(quoteEntitiesField) val quoteEntities: List<RawMessageEntity>? = null,
@SerialName(quotePositionField) val quotePosition: Int? = null,
@SerialName(checklistTaskIdField) val checklistTaskId: ChecklistTaskId? = null,
@SerialName(pollOptionIdField) val pollOptionId: PollOptionPersistentId? = null,
@SerialName(ephemeralMessageIdField) val ephemeralMessageId: EphemeralMessageId? = null,
)
override val descriptor: SerialDescriptor = Surrogate.serializer().descriptor
override fun deserialize(decoder: Decoder): ReplyParameters {
val surrogate = decoder.decodeSerializableValue(Surrogate.serializer())
if (surrogate.messageId != null && surrogate.ephemeralMessageId != null) {
throw SerializationException("ReplyParameters must contain either message_id or ephemeral_message_id, not both")
}
return when {
surrogate.ephemeralMessageId != null -> Ephemeral(
ephemeralMessageId = surrogate.ephemeralMessageId,
allowSendingWithoutReply = surrogate.allowSendingWithoutReply,
checklistTaskId = surrogate.checklistTaskId,
pollOptionId = surrogate.pollOptionId
)
surrogate.messageId != null -> Chat(
chatIdentifier = surrogate.chatIdentifier,
messageId = surrogate.messageId,
allowSendingWithoutReply = surrogate.allowSendingWithoutReply,
quote = surrogate.quote,
quoteParseMode = surrogate.quoteParseMode,
quoteEntities = surrogate.quoteEntities,
quotePosition = surrogate.quotePosition,
checklistTaskId = surrogate.checklistTaskId,
pollOptionId = surrogate.pollOptionId
)
else -> throw SerializationException("ReplyParameters must contain message_id or ephemeral_message_id")
}
}
override fun serialize(encoder: Encoder, value: ReplyParameters) {
val surrogate = when (value) {
is Chat -> Surrogate(
chatIdentifier = value.chatIdentifier,
messageId = value.messageId,
allowSendingWithoutReply = value.allowSendingWithoutReply,
quote = value.quote,
quoteParseMode = value.quoteParseMode,
quoteEntities = value.quoteEntities,
quotePosition = value.quotePosition,
checklistTaskId = value.checklistTaskId,
pollOptionId = value.pollOptionId
)
is Ephemeral -> Surrogate(
allowSendingWithoutReply = value.allowSendingWithoutReply,
ephemeralMessageId = value.ephemeralMessageId,
checklistTaskId = value.checklistTaskId,
pollOptionId = value.pollOptionId
)
}
encoder.encodeSerializableValue(Surrogate.serializer(), surrogate)
}
}
}
/**
* Builds [ReplyParameters.Ephemeral] with [allowSendingWithoutReply], [checklistTaskId], and [pollOptionId], targeting
* [ephemeralMessageId]. The target defaults to [PossiblyEphemeralMessage.ephemeralMessageId]; a missing target produces
* `null`.
*/
fun Message.ephemeralReplyParametersOrNull(
allowSendingWithoutReply: Boolean? = null,
ephemeralMessageId: EphemeralMessageId? = (this as? PossiblyEphemeralMessage) ?.ephemeralMessageId,
checklistTaskId: ChecklistTaskId? = null,
pollOptionId: PollOptionPersistentId? = null,
): ReplyParameters? =
ephemeralMessageId ?.let {
ReplyParameters(
ephemeralMessageId = it,
allowSendingWithoutReply = allowSendingWithoutReply,
checklistTaskId = checklistTaskId,
pollOptionId = pollOptionId,
)
}
/**
* Returns the receiver [UserId] for an ephemeral reply: [PossiblyEphemeralMessage.receiverUser] when available,
* otherwise [OptionallyFromUserMessage.from]; returns `null` for a non-ephemeral message.
*/
val Message.ephemeralReplyReceiverUserIdOrNull: UserId?
get() = (this as? PossiblyEphemeralMessage) ?.takeIf { it.ephemeralMessageId != null } ?.let {
val receiverUser = it.receiverUser
val thisAsOptionallyFromUserMessage = this as? OptionallyFromUserMessage
val from = thisAsOptionallyFromUserMessage ?.from
when {
receiverUser != null && receiverUser !is PreviewBot && from !is Bot -> receiverUser.id
from != null && from !is PreviewBot && from !is Bot -> from.id
else -> null
}
}

View File

@@ -28,6 +28,8 @@ const val UPDATE_GUEST_MESSAGE = "guest_message"
const val UPDATE_MANAGED_BOT = "managed_bot"
const val UPDATE_SUBSCRIPTION = "subscription"
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
UPDATE_MESSAGE,
UPDATE_EDITED_MESSAGE,
@@ -65,6 +67,8 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
UPDATE_REMOVE_CHAT_BOOST,
UPDATE_MANAGED_BOT,
UPDATE_SUBSCRIPTION,
)
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(

View File

@@ -24,7 +24,9 @@ data class ChatJoinRequest(
@SerialName(inviteLinkField)
val inviteLink: ChatInviteLink? = null,
@SerialName(bioField)
val bio: String? = null
val bio: String? = null,
@SerialName(queryIdField)
val queryId: ChatJoinRequestQueryId? = null
) : FromUser {
@Suppress("unused")
val dateTime: DateTime

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.communities.Community
import dev.inmo.tgbotapi.types.files.AudioFile
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
import dev.inmo.tgbotapi.types.gifts.unique.UniqueGiftColors
@@ -69,7 +70,11 @@ data class ExtendedChannelChatImpl(
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(guardBotField)
override val guardBot: User? = null,
@SerialName(communityField)
override val community: Community? = null
) : ExtendedChannelChat
@Serializable
@@ -116,7 +121,11 @@ data class ExtendedGroupChatImpl(
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(guardBotField)
override val guardBot: User? = null,
@SerialName(communityField)
override val community: Community? = null
) : ExtendedGroupChat
@Serializable
@@ -316,7 +325,11 @@ data class ExtendedSupergroupChatImpl(
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(guardBotField)
override val guardBot: User? = null,
@SerialName(communityField)
override val community: Community? = null
) : ExtendedSupergroupChat
@Serializable
@@ -390,7 +403,11 @@ data class ExtendedForumChatImpl(
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(guardBotField)
override val guardBot: User? = null,
@SerialName(communityField)
override val community: Community? = null
) : ExtendedForumChat
@Serializable
@@ -467,7 +484,11 @@ data class ExtendedChannelDirectMessagesChatImpl(
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(guardBotField)
override val guardBot: User? = null,
@SerialName(communityField)
override val community: Community? = null
) : ExtendedChannelDirectMessagesChat {
@OptIn(ExperimentalSerializationApi::class)
@SerialName(isDirectMessagesField)
@@ -495,6 +516,8 @@ data class ExtendedBot(
val supportsInlineQueries: Boolean = false,
@SerialName(supportsGuestQueriesField)
val supportsGuestQueries: Boolean = false,
@SerialName(supportsJoinRequestQueriesField)
val supportsJoinRequestQueries: Boolean = false,
@SerialName(canConnectToBusinessField)
val canConnectToBusiness: Boolean = false,
@SerialName(photoField)
@@ -521,6 +544,8 @@ data class ExtendedBot(
override val uniqueGiftColors: UniqueGiftColors? = null,
@SerialName(canManageBotsField)
val canManageBots: Boolean = false,
@SerialName(communityField)
override val community: Community? = null,
) : Bot(), ExtendedChat {
@SerialName(isBotField)
private val isBot = true

View File

@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.communities.Community
import dev.inmo.tgbotapi.types.files.AudioFile
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
import dev.inmo.tgbotapi.types.gifts.unique.UniqueGiftColors
@@ -27,6 +28,22 @@ sealed interface ExtendedChat : Chat {
val uniqueGiftColors: UniqueGiftColors?
/**
* The bot that processes join request queries in the chat. The field is only available to chat administrators.
*
* @see <a href="https://core.telegram.org/bots/api#chatfullinfo">ChatFullInfo.guard_bot</a>
*/
val guardBot: User?
get() = null
/**
* The Community to which the chat belongs
*
* @see <a href="https://core.telegram.org/bots/api#chatfullinfo">ChatFullInfo.community</a>
*/
val community: Community?
get() = null
@Deprecated(
message = "Telegram Bot API v9.0 introduced the new field, `acceptedGiftTypes`, to allow granular" +
" control over which types of gifts user, bot, or chat can accept.",

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.types.communities
import dev.inmo.tgbotapi.types.idField
import dev.inmo.tgbotapi.types.nameField
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represents a community (a group of chats)
*/
@Serializable
data class Community(
@SerialName(idField)
val id: CommunityId,
@SerialName(nameField)
val name: String
)

View File

@@ -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 added to a community
*/
@Serializable
data class CommunityChatAdded(
@SerialName(communityField)
val community: Community
) : CommonEvent

View File

@@ -0,0 +1,10 @@
package dev.inmo.tgbotapi.types.communities
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
import kotlinx.serialization.Serializable
/**
* Service message about a chat being removed from a community. Currently holds no information
*/
@Serializable
object CommunityChatRemoved : CommonEvent

View File

@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.types.communities
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
@Serializable
@JvmInline
value class CommunityId(
val long: Long
) {
override fun toString(): String {
return long.toString()
}
}

View File

@@ -27,6 +27,7 @@ object InputPollOptionMediaSerializer : KSerializer<InputPollOptionMedia> {
override fun serialize(encoder: Encoder, value: InputPollOptionMedia) {
when (value) {
is TelegramMediaAnimation -> TelegramMediaAnimation.serializer().serialize(encoder, value)
is TelegramMediaLink -> TelegramMediaLink.serializer().serialize(encoder, value)
is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaLocation -> TelegramMediaLocation.serializer().serialize(encoder, value)
is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value)

View File

@@ -10,6 +10,8 @@ import dev.inmo.tgbotapi.types.files.LivePhotoFile
import dev.inmo.tgbotapi.types.files.PhotoFile
import dev.inmo.tgbotapi.types.files.Sticker
import dev.inmo.tgbotapi.types.files.VideoFile
import dev.inmo.tgbotapi.types.Link
import dev.inmo.tgbotapi.types.linkField
import dev.inmo.tgbotapi.types.livePhotoField
import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.locationField
@@ -36,6 +38,8 @@ interface PollMedia : BaseTelegramMediaFile {
val audio: AudioFile? = null,
@SerialName(documentField)
val document: DocumentFile? = null,
@SerialName(linkField)
val link: Link? = null,
@SerialName(livePhotoField)
val livePhoto: LivePhotoFile? = null,
@SerialName(photoField)
@@ -61,6 +65,7 @@ interface PollMedia : BaseTelegramMediaFile {
surrogate.animation != null -> surrogate.animation
surrogate.audio != null -> surrogate.audio
surrogate.document != null -> surrogate.document
surrogate.link != null -> surrogate.link
surrogate.livePhoto != null -> surrogate.livePhoto
surrogate.photo != null -> surrogate.photo
surrogate.sticker != null -> surrogate.sticker
@@ -76,6 +81,7 @@ interface PollMedia : BaseTelegramMediaFile {
animation = value as? AnimationFile,
audio = value as? AudioFile,
document = value as? DocumentFile,
link = value as? Link,
livePhoto = value as? LivePhotoFile,
photo = value as? PhotoFile,
sticker = value as? Sticker,

Some files were not shown because too many files have changed in this diff Show More