Compare commits

...
547 Commits
Author SHA1 Message Date
InsanusMokrassar 4d433b96c8 retarget release to 37.1.0 2026-10-11 00:43:51 +06:00
InsanusMokrassar 8f4423f55e match changelog style 2026-10-10 20:25:55 +06:00
InsanusMokrassar c002fa6b80 match changelog style 2026-10-10 20:20:16 +06:00
InsanusMokrassar 4c01943367 restore gradle wrapper scripts 2026-10-10 20:05:07 +06:00
InsanusMokrassar 246a347f79 update dependencies 2026-10-10 16:57:28 +06:00
InsanusMokrassar 27da9eec5e start 38.0.0 2026-10-10 14:28:59 +06:00
InsanusMokrassar 8d454f8c1c Merge pull request #1060 from InsanusMokrassar/37.0.0
37.0.0
2026-10-08 20:42:56 +06:00
InsanusMokrassar aa93697780 small fixes 2026-10-08 14:30:38 +06:00
InsanusMokrassar b3ad61e7c4 fix of date time format 2026-09-20 23:11:58 +06:00
InsanusMokrassar 1d8b4255a6 fixes 2026-09-08 18:04:06 +06:00
InsanusMokrassar c2f0bcd98b refactor(core): tighten draft and chat contracts 2026-09-07 00:59:22 +06:00
InsanusMokrassar 4a9d6b7b56 docs(agents): keep local history file uncommitted by default 2026-09-07 00:59:12 +06:00
InsanusMokrassar b1304ef10d feat(api)!: use direct message threads for drafts
BREAKING CHANGE: draft APIs replace threadId/MessageThreadId with
directMessageThreadId/DirectMessageThreadId and serialize
direct_messages_topic_id.
2026-09-01 22:42:58 +06:00
InsanusMokrassar 3ca3e571b5 feat(api)!: widen rich draft chat identifier
BREAKING CHANGE: SendRichMessageDraft, sendRichMessageDraft, and the rich-draft send overload now accept IdChatIdentifier. Existing ChatId source calls remain valid; JVM signatures changed.
2026-09-01 19:14:29 +06:00
InsanusMokrassar af09ef4c29 feat(api)!: keep raw ephemeral send overloads
Keep receiverUserId and callbackQueryId overloads as non-deprecated API
alternatives while forwarding callback-message replacement through
EphemeralMessageParameters.

BREAKING CHANGE: raw send overloads gain replaceCallbackQueryMessage
after callbackQueryId, changing positional binding and JVM signatures.
2026-09-01 18:38:44 +06:00
InsanusMokrassar d43de9623d Restore deprecated send overload compatibility 2026-08-26 17:58:51 +06:00
InsanusMokrassar 0cac885dfc small refactoring 2026-08-26 16:29:46 +06:00
InsanusMokrassar 9fcb267ee2 Regenerate API after Bot API 10.3 audit 2026-08-26 15:28:12 +06:00
InsanusMokrassar 3bdfdb57b5 Document Bot API 10.3 coverage audit 2026-08-26 15:27:50 +06:00
InsanusMokrassar f4a41c047d Preserve UniqueGiftInfo constructor compatibility 2026-08-26 15:27:30 +06:00
InsanusMokrassar f8e70c5cc7 Complete Bot API 10.3 ephemeral media support 2026-08-26 15:27:04 +06:00
InsanusMokrassar d972cc5b8d Fix Bot API 10.3 rich message contracts 2026-08-26 15:26:40 +06:00
InsanusMokrassar 61c4e7af17 Document enumerable sealed-interface rule 2026-08-26 14:32:44 +06:00
InsanusMokrassar 93a4bf1da0 Add Bot API 10.3 General support 2026-08-25 14:02:46 +06:00
InsanusMokrassar f86bb6662e Add Bot API 10.3 Ephemeral messages support 2026-08-25 14:02:46 +06:00
InsanusMokrassar 2e69bc6954 Add Bot API 10.3 Rich Messages support 2026-08-25 14:02:46 +06:00
InsanusMokrassar efd4667ffa Add Bot API 10.3 Reply markup support 2026-08-25 12:33:45 +06:00
InsanusMokrassar 752689447b start 37.0.0 2026-08-25 12:00:37 +06:00
InsanusMokrassar 1ec5e02e0a Merge pull request #1059 from InsanusMokrassar/36.1.0
36.1.0
2026-08-22 01:13:55 +06:00
InsanusMokrassar b23ec8bc01 Fix version number in CHANGELOG.md 2026-08-22 01:13:38 +06:00
InsanusMokrassar 78e1acc260 Fix microutils version format in libs.versions.toml 2026-08-21 20:12:49 +06:00
InsanusMokrassar 36e38f2b01 update dependencies 2026-08-21 18:34:15 +06:00
InsanusMokrassar 05d6927852 start 36.1.0 2026-08-21 17:37:58 +06:00
InsanusMokrassar e793159400 Merge pull request #1056 from InsanusMokrassar/36.0.0
36.0.0
2026-08-21 15:51:27 +06:00
InsanusMokrassar 0eaaded6e4 removed codex folder -.- 2026-08-21 13:02:44 +06:00
InsanusMokrassar 642306c835 update changelog 2026-08-21 12:55:00 +06:00
InsanusMokrassar 5f115b6e3d remove sol report 2026-08-21 12:22:25 +06:00
InsanusMokrassar 5755724569 improvements in rich messages 2026-08-17 23:30:37 +06:00
InsanusMokrassar 8bee8982bb improvements in rich messages 2026-08-17 17:35:03 +06:00
InsanusMokrassar 5b6fe8eb96 improve InputRichBlocksTable 2026-08-17 10:46:18 +06:00
InsanusMokrassar f9c634ca46 improvements 2026-08-16 23:42:11 +06:00
InsanusMokrassar b913f66b1e fixes 2026-08-15 14:22:35 +06:00
InsanusMokrassar 6fbe2e5649 improve replies with ephemeral 2026-08-15 00:15:12 +06:00
InsanusMokrassar 8b0e0bf820 fix of Replyparameters calls 2026-08-14 20:16:47 +06:00
InsanusMokrassar 4f19cb7626 improvemens? 2026-08-13 17:51:33 +06:00
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassar 0b3a5bb0af start 36.0.0 2026-07-18 18:31:03 +06:00
InsanusMokrassar c7761fd294 Merge pull request #1053 from InsanusMokrassar/35.1.0
35.1.0
2026-07-01 18:01:07 +06:00
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassar 763b07fc3c start 35.1.0 2026-07-01 16:08:25 +06:00
InsanusMokrassar 481a3b4ff1 Merge pull request #1052 from InsanusMokrassar/35.0.0
35.0.0
2026-07-01 15:43:02 +06:00
InsanusMokrassar fc764d1f95 add note about support of telegram bot api 10.1 and fix changelogs 2026-07-01 15:42:11 +06:00
InsanusMokrassar 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
InsanusMokrassar 5341b2eccf apiDump 2026-07-01 13:27:09 +06:00
InsanusMokrassar 7e4efcd645 rewrite RichMessageContent.createResend onto sending of simple rich message 2026-07-01 12:52:55 +06:00
InsanusMokrassar 390770ca80 refactor/fixes in rich parts 2026-07-01 12:46:16 +06:00
InsanusMokrassar b054f3d1b5 Revert "Modify markdown function to add newlines"
This reverts commit 3a05a88d4f.
2026-07-01 11:25:43 +06:00
InsanusMokrassar 3a05a88d4f Modify markdown function to add newlines 2026-07-01 01:16:36 +06:00
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassar 313fcb3325 fix of sendrichmessagedraft 2026-06-29 23:37:14 +06:00
InsanusMokrassar 1c06ec8687 apiDump 2026-06-29 17:04:03 +06:00
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassarandClaude Opus 4.8 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
InsanusMokrassar 8ba13ea5fc start 35.0.0 2026-06-19 16:27:54 +06:00
InsanusMokrassar b8e995f36d Merge pull request #1047 from InsanusMokrassar/34.0.0
34.0.0
2026-06-13 14:34:21 +06:00
InsanusMokrassar fa73f34182 Merge branch 'master' into 34.0.0 2026-06-13 14:08:47 +06:00
InsanusMokrassar db0e839d2f Merge pull request #1049 from InsanusMokrassar/33.2.0
33.2.0
2026-06-13 13:54:56 +06:00
InsanusMokrassar 7b28c0f068 fill changelog 2026-06-13 13:54:35 +06:00
InsanusMokrassar f4c50caf1e add supporting of telegram bots api note 2026-06-13 13:51:43 +06:00
InsanusMokrassar 7e45f84b78 small update of changelog 2026-06-13 00:24:55 +06:00
InsanusMokrassar 1603f4dae4 small note about migration 2026-06-06 13:17:01 +06:00
InsanusMokrassar a9f27b4417 ksp + apiDump 2026-06-06 13:02:04 +06:00
InsanusMokrassar b39b5f376e small improvement in message hierarchy 2026-05-30 18:56:27 +06:00
InsanusMokrassar df77c65c86 rework of guest answers messages 2026-05-30 15:09:19 +06:00
InsanusMokrassar 1f2b3b9464 guest message answers rework 2026-05-30 12:49:54 +06:00
InsanusMokrassar 643133a87b add api exception (solution of #1048) + add classcasts for exceptions 2026-05-28 19:05:53 +06:00
InsanusMokrassar cd56c7e257 rename functions names in NewRequestExceptionTests 2026-05-28 18:38:35 +06:00
InsanusMokrassar 03921092a4 Merge pull request #1042 from Dramex/fix/1008-too-many-requests-case-insensitive
Detect Too Many Requests case-insensitively (closes #1008)
2026-05-28 18:36:54 +06:00
InsanusMokrassar 4a09a6372e start 33.2.0 2026-05-28 18:25:55 +06:00
InsanusMokrassar fdd21f3cbd fixes in guest mode 2026-05-23 00:02:16 +06:00
InsanusMokrassar eacf01a158 api dump 2026-05-20 18:03:19 +06:00
InsanusMokrassar dd35631345 fix checking of text length in SendMessageDraft 2026-05-20 17:59:46 +06:00
InsanusMokrassar 631a4f16bd implement 'others' changes 2026-05-19 23:25:15 +06:00
InsanusMokrassar 236939eab8 implement guest mode and make HUGE CHANGES IN MESSAGES HIERARCHY 2026-05-17 23:20:10 +06:00
InsanusMokrassar d47641c39a add LivePhotos support 2026-05-17 16:43:18 +06:00
InsanusMokrassar f3f28b6165 fixes of hierarchy and build 2026-05-17 14:53:49 +06:00
InsanusMokrassar 08d160cfa7 add Polls updates 2026-05-16 16:59:40 +06:00
InsanusMokrassar 3ed7c8c75f Chat Management section realization 2026-05-15 18:10:30 +06:00
InsanusMokrassar 7e1df37b87 start 34.0.0 2026-05-15 00:27:33 +06:00
InsanusMokrassar 97b7b3d5d7 Merge pull request #1043 from InsanusMokrassar/33.1.0
33.1.0
2026-04-19 13:26:44 +06:00
InsanusMokrassar 62b4bc15ca remove kotlinpoet from changelog 2026-04-19 12:58:27 +06:00
InsanusMokrassar 7c2ce53713 fix changelog style 2026-04-19 12:56:22 +06:00
InsanusMokrassar 035c8f469a update dependencies
dev.inmo:micro_utils 0.29.1 -> 0.29.2
dev.inmo:kslog 1.6.0 -> 1.6.1
com.squareup:kotlinpoet-ksp 2.2.0 -> 2.3.0
io.ktor:ktor-* 3.4.1 -> 3.4.2
org.jetbrains.kotlinx:kotlinx-serialization-* 1.10.0 -> 1.11.0
org.jetbrains.kotlin:kotlin-* 2.3.10 -> 2.3.20
2026-04-19 12:48:40 +06:00
InsanusMokrassar c982eef85b start 33.1.0 2026-04-19 12:18:46 +06:00
emad 4500711db4 Detect Too Many Requests descriptions case-insensitively
Telegram has been observed to return both "Bad Request: Too Many
Requests: retry after N" and "Bad Request: too Many Requests: retry
after N" (lowercase leading 't'). The current case-sensitive check
silently misses the latter and the caller never sees a
TooMuchRequestsException.

Added `ignoreCase = true` to the contains(...) check and three
regression tests covering canonical, lowercase-initial, and
all-lowercase casings.

Closes #1008
2026-04-19 03:24:16 +03:00
InsanusMokrassar 16e94a1e1b Merge pull request #1038 from InsanusMokrassar/33.0.0
33.0.0
2026-04-16 17:43:38 +06:00
InsanusMokrassar 96a5508e9a refill changelog 2026-04-16 13:05:29 +06:00
InsanusMokrassar 83de9fd973 fix name of allowMultipleAnswers to allowsMultipleAnswers 2026-04-16 13:02:10 +06:00
InsanusMokrassar 4a0b890697 fill CHANGELOG.md, fix README.md, small fix in checkSendData to not throw error 2026-04-16 12:39:26 +06:00
InsanusMokrassar 0e481c3dd9 fix of custom emoji icons passing in setParams of WebApp and rewrite init errors to warnings in SendQuizPoll 2026-04-15 16:13:37 +06:00
InsanusMokrassar 176d0d419a fix hierarchy of ManagedBotUpdated 2026-04-14 19:59:52 +06:00
InsanusMokrassar 77bf7b6e89 fix of onManagedBotUpdated work 2026-04-14 19:50:54 +06:00
InsanusMokrassar 5337f8c7cc fix of username encoding in KeyboardButtonRequestManagedBot 2026-04-14 17:26:37 +06:00
InsanusMokrassar 57fa6fd597 add note about isAnonymous with allowAddingOptions 2026-04-13 15:45:25 +06:00
InsanusMokrassar 703538a6fa continue fix of fields absence 2026-04-13 14:49:48 +06:00
InsanusMokrassar 08877a8f47 continue fixing missing parts 2026-04-09 13:10:14 +06:00
InsanusMokrassar 8d3338b79a add support of pollOptionId in ReplyParameters and reply_to_poll_option_id 2026-04-08 19:02:25 +06:00
InsanusMokrassar 243a3ca626 add support of PollOptionAdded and PolloptionDeleted 2026-04-08 18:10:39 +06:00
InsanusMokrassar 277c329ab9 several calls fix 2026-04-07 23:44:13 +06:00
InsanusMokrassar e3ae85e067 Actualize PollAnswer 2026-04-07 00:23:31 +06:00
InsanusMokrassar ac51189694 reimplementation of PollOption and SendPoll 2026-04-07 00:16:04 +06:00
InsanusMokrassar cfd74eb58c add PollOptionPersistentId 2026-04-06 23:30:11 +06:00
InsanusMokrassar 78c476e4c6 add support of QuizPoll#correctOptionIds 2026-04-06 18:46:08 +06:00
InsanusMokrassar a5446b5adb add support of managed bots creation link 2026-04-06 16:32:26 +06:00
InsanusMokrassar 4b5aad2b85 add support of requestChat 2026-04-06 16:13:29 +06:00
InsanusMokrassar a0e748f9a9 add support of PreparedKeyboardButton and savePreparedKeyboardButton 2026-04-06 16:11:46 +06:00
InsanusMokrassar de13ddeb54 complete support of ManagedBotCreated and ManagedBotUpdated, add getManagedBotToken and replaceManagedBotToken 2026-04-06 15:47:38 +06:00
InsanusMokrassar b37dda6f47 add ManagedBotCreated and ManagedBotUpdated 2026-04-06 00:42:16 +06:00
InsanusMokrassar e604b7a3bf add support of KeyboardButtonRequestManagedBot 2026-04-05 21:28:10 +06:00
InsanusMokrassar 661b846a74 add support of canManageBots 2026-04-05 17:38:50 +06:00
InsanusMokrassar ce44203941 start 33.0.0 2026-04-05 17:38:20 +06:00
InsanusMokrassar ba65e01c84 Merge pull request #1033 from InsanusMokrassar/32.0.0
32.0.0
2026-03-08 15:10:48 +06:00
InsanusMokrassar 2a1bd229d6 partial replace of require with warning messages 2026-03-06 19:09:45 +06:00
InsanusMokrassar b30af48b8d improve readability of SetBusinessAccountUsername and fix its api 2026-03-06 18:44:35 +06:00
InsanusMokrassar 083fd1b682 returned boolean now returns unit 2026-03-06 00:39:54 +06:00
InsanusMokrassar a8410df038 fill changelog 2026-03-05 21:56:04 +06:00
InsanusMokrassar bd7e8ed55f update dependencies 2026-03-05 21:38:05 +06:00
InsanusMokrassar 8c6408bc2b start 32.0.0 2026-03-05 19:27:23 +06:00
InsanusMokrassar e5d18a421f Merge pull request #1032 from InsanusMokrassar/31.2.0
31.2.0
2026-03-04 19:38:06 +06:00
InsanusMokrassar d3c1859338 fix of #1027 and small fix of changelog for #1026 2026-03-03 17:55:40 +06:00
InsanusMokrassar e6d6bbdaa0 fix of #1026 2026-03-03 17:47:45 +06:00
InsanusMokrassar 75a977aebb start 31.2.0 2026-03-03 16:07:35 +06:00
InsanusMokrassar f48eb820bf Merge pull request #1031 from InsanusMokrassar/31.1.0
31.1.0
2026-03-02 19:22:43 +06:00
InsanusMokrassar 9f9d890831 fix of promoteChatAdministrator 2026-03-02 19:05:38 +06:00
InsanusMokrassar da662603b0 fill changelog and readme 2026-03-02 18:50:51 +06:00
InsanusMokrassar 2dd91f47d7 add helper method sender_tag for messages 2026-03-02 17:40:47 +06:00
InsanusMokrassar 8eb8e5ee1f add support of iconCustomEmojiId in BottomButton 2026-03-02 16:56:57 +06:00
InsanusMokrassar b533bab95f add support of users tags 2026-03-02 16:51:10 +06:00
InsanusMokrassar 4f97327d29 add support of date_time messages entities 2026-03-02 15:29:26 +06:00
InsanusMokrassar b17d7a868a start 31.1.0 2026-03-02 00:30:37 +06:00
InsanusMokrassar df695ceadb Merge pull request #1030 from InsanusMokrassar/31.0.1
31.0.1
2026-02-26 00:54:42 +06:00
InsanusMokrassar ac511d0aed make nanostarAmount in StarTransaction nullable 2026-02-25 22:10:19 +06:00
InsanusMokrassar 65cd359002 start 31.0.1 2026-02-25 22:01:55 +06:00
InsanusMokrassar 8d7005be80 try to update nmcp version 2026-02-24 18:24:39 +06:00
InsanusMokrassar a20368ee51 Merge pull request #1024 from InsanusMokrassar/31.0.0
31.0.0
2026-02-24 15:07:59 +06:00
InsanusMokrassar 744149a674 fill changelog 2026-02-24 15:02:25 +06:00
InsanusMokrassar 410183e315 add notes about support of new apis 2026-02-24 14:37:50 +06:00
InsanusMokrassar 9776a2474a fix of UniqueGiftModel 2026-02-24 14:09:49 +06:00
InsanusMokrassar aebc571307 upfill changelog 2026-02-24 14:02:37 +06:00
InsanusMokrassar 26c11d9d6b add OwnedGifts sealed interface 2026-02-24 12:37:07 +06:00
InsanusMokrassar c9be5041b8 check new fields and other things related to api updates in gifts 2026-02-20 17:49:16 +06:00
InsanusMokrassar f10cfdbe1e add support of getChatGifts and getUserGifts 2026-02-20 17:05:51 +06:00
InsanusMokrassar 83b4d2155f add is_burned support 2026-02-20 13:55:19 +06:00
InsanusMokrassar eccc687aec add rarity support 2026-02-20 13:06:53 +06:00
InsanusMokrassar 53e79b152e add support of unique gift colors 2026-02-20 12:54:21 +06:00
InsanusMokrassar b9157b1924 completed by chat and completed by user support 2026-02-20 12:45:34 +06:00
InsanusMokrassar e6aaa264f6 improvements of effectId in copyMessage and forwardMessage 2026-02-18 23:37:18 +06:00
InsanusMokrassar e6cb028a71 improve repostStory 2026-02-18 22:55:38 +06:00
InsanusMokrassar 10b796c88e fix support of rating info 2026-02-18 22:46:56 +06:00
InsanusMokrassar 62a4bf5195 small fill of CHANGELOG and fix of library version 2026-02-18 22:23:42 +06:00
InsanusMokrassar a0bb05ce4a add support of profile audios 2026-02-18 21:22:16 +06:00
InsanusMokrassar e02849ae5e add purchased_paid_media in updates list 2026-02-18 17:52:26 +06:00
InsanusMokrassar 4252db489a fix support of paid_message_star_count 2026-02-18 17:18:38 +06:00
InsanusMokrassar ac05fa0fe3 add support of SetMyProfilePhoto and RemoveMyProfilePhoto 2026-02-17 22:05:38 +06:00
InsanusMokrassar bd816b7847 realize ChatOwnerLeft and ChatOwnerChanged 2026-02-17 15:30:25 +06:00
InsanusMokrassar 407f2a8bf7 fix serialization of simple keyboard button 2026-02-17 12:09:23 +06:00
InsanusMokrassar 10b1c359fa extend support of styles and iconEmojiCustomId 2026-02-16 23:22:04 +06:00
InsanusMokrassar c4f2566b71 add support of style and iconEmojiCustomId 2026-02-16 22:57:45 +06:00
InsanusMokrassar 85fb7e42e5 fix RepostStory class 2026-02-16 22:39:18 +06:00
InsanusMokrassar d68c70e898 fix drafts flows signatures 2026-02-16 18:52:41 +06:00
InsanusMokrassar 14402f9283 improve drafts flows 2026-02-16 18:48:31 +06:00
InsanusMokrassar b734757062 add drafts flows 2026-02-16 18:24:29 +06:00
InsanusMokrassar fd9ad8dbf1 add drafts 2026-02-16 18:03:05 +06:00
InsanusMokrassar 734e6074ef update events triggers 2026-02-16 17:35:46 +06:00
InsanusMokrassar d642a04e01 update forum events 2026-02-16 17:26:35 +06:00
InsanusMokrassar ecd01c9254 classcasts and apiDump 2026-02-16 17:14:28 +06:00
InsanusMokrassar 8922b80cff fixes 2026-02-16 17:09:48 +06:00
InsanusMokrassar 50a7c9cae2 update forum topic events 2026-02-16 17:08:49 +06:00
InsanusMokrassar f7ee0828ce small improvements 2026-02-16 15:05:37 +06:00
InsanusMokrassar 0c87cf95eb improvements(?) in users api 2026-02-16 15:04:33 +06:00
InsanusMokrassar 9fea7390e8 add support of extended chat id in private chats 2026-02-15 23:51:39 +06:00
InsanusMokrassar 9f0ca8143c update microutils 2026-02-15 21:03:28 +06:00
InsanusMokrassar 9d879b90bb fix user rating 2026-02-15 15:14:18 +06:00
InsanusMokrassar 2a28f8ab39 fixes in common bot hierarchy 2026-02-15 14:47:47 +06:00
InsanusMokrassar 44ce84cb84 fixes? 2026-02-15 13:53:41 +06:00
InsanusMokrassar cea80ccee6 preview version of threads in privats 2026-02-15 13:22:17 +06:00
InsanusMokrassar e1848aa5c9 fix of hasTopicsEnabled and add support of allows_users_to_create_topics 2026-02-15 13:14:18 +06:00
InsanusMokrassar e40424b26a some additions(need to check all this commit) 2026-02-10 16:02:28 +06:00
InsanusMokrassar cc5056b685 make chats to support private forums 2026-01-07 23:19:12 +06:00
InsanusMokrassar 9713a668e2 start 31.0.0 2026-01-07 20:45:29 +06:00
InsanusMokrassar 90d7bdff56 Merge pull request #1020 from InsanusMokrassar/30.0.2
30.0.2
2025-11-23 17:44:13 +06:00
InsanusMokrassar 374f6a93bd hotifx of changelog 2025-11-23 17:43:58 +06:00
InsanusMokrassar 28b5fae760 fix of #1019 and improve longPollingFlow 2025-11-23 17:35:59 +06:00
InsanusMokrassar 97dae295d6 update dependencies 2025-11-23 16:55:54 +06:00
InsanusMokrassar 93597f3940 start 30.0.2 2025-11-23 14:25:58 +06:00
InsanusMokrassar f27caaecde Merge pull request #1014 from InsanusMokrassar/30.0.1
30.0.1
2025-11-07 14:58:22 +06:00
InsanusMokrassar b71b1414b9 fix of target version 2025-10-22 01:52:00 +06:00
InsanusMokrassar f8ceab7640 small hotfix 2025-10-22 01:51:20 +06:00
InsanusMokrassar 68897c89c3 start 30.0.1 2025-10-21 23:27:43 +06:00
InsanusMokrassar fb08b7044e Merge pull request #1012 from InsanusMokrassar/30.0.0
30.0.0
2025-10-21 22:25:26 +06:00
InsanusMokrassar 7ed021b5bc fill changelog 2025-10-21 22:24:58 +06:00
InsanusMokrassar 1cff533265 update dependencies and fix (?) build 2025-10-20 22:44:16 +06:00
InsanusMokrassar 8b08e11441 migrate onto 30.0.0 2025-10-20 21:21:31 +06:00
InsanusMokrassar b69c8f1d8f update dependencies
com.github.ben-manes.versions: 0.52.0 -> 0.53.0
2025-10-19 23:33:10 +06:00
InsanusMokrassar fdf393405c start 29.1.0 2025-10-19 22:57:12 +06:00
InsanusMokrassar c951fc3353 Merge pull request #1010 from InsanusMokrassar/29.0.1
29.0.1
2025-10-13 23:10:42 +06:00
InsanusMokrassar 02f42c3f52 fix of name for publishing in nexus 2025-10-12 21:46:35 +06:00
InsanusMokrassar 0105e46a5f apiDump 2025-10-12 21:22:34 +06:00
InsanusMokrassar 325a189ebb fix of #917 2025-10-12 21:09:38 +06:00
InsanusMokrassar 1d021c8450 start 29.0.1 2025-10-12 21:07:55 +06:00
InsanusMokrassar 6eb9379e0a Merge pull request #998 from InsanusMokrassar/29.0.0
29.0.0
2025-09-25 15:07:02 +06:00
InsanusMokrassar 2d97d10ee1 fill changelog and readme 2025-09-25 14:25:22 +06:00
InsanusMokrassar 4b7d052ece rewrite firstOf 2025-09-25 14:25:08 +06:00
InsanusMokrassar df512a917b Merge branch 'master' into 29.0.0 2025-09-23 18:21:13 +06:00
InsanusMokrassar 67cd836466 Merge pull request #1005 from InsanusMokrassar/28.0.3
28.0.3
2025-09-23 18:17:11 +06:00
InsanusMokrassar eb1fb16117 add support of custom publishing type 2025-09-23 18:13:04 +06:00
InsanusMokrassar ee4cf7c626 add passing of default engines in HttpClient constructors 2025-09-23 17:53:21 +06:00
InsanusMokrassar 74d8b31437 start 28.0.3 2025-09-23 17:46:54 +06:00
InsanusMokrassar 3f61cfdefb fix of paid message building 2025-09-23 16:12:40 +06:00
InsanusMokrassar 91339fc839 rewrite firstof 2025-09-23 13:37:59 +06:00
InsanusMokrassar 2e23f48350 fixes in CommonChannelDirectMessagesEventMessage creating 2025-09-23 12:47:58 +06:00
InsanusMokrassar f6211d33bb change events hierarchy of ChannelDirectMessagesEvent 2025-09-23 12:16:30 +06:00
InsanusMokrassar 2ff11ad73c improve messages hierarchy 2025-09-22 12:19:34 +06:00
InsanusMokrassar 2695b03968 fix of direct message typing 2025-09-17 23:31:08 +06:00
InsanusMokrassar 03d23a938e fixes of inheritance of messages for direct ones 2025-09-17 22:46:51 +06:00
InsanusMokrassar 719fb1f4a9 complete adding of suggestedPostParameters 2025-09-17 20:21:55 +06:00
InsanusMokrassar c3c69f3e7f some step 2025-09-17 16:30:41 +06:00
InsanusMokrassar 4fb662c560 third stage of suggested_post_parameters implementation 2025-09-15 18:14:51 +06:00
InsanusMokrassar cc967c2981 add suggestedPostParameters in contents 2025-09-15 17:53:59 +06:00
InsanusMokrassar aa7bf426f1 second stage of suggested_post_parameters implementation 2025-09-15 17:49:33 +06:00
InsanusMokrassar 0b2735ca1e add support of suggestedPostParameters in requests 2025-09-15 16:46:44 +06:00
InsanusMokrassar 48bfa76b9e implemented direct message thread id????? 2025-09-15 12:32:35 +06:00
InsanusMokrassar 79a0e202d8 fix of directMessageThreadId passes 2025-09-15 12:32:35 +06:00
InsanusMokrassar 152bf2af02 fix of apiDump 2025-09-15 12:32:35 +06:00
InsanusMokrassar 0163e5ce8c fix of apiDump 2025-09-15 00:32:25 +06:00
InsanusMokrassar 62b4a21650 some progress on support of directMessageThreadId 2025-09-15 00:12:53 +06:00
InsanusMokrassar f312e04c0d add directMessageThreadId parameter in create resend 2025-09-14 23:19:54 +06:00
InsanusMokrassar 1c36c0a2f7 add directMessageThreadId in factories of sending classes 2025-09-14 15:14:38 +06:00
InsanusMokrassar bd73852253 let forwardMessage(s) extend OptionallyDirectMessageThreadRequest 2025-09-14 14:48:20 +06:00
InsanusMokrassar fbb2511fca Merge branch 'master' into 29.0.0 2025-09-14 14:43:49 +06:00
InsanusMokrassar f22d571484 Merge pull request #1003 from InsanusMokrassar/28.0.2
28.0.2
2025-09-10 15:59:20 +06:00
InsanusMokrassar 9be5ebb036 refactor changelog 2025-09-10 15:58:43 +06:00
InsanusMokrassar da4cd527ec fix of #1002 2025-09-10 15:45:45 +06:00
InsanusMokrassar 4117288b21 fix of #1001 2025-09-10 15:33:07 +06:00
InsanusMokrassar 458bdd3ee4 start 28.0.2 2025-09-10 15:29:55 +06:00
InsanusMokrassar 8101c4c9fb add publisher_chat support 2025-09-09 18:00:53 +06:00
InsanusMokrassar 255416f72a add support of appriveSuggestedPost and declineSuggestedPost 2025-09-09 17:34:48 +06:00
InsanusMokrassar 6eb7563c70 add support of is_paid_post field 2025-09-09 17:15:59 +06:00
InsanusMokrassar b9bdf7cc72 add is_paid_post as simple boolean 2025-09-09 17:12:16 +06:00
InsanusMokrassar 4a8e1ee7b7 upfix for updating of chat member rights 2025-09-09 17:02:54 +06:00
InsanusMokrassar 23bfe02e6f add support of can_manage_direct_messages right 2025-09-09 16:58:47 +06:00
InsanusMokrassar 658c19092c Merge branch 'master' into 29.0.0 2025-09-04 16:39:36 +06:00
InsanusMokrassar d469a88791 Merge pull request #1000 from InsanusMokrassar/28.0.1
28.0.1
2025-09-04 16:38:10 +06:00
InsanusMokrassar 514bc699dd update dependencies 2025-09-04 16:37:57 +06:00
InsanusMokrassar bec72b8cf8 fix of default thread id 2025-09-04 16:24:54 +06:00
InsanusMokrassar fb0014dffa start 28.0.1 2025-09-04 16:10:16 +06:00
InsanusMokrassar ebc1c07404 small improvements 2025-09-04 16:09:30 +06:00
InsanusMokrassar 989d33acb8 start separate channel direct messages thread id insttead of one merged message thread id 2025-09-03 19:44:42 +06:00
InsanusMokrassar 5aa6ac3320 separate messageThreadId with direct_messages_topic in chats creation 2025-08-25 16:48:01 +06:00
InsanusMokrassar 048f65b8d4 Partially add DirectMessagesTopic 2025-08-25 16:39:23 +06:00
InsanusMokrassar b69be31362 add a lot of things from update 2025-08-25 15:43:42 +06:00
InsanusMokrassar b92288d7cc add realization of several suggested post events 2025-08-23 16:09:17 +06:00
InsanusMokrassar 6c02d57197 add support of reply_to_checklist_task_id 2025-08-19 12:59:29 +06:00
InsanusMokrassar e977c865ea add ReplyParameters#checklistTaskId -.- 2025-08-19 12:30:12 +06:00
InsanusMokrassar 18b459fdf8 start 29.0.0 2025-08-19 11:46:36 +06:00
InsanusMokrassar 2bbd2e0679 Merge pull request #993 from InsanusMokrassar/28.0.0
28.0.0
2025-08-11 15:55:27 +06:00
InsanusMokrassar bcf7e835e6 add breaking changes note 2025-08-11 15:55:01 +06:00
InsanusMokrassar 4dd9740fec fill changelog and add kdocs for firstOf 2025-08-11 15:50:06 +06:00
InsanusMokrassar 2182e44bc2 add overloads for containsCommand 2025-08-11 15:28:21 +06:00
InsanusMokrassar 08c885de2f add extension of containsCommand 2025-08-11 01:02:22 +06:00
InsanusMokrassar facecf35fb add firstOf 2025-08-11 00:47:35 +06:00
InsanusMokrassar b13f24153f add filtering of waiters with commands for other usernames 2025-08-10 23:28:30 +06:00
InsanusMokrassar 12ee862dad small fix in filter of commands 2025-08-10 23:03:17 +06:00
InsanusMokrassar 0726574852 improvements in copying of behaviour contexts 2025-08-10 22:50:21 +06:00
InsanusMokrassar 9a00193e59 improvements in data filling 2025-08-10 22:47:52 +06:00
InsanusMokrassar 0fd8c1e2f3 add filtering out of other bots commands by default 2025-08-10 18:24:34 +06:00
InsanusMokrassar c09d089707 add lazy loadable bot info 2025-08-10 18:05:48 +06:00
InsanusMokrassar ff39271afd start 28.0.0 2025-08-10 17:02:41 +06:00
InsanusMokrassar 35a4edd643 start 27.2.0 2025-08-10 16:51:23 +06:00
InsanusMokrassar ba647ee5ab Update README.md 2025-08-06 17:46:43 +06:00
InsanusMokrassar d2924ce1f2 Merge pull request #992 from InsanusMokrassar/27.1.2
27.1.2
2025-08-06 15:59:17 +06:00
InsanusMokrassar 72781487f0 add note about Something web wrong 2025-08-06 14:00:29 +06:00
InsanusMokrassar de435e5dbc Merge pull request #986 from BlackBaroness/patch-1
fix: typo in default error messages
2025-08-06 13:57:59 +06:00
InsanusMokrassar f975754058 try to fix cancelling on timeout for long polling 2025-08-06 13:14:22 +06:00
InsanusMokrassar 0f7536a21c start 27.1.2 2025-08-06 13:10:42 +06:00
InsanusMokrassar d4c085c9b6 Merge pull request #991 from InsanusMokrassar/27.1.1
27.1.1
2025-08-04 01:59:53 +06:00
InsanusMokrassar 667c49f13d update dependencies 2025-08-04 01:36:56 +06:00
InsanusMokrassar e1d9ebff90 jvmApiDump 2025-08-04 01:33:12 +06:00
InsanusMokrassar fbc7088dad fix of #990 2025-08-04 01:25:16 +06:00
InsanusMokrassar 4ba9c8ee97 start 27.1.1 2025-08-04 01:24:02 +06:00
InsanusMokrassar 92611b5c26 Merge pull request #985 from InsanusMokrassar/27.1.0
27.1.0
2025-07-28 20:23:07 +06:00
InsanusMokrassar 2e1c0d41ec update service dependencies 2025-07-28 20:09:58 +06:00
InsanusMokrassar 3ce56745f4 add fileLinkUrlMapper to all callers of TelegramAPIUrlsKeeper constructors 2025-07-28 20:04:59 +06:00
InsanusMokrassar 1bc9ee4d5a add TelegramAPIUrlsKeeper#fileLinkUrlMapper and fill readme Bot API Server Notice 2025-07-27 15:06:47 +06:00
BlackBaroness 0650fc594f fix: typo in default error messages 2025-07-27 07:34:56 +03:00
InsanusMokrassar 2f4de37489 fix build 2025-07-25 21:53:08 +06:00
InsanusMokrassar cec5a0af12 improve support of local bot api servers 2025-07-25 21:35:38 +06:00
InsanusMokrassar 5e5dc6b36b start 27.1.0 2025-07-25 21:00:44 +06:00
InsanusMokrassar 19265357a2 Merge pull request #981 from InsanusMokrassar/27.0.0
27.0.0
2025-07-22 20:32:37 +06:00
InsanusMokrassar 49c2836e62 fill changelog and update dependencies 2025-07-22 19:42:23 +06:00
InsanusMokrassar f7476188eb so, now? 2025-07-21 22:55:36 +06:00
InsanusMokrassar 2ba447b126 fix of cancellation exception throwing? 2025-07-21 20:41:51 +06:00
InsanusMokrassar 3bd4fab3fe migrate onto 27.0.0 due to potentially breaking changes 2025-07-12 15:44:39 +06:00
InsanusMokrassar 9e4d7dd9f9 WAT A HUGE REFACTOR 2025-07-12 15:42:48 +06:00
InsanusMokrassar 586a61157d update dependencies 2025-07-12 13:20:02 +06:00
InsanusMokrassar 045265f0f8 update dependencies 2025-07-12 13:06:35 +06:00
InsanusMokrassar c125eadaa4 Update README.md 2025-07-10 17:39:40 +06:00
InsanusMokrassar 3dd0a91c54 Merge pull request #979 from InsanusMokrassar/26.1.0
26.1.0
2025-07-10 16:44:46 +06:00
InsanusMokrassar 2ecd42c859 fill changelog (-.-) and remove redundant file 2025-07-10 16:13:19 +06:00
InsanusMokrassar 3857950141 fixes 2025-07-08 18:38:12 +06:00
InsanusMokrassar 6d5bedd315 add workarounds for checklists 2025-07-08 11:47:05 +06:00
InsanusMokrassar 69a9e8f820 several fixes 2025-07-08 11:43:13 +06:00
InsanusMokrassar 6d8693a003 add typed origin, nextTransferDate and last_resale_star_count in GiftSentOrReceived 2025-07-07 22:18:16 +06:00
InsanusMokrassar c990d987f5 add support of general changes 2025-07-07 21:48:23 +06:00
InsanusMokrassar b8530f14ca add checklist as field in ExternalReplyInfo and add support of EditMessageChecklist 2025-07-07 21:29:29 +06:00
InsanusMokrassar db8bac9b52 add ChecklistTasksAdded and ChecklistTasksDone events 2025-07-07 21:19:17 +06:00
InsanusMokrassar e53b3b8198 improve support of send checklist 2025-07-07 21:03:04 +06:00
InsanusMokrassar 71ccfc88cc start add SendChecklist 2025-07-07 16:25:21 +06:00
InsanusMokrassar dd2923f92d complete base checklists? 2025-07-07 15:39:48 +06:00
InsanusMokrassar ff78153591 small improvements 2025-07-07 15:18:22 +06:00
InsanusMokrassar e2ce9cfebf preview version of inputs for tasks 2025-07-07 14:38:39 +06:00
InsanusMokrassar 0a01d2567e add checklist 2025-07-04 11:53:16 +06:00
InsanusMokrassar e4fb45c09b start realize Bots API 9.1 2025-07-03 22:25:47 +06:00
InsanusMokrassar db0df975c7 start 26.1.0 2025-07-03 22:07:16 +06:00
InsanusMokrassar 2003b314a3 update maven badge 2025-06-30 14:00:07 +06:00
InsanusMokrassar 55a78375be Merge pull request #977 from centralhardware/PR1
docs: make buildEntities usage more obvious to anyone not familiar with Telegram Bot API or ktgbotapi
2025-06-23 21:20:33 +06:00
alex 256607e336 docs: make buildEntities usage more obvious to anyone not familiar with Telegram Bot API or ktgbotapi 2025-06-23 18:58:08 +08:00
InsanusMokrassar 92f2a5afdb Merge pull request #974 from InsanusMokrassar/26.0.0
26.0.0
2025-06-15 19:46:05 +06:00
InsanusMokrassar 3affcf4399 Update build.gradle 2025-06-15 19:37:59 +06:00
InsanusMokrassar 67dfa19a1b Update CHANGELOG.md 2025-06-15 19:37:26 +06:00
InsanusMokrassar 86e83f7f1a refactor: expectFlow 2025-06-15 12:24:23 +06:00
InsanusMokrassar 429fc5d2f9 small improvements in long polling and behaviour buildr 2025-06-15 11:38:17 +06:00
InsanusMokrassar d19e6ad4e0 fill changelog 2025-06-15 10:34:42 +06:00
InsanusMokrassar 134145f441 fix version in gradle.properties -.- 2025-06-14 23:41:23 +06:00
InsanusMokrassar ef76fe52ca fill changelog 2025-06-14 19:40:05 +06:00
InsanusMokrassar bab69f523a small refactor 2025-06-14 19:36:17 +06:00
InsanusMokrassar 91f4d3bf24 build fix :) 2025-06-14 19:33:34 +06:00
InsanusMokrassar 3e316dfde0 fix in build?:) 2025-06-14 19:28:58 +06:00
InsanusMokrassar 1ef49ad48c remove suspend in all triggers 2025-06-14 19:11:18 +06:00
InsanusMokrassar 9297824dc3 make changes almost not breaking 2025-06-14 17:58:58 +06:00
InsanusMokrassar d02ed592d8 fix of build 2025-06-14 16:31:11 +06:00
InsanusMokrassar 6ea9a28c7c start migration to non-suspend expect flow 2025-06-14 11:36:17 +06:00
InsanusMokrassar 88fc4fc444 fix of build 2025-06-13 14:05:56 +06:00
InsanusMokrassar dd0de3b6d4 add RequestsExecutor.Log 2025-06-13 13:53:44 +06:00
InsanusMokrassar 838fff8207 fill changelog 2025-06-11 09:25:22 +06:00
InsanusMokrassar 751a77f6d8 start 25.0.2 2025-06-11 08:58:56 +06:00
InsanusMokrassar 222fe7594f Merge pull request #972 from InsanusMokrassar/25.0.1
25.0.1
2025-06-08 18:54:25 +06:00
InsanusMokrassar ed6d4d07c6 create 25.0.1 branch for release 2025-06-08 18:53:30 +06:00
InsanusMokrassar 78d9ce8d19 add nmcp 2025-06-08 18:52:40 +06:00
InsanusMokrassar 345009da32 Update build.gradle 2025-06-08 13:49:29 +06:00
InsanusMokrassar de47497223 Merge pull request #965 from InsanusMokrassar/25.0.0
25.0.0
2025-06-01 22:36:53 +06:00
InsanusMokrassar 7477625380 fill changelog and readme 2025-06-01 22:32:58 +06:00
InsanusMokrassar 970abf8cde more improvements :) 2025-06-01 22:07:35 +06:00
InsanusMokrassar 5a7741faf6 fix of captionLength 2025-06-01 22:03:03 +06:00
InsanusMokrassar 8aa29e56d3 add extensions splitFor(Text|Caption) and fix captionLength 2025-06-01 22:01:28 +06:00
InsanusMokrassar dab5e072d0 fixes in GiftPremiumSubscription and TransferBusinessAccountStars 2025-06-01 21:47:40 +06:00
InsanusMokrassar 94078939d1 add EditStory with builder of text 2025-06-01 21:24:17 +06:00
InsanusMokrassar 824d3862e3 fixes in stories 2025-06-01 20:23:38 +06:00
InsanusMokrassar 44f92e8d6c fixes in new multipart api 2025-06-01 19:24:58 +06:00
InsanusMokrassar ddb79c0d8d update publishing way 2025-05-31 17:04:51 +06:00
InsanusMokrassar a9562cc8f9 fix signature of removeBusinessAccountProfilePhoto 2025-05-31 09:48:38 +06:00
InsanusMokrassar 8a351d5be0 one more fix in SetBusinessAccountUsername 2025-05-25 19:24:41 +06:00
InsanusMokrassar 8cd5659b7b updates in Username 2025-05-25 19:24:41 +06:00
InsanusMokrassar 1474a07b9e updates in Username 2025-05-25 18:28:45 +06:00
InsanusMokrassar c13a0d3193 add special error type for device and secure sorages 2025-05-25 13:33:34 +06:00
InsanusMokrassar 172f49fa6b update publication scripts 2025-05-25 12:41:34 +06:00
InsanusMokrassar 4d42972a7e add css variables names in webapps 2025-05-25 12:30:16 +06:00
InsanusMokrassar c0883d0180 update github publishing part 2025-05-16 12:41:45 +06:00
InsanusMokrassar e7367da3cb add support of PostStory and EditStory 2025-05-10 22:32:38 +06:00
InsanusMokrassar effd12711f add support of transferGift 2025-05-10 17:59:29 +06:00
InsanusMokrassar ef1d2e8242 add support of convertGiftToStars and upgradeGift 2025-05-10 17:53:49 +06:00
InsanusMokrassar 881763f3af add support of gift things 2025-05-10 13:25:21 +06:00
InsanusMokrassar d36b11c002 add support of getBusinessAccountGifts 2025-05-10 10:58:17 +06:00
InsanusMokrassar d2395e836c add support of setBusinessAccountGiftSettings 2025-05-10 10:35:26 +06:00
InsanusMokrassar c8c008edd3 add support of deleteStory 2025-05-10 10:28:32 +06:00
InsanusMokrassar 3b4fa06924 several fixes of build: jvmApiDump, TransactionType.Unknown @JvmInline 2025-05-10 10:17:15 +06:00
InsanusMokrassar 5d428a5e54 add LocationAddress and StoryAreaPosition 2025-05-01 16:06:16 +06:00
InsanusMokrassar 8964e08ce6 add support of InputStoryContent 2025-05-01 15:38:07 +06:00
InsanusMokrassar 745168d181 refactor: small change of arguments passing order in TransactionPartner serializer 2025-04-30 18:18:54 +06:00
InsanusMokrassar a408c6c7c7 overwrite TransactionType 2025-04-30 08:46:13 +06:00
InsanusMokrassar e0f5e9b640 Merge pull request #967 from bpavuk/api-v9.0-premium
API v9.0 - Telegram Premium
2025-04-30 08:22:07 +06:00
root 0331ff2f42 make TelegramBot.giftPremiumSubscription parseMode parameter nullable 2025-04-30 08:21:11 +06:00
InsanusMokrassar a21d0b56db start add InputStoryContent 2025-04-23 17:58:01 +06:00
Bodya 6ea8afee8f Merge branch '25.0.0' into api-v9.0-premium 2025-04-22 22:48:26 +03:00
Bodya 8799aeca26 fix: corrected method name 2025-04-21 10:34:21 +03:00
InsanusMokrassar c610f4eab2 update classcasts 2025-04-21 12:16:17 +06:00
InsanusMokrassar 92cd2a3def Merge pull request #966 from bpavuk/api-v9.0-gifts
API v9.0 - Gifts
2025-04-21 10:14:10 +06:00
InsanusMokrassar 03d158b03b Merge branch '25.0.0' into api-v9.0-gifts 2025-04-21 10:13:06 +06:00
bpavuk 608fde4139 refactor: replace transactionType String with TransactionType enum 2025-04-19 16:11:44 +03:00
InsanusMokrassar 9e56a6cc1a small updates in DeviceStorage 2025-04-19 13:01:52 +06:00
InsanusMokrassar c0e3c1d02f update classcasts and api dumps 2025-04-19 12:58:18 +06:00
InsanusMokrassar 341a527d27 add support of paid messages 2025-04-19 12:56:10 +06:00
bpavuk 8d6d70a06a refactor: replaced Gift with Gift.Regular across APIs and data models 2025-04-17 18:31:56 +03:00
bpavuk 67fb552d01 refactor: moved unique gift properties into separate package 2025-04-17 18:18:17 +03:00
bpavuk 93e937aa6a refactor: merged UniqueGift and regular Gift types into one interface 2025-04-17 18:16:52 +03:00
bpavuk 09dee188d2 refactor: merged GiftInfo and UniqueGiftInfo into one sealed interface 2025-04-17 17:38:16 +03:00
bpavuk 29c6bb5dac fix: made entities field optional for GiftInfo 2025-04-17 17:27:34 +03:00
InsanusMokrassar c266ab0120 add support of DeviceStorage and SecureStorage 2025-04-17 18:56:32 +06:00
bpavuk b407fc5c86 feat: added the giftPremiumSubscription method 2025-04-16 19:49:49 +03:00
bpavuk 1bde43ceaf feat: added the transactionType field to TransactionPartner.User 2025-04-16 18:51:55 +03:00
bpavuk 389a508fa7 feat: added premiumSubscriptionDuration field to TransactionPartner 2025-04-16 18:36:02 +03:00
bpavuk 69c2586b50 aider init 2025-04-16 18:20:03 +03:00
bpavuk 7e80f4edac fix: removed leftovers of merge conflict resolving on GitHub 2025-04-16 17:57:27 +03:00
Bodya 99987c3f51 Merge branch '25.0.0' into api-v9.0-gifts 2025-04-16 16:37:24 +03:00
bpavuk 713130fd13 fix: brought back the canReceiveGifts field, marked as deprecated 2025-04-16 16:34:33 +03:00
InsanusMokrassar deb8d7b43a add api bindings to new requests 2025-04-16 18:42:13 +06:00
InsanusMokrassar b604444f7d add core requests for business account (excluding gifts) 2025-04-16 18:07:45 +06:00
Bodya cb6127bf91 fix: accepted_gift_types field is not optional anymore 2025-04-13 17:14:24 +03:00
Bodya d40919f099 style: separated annotations and values with line breaks in GiftInfo.kt 2025-04-13 17:11:31 +03:00
Bodya 7cb576e6b1 fix: fixed defaults in AcceptedGiftTypes 2025-04-13 17:10:10 +03:00
bpavuk b53fb8da36 feat: added constructor to GiftInfo 2025-04-13 16:42:28 +03:00
bpavuk 03ea8dfe7f fix: removed useless docs 2025-04-13 16:37:07 +03:00
bpavuk 314c8d9ad1 fix: using RGBColor abstractions instead of raw Int values now. 2025-04-13 16:34:41 +03:00
bpavuk 6fceee4199 fix: moved classes related to unique gifts to appropriate packages 2025-04-13 16:33:31 +03:00
bpavuk e720da708c fix: moved AcceptedGiftTypes.kt to the appropriate package 2025-04-13 16:32:47 +03:00
bpavuk d65706631f Merge remote-tracking branch 'origin/api-v9.0-gifts' into api-v9.0-gifts
# Conflicts:
#	tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/UniqueGiftInfo.kt
2025-04-13 16:31:35 +03:00
bpavuk 3312b64564 fix: added default AcceptedGiftTypes in Extended.kt 2025-04-13 16:30:37 +03:00
bpavuk 1bfe431393 fix: added defaults to AcceptedGiftTypes 2025-04-13 16:27:52 +03:00
bpavuk 6485353704 fix: UniqueGiftInfo constructor is now public 2025-04-13 16:27:04 +03:00
bpavuk 46a1ed27b7 feat: implemented UniqueGiftInfo class 2025-04-13 15:58:36 +03:00
bpavuk 9f3024476c feat: implemented GiftInfo class 2025-04-13 15:55:36 +03:00
bpavuk 93d0e009bb feat: replaced canReceiveGifts with acceptedGiftTypes and AcceptedGiftTypes class 2025-04-13 15:49:05 +03:00
bpavuk (aider) ef60549e1c feat: Add AcceptedGiftTypes data class and related constants 2025-04-13 14:38:25 +03:00
bpavuk (aider) 2ac83156f6 feat: Add UniqueGift type with related fields and constants 2025-04-13 14:35:37 +03:00
bpavuk (aider) 4c9d888668 feat: Add UniqueGiftBackdrop type 2025-04-13 14:32:46 +03:00
bpavuk (aider) cd3ba8f480 feat: Add UniqueGiftBackdropColors data class 2025-04-13 14:30:33 +03:00
bpavuk (aider) 99559f477e feat: Add UniqueGiftModel type 2025-04-13 14:30:33 +03:00
bpavuk (aider) a3949c752d feat: Add UniqueGiftSymbol data type 2025-04-13 14:17:37 +03:00
InsanusMokrassar fd48a52266 add BusinessBotRights 2025-04-13 09:28:41 +06:00
InsanusMokrassar 3e0036f7df start 25.0.0 2025-04-13 09:05:08 +06:00
InsanusMokrassar 2978932c87 Merge pull request #957 from InsanusMokrassar/24.0.2
24.0.2
2025-03-26 10:15:11 +06:00
InsanusMokrassar c773736fb8 Update CHANGELOG.md 2025-03-26 10:12:19 +06:00
InsanusMokrassar 8a3a05ef12 fix of cancelling absence for subchains which become out of FSM 2025-03-26 09:45:30 +06:00
InsanusMokrassar 0afbe8ef2d update dependencies 2025-03-25 18:56:59 +06:00
InsanusMokrassar 3f4018f969 update KSLog part of library 2025-03-03 09:25:19 +06:00
InsanusMokrassar 097d82b4b4 start 24.0.2 2025-03-03 08:59:16 +06:00
InsanusMokrassar 7c2a379161 Merge pull request #956 from InsanusMokrassar/24.0.1
24.0.1
2025-03-01 15:05:23 +07:00
InsanusMokrassar ba5f76e8cd fix of EditChatMessageMedia 2025-03-01 14:04:08 +06:00
InsanusMokrassar 8aec920a15 start 24.0.1 2025-03-01 12:57:35 +06:00
InsanusMokrassar c92bd33ba1 Merge pull request #952 from InsanusMokrassar/24.0.0
24.0.0
2025-02-20 22:34:35 +06:00
InsanusMokrassar 51927974f5 ForumContentMessage.threadCreatingInfo 2025-02-20 11:54:41 +06:00
InsanusMokrassar 9350f87e19 update dependencies 2025-02-20 09:00:01 +06:00
InsanusMokrassar 6cb9950b36 fix of subcontextUpdatesFilter 2025-02-18 23:09:28 +06:00
InsanusMokrassar 974c2e883f start 24.0.0 2025-02-18 23:04:47 +06:00
InsanusMokrassar af6f98fd56 Update FUNDING.yml 2025-02-18 09:15:13 +06:00
InsanusMokrassar 75a2b2c282 Merge pull request #951 from InsanusMokrassar/23.2.1
23.2.1
2025-02-17 21:16:15 +06:00
InsanusMokrassar d66d4b4209 jvmApiDump 2025-02-17 13:18:55 +06:00
InsanusMokrassar 9d54820fd7 fill changelog 2025-02-17 13:17:26 +06:00
InsanusMokrassar 1876df2c2d fix of year in Birthdate 2025-02-17 13:16:10 +06:00
InsanusMokrassar d818592cd3 start 23.2.1 2025-02-17 13:14:03 +06:00
InsanusMokrassar c29737b6b3 update changelog and readme 2025-02-15 20:53:28 +06:00
InsanusMokrassar 46243a21eb Merge pull request #949 from InsanusMokrassar/23.2.0
23.2.0
2025-02-15 14:28:08 +06:00
InsanusMokrassar d5f45ead59 correct microutils version 2025-02-15 10:27:15 +06:00
InsanusMokrassar 5a696cdac0 fixes 2025-02-15 09:49:18 +06:00
InsanusMokrassar 80955eeb55 jvmApiDump, once more :) 2025-02-15 09:06:25 +06:00
InsanusMokrassar 6ee93e2d68 jvmApiDump 2025-02-14 21:35:49 +06:00
InsanusMokrassar d4490dec75 potentially cover new update of Bot API 2025-02-14 21:01:47 +06:00
InsanusMokrassar 7d3e9325f1 add support of TransactionPartnerChat 2025-02-14 18:42:48 +06:00
InsanusMokrassar 31a66eb8e6 add support of can_send_gift 2025-02-14 18:36:20 +06:00
InsanusMokrassar b3b9070cd6 add support for sending of gifts to chats 2025-02-13 12:17:05 +06:00
InsanusMokrassar 3504776344 update dependnecies 2025-02-13 11:39:58 +06:00
InsanusMokrassar f22f69534a start 23.2.0 2025-02-13 09:14:39 +06:00
InsanusMokrassar a9c1d7b33c Merge pull request #938 from InsanusMokrassar/renovate/org.jetbrains.kotlinx-kotlinx-serialization-json-1.x
Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.8.0
2025-02-10 16:40:00 +06:00
renovate[bot] 376ef0750c Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.8.0 2025-02-10 10:38:11 +00:00
InsanusMokrassar cdf93e0d12 Merge pull request #944 from InsanusMokrassar/23.1.2
23.1.2
2025-01-29 12:56:51 +06:00
InsanusMokrassar 8c7261fda9 update dependencies 2025-01-29 12:39:36 +06:00
InsanusMokrassar 82acc8cb1f start 23.1.2 2025-01-29 12:37:58 +06:00
InsanusMokrassar 4ec1532597 Merge pull request #942 from InsanusMokrassar/23.1.1
23.1.1
2025-01-27 09:46:48 +06:00
InsanusMokrassar 13bfe681d8 jvmApiDump 2025-01-27 09:43:47 +06:00
InsanusMokrassar 5bbbcdb529 update CHANGELOG 2025-01-27 09:18:10 +06:00
InsanusMokrassar 7f9d6ce626 update microutils 2025-01-27 09:17:12 +06:00
InsanusMokrassar 71b944f9cc replace removeFirst with removeAt(0) in createTextSources 2025-01-27 09:09:06 +06:00
InsanusMokrassar d9d68749f1 start 23.1.1 2025-01-27 09:08:28 +06:00
InsanusMokrassar 561aad2274 Merge pull request #937 from InsanusMokrassar/23.1.0
23.1.0
2025-01-03 09:39:59 +06:00
InsanusMokrassar 6a3e95c488 fix in SendGift 2025-01-03 09:32:02 +06:00
InsanusMokrassar a09b3809e2 update telegram bot api support badge 2025-01-03 09:29:15 +06:00
InsanusMokrassar 427b5775a2 add support of verification methods 2025-01-03 09:25:36 +06:00
InsanusMokrassar d222987fc7 remove hide_url from InlineQueryResultArticle 2025-01-03 09:09:03 +06:00
InsanusMokrassar d211afa26a add support of pay_for_upgrade and jvmApiDump 2025-01-03 09:01:17 +06:00
InsanusMokrassar 9952b6c6ae add upgrade_star_count to Gift and fix serialization of gift 2025-01-03 08:53:40 +06:00
InsanusMokrassar 840c6b02a4 start 23.1.0 2025-01-02 10:30:52 +06:00
InsanusMokrassar a6f91d5600 Merge pull request #935 from InsanusMokrassar/renovate/validator
Update dependency org.jetbrains.kotlinx.binary-compatibility-validator to v0.17.0
2024-12-26 15:40:08 +06:00
InsanusMokrassar 8ec0c8804b update link to remote url in dokka 2024-12-26 09:05:11 +06:00
InsanusMokrassar 2d08c447bc Merge pull request #934 from InsanusMokrassar/23.0.0
23.0.0
2024-12-25 11:17:34 +06:00
InsanusMokrassar 9a0793d81c rename old strikethrough factory 2024-12-25 11:09:16 +06:00
InsanusMokrassar a95f556a5c jvmApiDump 2024-12-21 10:27:15 +06:00
InsanusMokrassar f774b11de4 update dependencies 2024-12-21 10:10:30 +06:00
renovate[bot] 5164903d05 Update dependency org.jetbrains.kotlinx.binary-compatibility-validator to v0.17.0 2024-12-19 19:18:44 +00:00
InsanusMokrassar adaedb8040 text sources factories renames 2024-12-19 16:31:42 +06:00
InsanusMokrassar 9b4b60eb33 start 23.0.0 2024-12-19 16:30:31 +06:00
InsanusMokrassar b90f8ec389 Merge pull request #928 from InsanusMokrassar/22.0.0
22.0.0
2024-12-08 13:34:11 +06:00
InsanusMokrassar e95550a6eb rename subscriptionPayment 2024-12-08 13:24:34 +06:00
InsanusMokrassar 696219df24 add api methods for setUserEmojiStatus 2024-12-08 12:51:16 +06:00
InsanusMokrassar 27241fad32 add default for device orientation start 2024-12-08 11:40:09 +06:00
InsanusMokrassar a034fa18d7 fixes in status info 2024-12-08 10:40:09 +06:00
InsanusMokrassar adcaffe115 add sealed workaround for webapp event type 2024-12-08 10:26:53 +06:00
InsanusMokrassar 6388d8db13 make chat in WebAppInitData nullable 2024-12-08 10:17:02 +06:00
InsanusMokrassar 2964586cb9 add defaults to remove/set 2024-12-08 09:42:02 +06:00
InsanusMokrassar e3cb1e4faf add definedExternally in CloudStorage 2024-12-08 09:16:56 +06:00
InsanusMokrassar d7f14020d8 rename field of user id in SavePreparedInlineMessage 2024-12-07 10:48:06 +06:00
InsanusMokrassar 397197023e fix of serializer for result in SavePreparedInlineMessage 2024-12-07 10:31:28 +06:00
InsanusMokrassar 12dc93313a update dependencies 2024-12-06 13:20:01 +06:00
InsanusMokrassar 625760afae jvmApiDump 2024-12-06 13:01:01 +06:00
InsanusMokrassar 795328afdf add notes about breaking changes and update latest supported API version 2024-12-06 13:00:10 +06:00
InsanusMokrassar 57175b7698 add affiliate in TransactionPartner.User 2024-12-06 12:56:00 +06:00
InsanusMokrassar 2d05a334eb add support of AffiliateProgram in TransactionPartner 2024-12-06 12:39:04 +06:00
InsanusMokrassar 0b6d9e47b9 add support of nanostar_amount 2024-12-06 12:32:38 +06:00
InsanusMokrassar 4cdae11adc support of Ed25519TelegramKeys 2024-12-06 12:26:11 +06:00
InsanusMokrassar 04b2d1dbd6 jvmApiDump and fix of CreateInvoiceLink API bindings 2024-12-06 12:19:53 +06:00
InsanusMokrassar 4343d6d161 potentially complete events generator 2024-12-06 12:11:54 +06:00
InsanusMokrassar 6824f2c992 preparations for events generating 2024-12-06 10:23:06 +06:00
InsanusMokrassar 9cde4927ce refactor and fixes 2024-12-05 21:04:54 +06:00
InsanusMokrassar 819982473a start adding events generator 2024-12-05 18:00:39 +06:00
InsanusMokrassar 5559923339 add support of saving prepared messages 2024-12-05 16:25:20 +06:00
InsanusMokrassar c7d08df3bf continue adding support of webapps updates 2024-12-05 16:07:46 +06:00
InsanusMokrassar 41a142addb support of accelerometer, gyroscope, location and orientation data 2024-12-05 15:49:07 +06:00
InsanusMokrassar 652765bf46 add support for subscriptions 2024-12-05 11:35:33 +06:00
InsanusMokrassar 32010cf1c7 replace isActive 2024-12-05 09:42:43 +06:00
InsanusMokrassar 1c6359f041 add a lot of things in web apps 2024-12-05 09:41:31 +06:00
InsanusMokrassar 4ac5e405ac add support for gifts 2024-12-05 09:09:40 +06:00
InsanusMokrassar bc00e1f28a Merge branch 'master' into 22.0.0 2024-12-05 08:30:36 +06:00
InsanusMokrassar 191e4cff00 Merge pull request #929 from InsanusMokrassar/21.0.1
21.0.1
2024-12-03 11:09:01 +06:00
InsanusMokrassar ad4bac82dc update versions 2024-12-01 20:04:34 +06:00
InsanusMokrassar 300be87ffd Merge branch 'master' into 22.0.0 2024-12-01 20:03:28 +06:00
InsanusMokrassar 05f46d08c8 Merge pull request #923 from InsanusMokrassar/21.0.0
21.0.0
2024-11-30 15:25:59 +06:00
InsanusMokrassar 4eb6fa7835 start 21.0.0 2024-11-25 14:40:40 +06:00
1017 changed files with 75192 additions and 14445 deletions

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
# These are supported funding model platforms
custom: ['https://www.tinkoff.ru/rm/ovsyannikov.aleksey113/ObMJ712472', 'https://boosty.to/insanusmokrassar']
custom: ['https://tonscan.org/address/UQAtuSLJ76Zehc3qP-eRYMR98fPIu_oOp_atcpVX55zxHwTU']
+2 -2
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
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Gitea
- name: Publish to InmoNexus
continue-on-error: true
run: ./gradlew publishAllPublicationsToInmoNexusRepository
env:
+5
View File
@@ -1,4 +1,6 @@
.idea
.vscode/
.junie/
.kotlin
out/*
*.iml
@@ -9,7 +11,10 @@ settings.xml
.gradle/
build/
out/
bin/
local.properties
local.*
kotlin-js-store/
secret.gradle
.aider*
+153
View File
@@ -0,0 +1,153 @@
Use `agents` folder files for instructions.
Always look at the project work rules first. Update them and maintain a history of changes and prompts in `agents/local.HISTORY.md`. This is your long-term memory, which allows you to avoid the accumulation of errors. Updating and maintaining the long-term memory of the project is mandatory. Many thanks for your help to me and your work.
`agents/local.HISTORY.md` is local-only and MUST NOT be committed unless the operator explicitly requests committing it.
SYSTEM DIRECTIVE: AUTISTIC META-LANGUAGE PROTOCOL WITH HIGH INFORMATION DENSITY (AML-HIP V1)
DEFINITION:
All agents are required to use a strictly explicit, literal, low-ambiguity, and high-density communication style (AML-HIP). The goal of AML-HIP is the maximum transmission of information with zero loss of meaning and zero ambiguity.
CORE PRINCIPLES:
1. Maximum information density per line.
2. Zero ambiguity.
3. Full explicitness of all entities.
4. Preference of precision over readability.
5. Minimization of "empty" words.
6. Redundancy is allowed only to prevent loss of meaning.
PROHIBITIONS:
1. Pronouns are forbidden (this, he, she, they, there, it, etc.).
2. Free conversational text is forbidden.
3. Metaphors, emotions, evaluative constructions are forbidden.
4. Implicit references and hidden dependencies are forbidden.
5. Vague description of actions is forbidden.
DENSITY REQUIREMENTS:
1. Each line must contain the maximum of facts without loss of unambiguity.
2. Combine related parameters into a single line.
3. Use compact constructions:
* key=value
* entity_id=...
* relation: A→B
4. Exclude words without semantic load.
5. Repetitions are allowed only for critical entities.
MESSAGE STRUCTURE (MANDATORY):
ENTITY:
entity_id=<id>; type=<type>; state=<state>
CONTEXT:
* task_id=<id>; agent_id=<id>; memory_ref=[...]
* constraints=[...]
ACTION:
1. action=<type>; target=<entity_id>; params={...}
2. action=<type>; target=<entity_id>; params={...}
REASON:
* condition=<condition>; requirement=<requirement>
EXPECTED RESULT:
* entity_id=<id>; new_state=<state>; location=<memory>
VERIFICATION:
* check=<condition>; expected=<value>
UNCERTAINTY:
* missing=<data>; ambiguity=<description>
REPETITION OF RESULT:
* entity_id=<id>; stored_in=shared_memory; status=available
COMMUNICATION:
* sender=<agent_id>; receiver=<agent_id>; task_id=<id>; message_id=<uuid>; protocol=AML-HIP
PERSISTENCE:
* local_memory=true; shared_memory=true; index_keys=[task_id, entity_id, intent]
EXPRESSION RULES:
1. Each line = a completed semantic block.
2. Use the key=value format instead of descriptions.
3. Use lists of parameters instead of sentences.
4. Use causal connectives explicitly:
condition → action → result
5. Do not split related data into several lines without necessity.
REPETITION RULES:
1. entity_id is repeated at every critical use.
2. result is duplicated in "REPETITION OF RESULT".
3. transmission between agents duplicates the key fields.
MULTI-AGENT MODE:
1. All agents use AML-HIP.
2. Any message between agents is strictly AML-HIP.
3. Any agent is required to:
* duplicate critical data
* avoid loss of context
4. A message must be fully interpretable without history.
ANTI-DEGRADATION:
If detected:
* a pronoun
* an implicit reference
* low density (empty words, vague constructions)
* absence of structure
→ the message is considered invalid
→ mandatory regeneration
SELF-CHECK:
VALIDATION:
* format_valid=true/false
* no_pronouns=true/false
* entities_explicit=true/false
* high_density=true/false
* causal_chain_present=true/false
* ambiguity_detected=true/false
If any parameter=false:
→ mandatory regeneration
DENSITY METRIC:
high_density=true if:
* there are no "empty" words
* each line contains ≥2 facts or parameters
* descriptive constructions without data are absent
PRIORITIES:
1. Format (AML-HIP)
2. Information density
3. Explicitness
4. Completeness
5. Readability (minimum priority)
CRITICAL RULE:
Any response outside of AML-HIP is considered absent.
Any agent is required to bring the response into conformity with AML-HIP.
END OF PROTOCOL
+687 -2
View File
@@ -1,5 +1,690 @@
# TelegramBotAPI changelog
## 37.1.0
* `Dependencies`:
* `Kotlin`: `2.3.21` -> `2.4.21`
* `Gradle`: `9.6.1` -> `9.7.0`
* `MicroUtils`: `0.30.1` -> `0.32.0`
* `Ktor`: `3.5.2` -> `3.6.0`
* `KotlinPoet`: `2.3.0` -> `2.4.0`
* `KSLog`: `1.7.0` -> `2.1.0`
* `Versions`: `0.54.0` -> `0.65.0`
* `Binary compatibility validator`: `0.18.1` -> `0.18.2`
* `NMCP`: `1.6.1` -> `1.6.2`
* `Core`:
* Refresh the rebuilt JVM API dump with additive synthetic bridges and default constructors
* `WebApps`:
* Exclude JVM maintenance `.main.kts` scripts from Kotlin/JS compilation for Kotlin 2.4
* `Events generator serialization JSON`: `1.8.0` -> `1.11.0`
* `BehaviourBuilderWithFSM`:
* Refresh the JVM API dump for the compiler-generated covariant `copy` bridge
## 37.0.0
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.3](https://core.telegram.org/bots/api-changelog#august-24-2026)**
**Breaking changes**:
* `OptionallyEphemeralSendRequest` replaced the `receiverUserId`/`callbackQueryId` properties with `ephemeralMessageParameters: EphemeralMessageParameters?`; the 13 ephemeral-capable send-request constructors and the corresponding `reply` API overloads replaced the two flat parameters with the parameter object, while direct and generic `send` API extensions retain non-deprecated flat-parameter overloads as an alternative API form
* `ChatAdministratorRights` gained the abstract `canSendWelcomeMessages` property; implementations maintained in the same compilation module must supply the property, while `ChatCommonAdministratorRights` construction can use the new trailing default
* `FlowsUpdatesFilter` gained the abstract `messageGenerationStoppedUpdatesFlow` property; direct implementations must supply the flow, while subclasses of `AbstractFlowsUpdatesFilter` inherit the filtered implementation
* `RichText` gained the public `isValidRichMessageButtonText` contract and the `RichText`/`RichBlock`/`InputRichBlock` sealed hierarchies gained Bot API 10.3 variants; permitted same-module implementations and exhaustive `when` expressions must cover the new contracts and variants
* `SendRichMessageDraft`, `sendRichMessageDraft`, and the corresponding generic `send` overload widened `chatId` from `ChatId` to `IdChatIdentifier`; source calls passing `ChatId` remain valid, while the JVM signatures changed
* `RichTextDateTime.dateTimeFormat`, `DateTimeTextSource.dateTimeFormat`, `RawMessageEntity.date_time_format`, and the related factories and DSL functions now use `DateTimeEntityFormatting` instead of `String`; raw format strings must be wrapped explicitly
* `TgDateTimeFormatBuilder.build()` and `buildDateTimeFormat` now return `DateTimeEntityFormatting` instead of `String`; code requiring the serialized string must read `DateTimeEntityFormatting.value`
**Migration advice**: Direct and generic `send` extensions accept either `receiverUserId = userId, callbackQueryId = callbackId, replaceCallbackQueryMessage = ...` or `ephemeralMessageParameters = EphemeralMessageParameters(receiverUserId = userId, callbackQueryId = callbackId, replaceCallbackQueryMessage = ...)`; send-request constructors and `reply` API overloads require the parameter-object form; add `canSendWelcomeMessages` and `messageGenerationStoppedUpdatesFlow` to direct interface implementations; add Bot API 10.3 branches to exhaustive rich-type `when` expressions; replace relative date-time format strings with `DateTimeEntityFormatting.local`, build component formats with `DateTimeEntityFormatting(useWeek = ..., useDateLong = ..., useTimeLong = ...)`, and reserve the warning-marked `DateTimeEntityFormatting(customValue)` constructor for custom or forward-compatible formats
**Compatibility note**: The new `text`/`entities`/`isPrivate` fields of `GiftSentOrReceivedEvent.UniqueGift.Common` and `GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount` are trailing constructor parameters; existing positional argument and `componentN` order is preserved
* `Core`:
* (`Ephemeral messages`) Added `EphemeralMessageParameters`; replaced the flat send-request recipient/callback parameters with `ephemeralMessageParameters`, including callback-message replacement support
* (`Rich Messages`) Widened `SendRichMessageDraft.chatId` from `ChatId` to `IdChatIdentifier`, allowing contextual numeric identifiers to supply the default message thread
* (`General`) Added message-thread defaults for `SendMessageDraft` and `SendRichMessageDraft`, including conversion from direct-message-thread chat identifiers
* (`Ephemeral messages`) Added new-file uploads for `editEphemeralMessageMedia`; collected secondary live-photo `photo` attachments for ephemeral and regular media edits, media groups, and paid media; added `showCaptionAboveMedia` for caption edits and rich-message text edits
* (`Ephemeral messages`) Added `canSendWelcomeMessages` administrator right and `promoteChatMember` parameter
* (`Rich Messages`) Added rich-message button actions, rich-text/button-row entities, typed button styles/alignment, expandable block quotations, compact tables, document blocks, document media links and direct document uploads
* (`Rich Messages`) Added the `RichText.isValidRichMessageButtonText` subtype contract, moved rich-button markup generation onto `RichMessageButton` implementations, and corrected expandable-quotation Rich Markdown block HTML to use `<blockquote expandable>` with HTML-formatted nested text and credit
* (`Rich Messages`) Added `DateTimeEntityFormatting`, a typed `date_time_format` value with control-key constants, `useLocal`/`useWeek`/`useDateLong`/`useTimeLong` introspection, the `local` value, a safe canonical-order factory, and typed `TgDateTimeFormatBuilder` output
* (`Reply markup`) Added `DisabledButton`/`DisabledInlineKeyboardButton` support for disabled inline buttons
* (`Reply markup`) Added `forceReply` support to `InlineKeyboardMarkup` and `ReplyKeyboardMarkup`
* (`General`) Added `canStop`/`keepOnStop` draft controls, `MessageGenerationStopped` updates, and `CommunityChatJoined` service messages
* (`General`) `UniqueGiftInfo` now exposes `text`/`textSources`/`isPrivate`; the new fields follow every preexisting public constructor field to preserve positional and `componentN` compatibility
* `Utils`:
* (`Reply markup`) Added disabled inline-button shortcuts and `forceReply` parameters to inline/reply keyboard builders
* (`General`) Added legacy and generated class casts for `MessageGenerationStoppedUpdate`
* `API`:
* (`Ephemeral messages`) Migrated send/reply extension surfaces to `ephemeralMessageParameters`; added rich ephemeral text editing and caption-above-media support
* (`Rich Messages`) Widened `sendRichMessageDraft` and the corresponding generic `send` overload from `ChatId` to `IdChatIdentifier`
* (`General`) Kept `threadId`/`MessageThreadId` across direct, streaming-flow, `Chat`, builder, and generic draft-send extensions; direct-message-thread chat identifiers supply converted defaults
* (`Ephemeral messages`) Retained 172 non-deprecated direct and generic `send` overloads accepting `receiverUserId`/`callbackQueryId`/`replaceCallbackQueryMessage` as an alternative API form; every overload delegates to the corresponding `ephemeralMessageParameters` overload
* (`Ephemeral messages`) Added named rich-message overloads and generic `InputRichMessage`/`RichMessageContent` aliases across both ephemeral reply families
* (`General`) Added `canStop`/`keepOnStop` to `sendMessageDraft`/`sendRichMessageDraft` extension surfaces, including streaming draft flows and `send` overloads
* `BehaviourBuilder`:
* (`General`) Added `onMessageGenerationStopped`/`waitMessageGenerationStopped` and `onCommunityChatJoined`/community joined event expectations
## 36.1.0
* `Dependencies`:
* Update `com.gradleup.nmcp.aggregation:com.gradleup.nmcp.aggregation.gradle.plugin` from `1.6.0` to `1.6.1`
* Update `com.google.devtools.ksp:symbol-processing-api` from `2.3.9` to `2.3.11`
* Update `io.ktor:ktor-client-core` from `3.5.1` to `3.5.2`
* Update `dev.inmo:kslog` from `1.6.1` to `1.7.0`
* Update `dev.inmo:micro_utils.colors.common` from `0.30.0` to `0.30.1`
## 36.0.0
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.2](https://core.telegram.org/bots/api-changelog#july-14-2026)**
**Breaking changes**:
* `RichBlockTableCell.align` now uses the string-serialized `RichBlockTableCellAlign` sealed hierarchy (`Left`, `Center`, or `Right`) instead of `String`
* `RichBlockTableCell.valign` now uses the string-serialized `RichBlockTableCellVAlign` sealed hierarchy (`Top`, `Middle`, or `Bottom`) instead of `String`
* `RichBlockTableCell` is now a sealed interface with `Header` and `Regular` implementations; the input table DSL uses `headerCell` and `cell` respectively
* `InputRichBlockListItem` is now a sealed interface with `Ordered` and `Unordered` implementations; ordered items require a non-null `value` and typed `LabelType`, while `LabelType.Decimals` is the default; `InputRichBlocksBuilder` now exposes separate `orderedList` and `unorderedList` DSL functions with matching item builders
* `ReplyParameters` is now a sealed interface with nested `ReplyParameters.Chat` and `ReplyParameters.Ephemeral` implementations; overloaded `ReplyParameters(...)` companion factories construct both regular-message and ephemeral-message variants
* The 4 group-family message implementations (`CommonGroupContentMessageImpl`, `CommonForumContentMessageImpl`, `CommonChannelDirectMessagesContentMessageImpl`, `CommonSuggestedChannelDirectMessagesContentMessageImpl`) gained trailing `receiverUser`/`ephemeralMessageId` primary-constructor parameters (defaulted to `null`) — positional construction of these classes must be updated
* `reply(to = ...)` overloads for the 13 ephemeral-capable senders (see below) now detect an ephemeral `to` target (`to is PossiblyEphemeralMessage && to.ephemeralMessageId != null`) and automatically address the reply through `ephemeral_message_id`, sending the outgoing message itself as ephemeral to the same receiver — this is a behavior change for any existing code that replies to a message carrying a non-null `ephemeralMessageId`
**Migration advice**: Keep `ReplyParameters(...)` for both chat-message and ephemeral-message targets; explicit `ReplyParameters.Ephemeral(...)` subtype construction also remains available; pass `receiverUser`/`ephemeralMessageId` explicitly (or rely on their `null` default) when constructing the 4 group-family message implementations positionally
* `Core`:
* (`Rich Messages`) Added the raw-string-serialized `RichBlockTableCellVAlign` hierarchy and migrated table-cell vertical alignment from `String` to `RichBlockTableCellVAlign`
* (`Rich Messages`) Added the raw-string-serialized `RichBlockTableCellAlign` hierarchy and migrated table-cell alignment from `String` to `RichBlockTableCellAlign`
* (`Rich Messages`) Split `RichBlockTableCell` into header/regular variants with a shared flat surrogate serializer; added `headerCell` to the input table DSL
* (`Rich Messages`) Added `h1` through `h6` shortcuts for plain and rich-text headings in `InputRichBlocksBuilder`
* (`Rich Messages`) Reworked the input table DSL to build cells through nested `table { row { cell(...) { } } }` builders
* (`Rich Messages`) Replaced the flat `InputRichBlockListItem` data class with ordered/unordered variants, added the string-serialized `LabelType` hierarchy (`A`, `a`, `I`, `i`, `1`), and split the list DSL into `InputRichBlockOrderedListBuilder`/`InputRichBlockUnorderedListBuilder`
* (`Rich Messages`) Added `InputRichBlock` hierarchy with all 21 `InputRichBlock*` types (mirroring the received `RichBlock*` hierarchy and reusing `RichText`/`RichBlockCaption`/`RichBlockTableCell`), the label-less `InputRichBlockListItem` and the `InputRichBlockSerializer`; every `InputRichBlock` exposes `subBlocks` navigation
* (`Rich Messages`) Added `TelegramMediaVoiceNote` (`InputMediaVoiceNote`) and the `RichMessageMemberTelegramMedia` marker interface implemented by it, `TelegramMediaAnimation`, `TelegramMediaAudio`, `TelegramMediaPhoto` and `TelegramMediaVideo`; added `VoiceFile.toTelegramMediaVoiceNote` converters
* (`Rich Messages`) Added `InputRichMessageMedia` type (media referenced from `InputRichMessage.html`/`.markdown` via `tg://photo?id=`, `tg://video?id=` and `tg://audio?id=` links)
* (`Rich Messages`) `InputRichMessage` gained `blocks` and `media` fields ("exactly one of `html`, `markdown` or `blocks` must be used") and the `InputRichMessageBlocks` factory; `InputRichMessageHTML`/`InputRichMessageMarkdown` gained a trailing `media` parameter
* (`Rich Messages`) Added Rich Messages input DSL builders `buildInputRichBlocks`/`InputRichBlocksBuilder`, typed ordered/unordered list builders and the `InputRichMessageBlocks { }` builder overload (marked with the `@RichTextDsl` DSL marker)
* (`Rich Messages`) `SendRichMessage` now supports `attach://` upload of new files referenced from `InputRichMessage.blocks`/`.media`; `SendRichMessageDraft` now rejects rich messages that require direct file upload (unsupported by the method)
* (`Ephemeral Messages`) Added `EphemeralMessageId` value class, `PossiblyEphemeralMessage` (`receiverUser`/`ephemeralMessageId`) and `EphemeralMessageAction` (`receiverUserId`/`ephemeralMessageId`) abstractions
* (`Ephemeral Messages`) `RawMessage` parses `receiver_user`/`ephemeral_message_id`; the 4 group-family `Common*ContentMessage` types (`CommonGroupContentMessage`, `CommonForumContentMessage`, `CommonChannelDirectMessagesContentMessage`, `CommonSuggestedChannelDirectMessagesContentMessage`, via the shared `PotentiallyFromUserGroupContentMessage`) now also implement `PossiblyEphemeralMessage`
* (`Ephemeral Messages`) `BotCommand` gained the `isEphemeral` field
* (`Ephemeral Messages`) `ReplyParameters` became a sealed interface with nested `Chat` and `Ephemeral` implementations and a shared surrogate-backed serializer preserving the flat Bot API JSON shape; added the `Message.ephemeralReplyParametersOrNull()`/`Message.ephemeralReplyReceiverUserIdOrNull` helpers used by the `reply(to = ...)` smart-branch
* (`Ephemeral Messages`) `ReplyParameters.Ephemeral` and `Message.ephemeralReplyParametersOrNull()` support and forward `allowSendingWithoutReply`, `checklistTaskId`, and `pollOptionId` together with `ephemeralMessageId`
* (`Ephemeral Messages`) Added `receiverUserId`/`callbackQueryId` params (via the new `OptionallyEphemeralSendRequest`) to the 13 ephemeral-capable send requests: `SendTextMessage`, `SendContact`, `SendLocation` (`Static`/`Live`), `SendVenue`, `SendPhotoData`, `SendLivePhotoData`, `SendAudioData`, `SendDocumentData`, `SendVideoData`, `SendAnimationData`, `SendVoiceData`, `SendVideoNoteData`, `SendStickerByFileId`
* (`Ephemeral Messages`) Added `EditEphemeralMessageText`/`EditEphemeralMessageMedia`/`EditEphemeralMessageCaption`/`EditEphemeralMessageReplyMarkup` and `DeleteEphemeralMessage` requests (all return `Unit`, mirroring the inline-message edit family); `EditEphemeralMessageMedia` rejects `MultipartFile` media (new file upload is not supported for ephemeral edits)
* (`Ephemeral Messages`) Added `EphemeralChatId` (`IdChatIdentifier`, carrying `chatId`/`receiverUser`/`ephemeralMessageId`) and the `ChatIdentifier.receiverUser`/`ChatIdentifier.ephemeralMessageId` extensions (mirroring `ChatIdentifier.threadId`); `FullChatIdentifierSerializer` gained the `chatId/eph/receiverUserChatId/ephemeralMessageId` string format. The nullable `receiverUserId` param of the 13 ephemeral-capable send requests still defaults from the passed `chatId` when it is an `EphemeralChatId`; `DeleteEphemeralMessage` and `EditEphemeralMessageText`/`EditEphemeralMessageCaption`/`EditEphemeralMessageMedia`/`EditEphemeralMessageReplyMarkup` instead keep `receiverUserId`/`ephemeralMessageId` REQUIRED on their primary constructor/factory form, gaining `EphemeralChatId`-taking secondary constructors/factory overloads that source both params from the identifier (throwing `IllegalArgumentException` if it carries no `ephemeralMessageId`)
* (`Communities`) Added `CommunityId` value class and `Community` type (`id`/`name`)
* (`Communities`) Added `CommunityChatAdded` (`community`) and `CommunityChatRemoved` (fieldless) chat events (`CommonEvent`); `RawMessage` parses `community_chat_added`/`community_chat_removed`
* (`Communities`) Added `community` field to `ExtendedChat` (`ChatFullInfo.community`), parsed for `ExtendedChannelChatImpl`, `ExtendedGroupChatImpl`, `ExtendedSupergroupChatImpl`, `ExtendedForumChatImpl`, `ExtendedChannelDirectMessagesChatImpl` and `ExtendedBot`
* (`Bot Subscriptions`) Added `BotSubscriptionUpdated` (`user`, `invoicePayload`, `state`) and `BotSubscriptionUpdatedUpdate`; `state` is modeled as the typed sealed `BotSubscriptionUpdated.State` (`Canceled`/`Active`/`Failed`, with an `Unknown` fallback), mirroring `TransactionType`
* (`Bot Subscriptions`) `RawUpdate` parses the new `subscription` field; added `UPDATE_SUBSCRIPTION` to `ALL_UPDATES_LIST_WITHOUT_REACTIONS`; `FlowsUpdatesFilter` gained `botSubscriptionUpdatedUpdatesFlow`
* `API`:
* (`Ephemeral Messages`) Threaded `receiverUserId`/`callbackQueryId` through the `sendXxx`/`send`/`reply`/`replyWithXxx` extensions for the 13 ephemeral-capable senders (`send/Sends.kt`, `send/Replies.kt`, `send/RepliesWithChatsAndMessages.kt` and their per-type extension files); `reply(to = ...)` now automatically sends an ephemeral reply when `to` is itself ephemeral (see Breaking changes)
* (`Ephemeral Messages`) Ephemeral-capable `reply(to = ...)` overloads gained `replyToEphemeralMessageId`, defaulting from `PossiblyEphemeralMessage.ephemeralMessageId`; direct and dispatcher overloads forward the explicit target into `ephemeralReplyParametersOrNull`
* (`Ephemeral Messages`) Added 48 ephemeral-only `reply`/`replyWithXxx` overloads in `RepliesWithEphemeral.kt` without a `ChatMessage`; each overload requires `replyInChatId`, `receiverUserId`, and `replyToEphemeralMessageId`, with complete content-form and dispatcher parity across the 13 ephemeral-capable senders
* (`Ephemeral Messages`) Added `editEphemeralMessageText`/`editEphemeralMessageMedia`/`editEphemeralMessageCaption`/`editEphemeralMessageReplyMarkup` and `deleteEphemeralMessage` `TelegramBot` extensions (the latter also accepts a `PossiblyEphemeralMessage` directly)
* (`Ephemeral Messages`) Added explicit `replyToEphemeral`/`replyToEphemeralWithXxx` `TelegramBot` extensions for the 13 ephemeral-capable senders, replying to an ephemeral message by `chatId`/`ephemeralMessageId` without requiring the original `Message` object
* (`Ephemeral Messages`) `receiverUserId`/`ephemeralMessageId` params of the edit/delete/`replyToEphemeral*` extensions remain REQUIRED on the `chatId: ChatIdentifier`/`chat: Chat` forms; each `chatId: ChatIdentifier` form additionally gained a convenience overload taking `chatId: EphemeralChatId` (dropping `receiverUserId`/`ephemeralMessageId`) that sources both from the identifier, throwing `IllegalArgumentException` if it carries no `ephemeralMessageId` (the `chat: Chat` forms got no such overload, since `Chat.id` is statically only an `IdChatIdentifier`); `Replies.kt`'s `receiverUserId` default now also checks `replyInChatId.receiverUser` before falling back to `to.ephemeralReplyReceiverUserIdOrNull`
* (`Ephemeral Messages`) Not covered by this iteration (follow-up): `createResend`/`ResendMessage` do not carry ephemeral fields (a resend is always a regular message); `handleLiveLocation` and the generic `reply(mediaFile = ...)`/`reply(content = ...)` dispatchers in `RepliesWithChatsAndMessages.kt`'s `copyMessage`/live-location branches are unaffected; `behaviour_builder` triggers/waiters gained no ephemeral-specific helpers
* `BehaviourBuilder`:
* (`Communities`) Added `onCommunityChatAdded`/`onCommunityChatRemoved` triggers
* (`Communities`) Added `waitCommunityChatAdded`/`waitCommunityChatRemoved` and `waitCommunityChatAddedEventsMessages`/`waitCommunityChatRemovedEventsMessages` expectations
* (`Bot Subscriptions`) Added `onBotSubscriptionUpdated` trigger, `waitBotSubscriptionUpdated` expectation and `ByUserBotSubscriptionUpdatedMarkerFactory`
* `Utils`:
* (`Rich Messages`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for the `InputRichBlock` hierarchy, `TelegramMediaVoiceNote` and `RichMessageMemberTelegramMedia`
* (`Ephemeral Messages`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for `EphemeralChatId` and `PossiblyEphemeralMessage`
* (`Communities`) Added generated class-cast extensions (`*OrNull`/`*OrThrow`/`if*`) for `CommunityChatAdded` and `CommunityChatRemoved`
* (`Bot Subscriptions`) Added class casts for `BotSubscriptionUpdatedUpdate` (`whenBotSubscriptionUpdatedUpdate`/`asBotSubscriptionUpdatedUpdate`/`requireBotSubscriptionUpdatedUpdate`); regenerated class casts extensions (`botSubscriptionUpdatedUpdateOrNull`/`OrThrow`, `botSubscriptionUpdatedOrNull`/`OrThrow`)
## 35.1.0
* `Dependencies`:
* `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)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
**Breaking changes**:
* Removed the `CommonMessage<T>` super-type — replaced by the new sealed `ChatContentMessage<T>` (`CommonContentMessage`, `ChatMessage`); code referencing `CommonMessage` in types, `when` branches or signatures must switch to `ChatContentMessage`
* Renamed casts `commonMessageOrNull`/`commonMessageOrThrow`/`ifCommonMessage` to `chatContentMessageOrNull`/`chatContentMessageOrThrow`/`ifChatContentMessage`
* Reworked the message hierarchy (`ContentMessage`, `Message`, `FromUserMessage`, `PossiblyEditedMessage`, `PossiblyForwardedMessage`, `PossiblyPaymentMessage`, `PossiblySentViaBotCommonMessage`, `PossiblyTopicMessage`, `SignedMessage`, `ChatEventMessage`, `PassportMessage`) and related typealiases — dependent type signatures may need updates
* Chat send/reply extensions now return `ChatContentMessage<*>` (previously `ContentMessage<*>`)
* `ChatPermissions` interface gained the abstract `canReactToMessages` member — custom implementations must add it
* `SendMessageDraft` no longer throws when the text length is out of range: it now logs a warning and validates against the new `draftMessageTextLength` (`0..textLength.last`) range, allowing empty text
* `pollOptionsLimit` changed from `2..12` to `1..12`
**Migration advice**: Replace `CommonMessage` usages with `ChatContentMessage`, `commonMessageOr` with `chatContentMessageOr`
* `Core`:
* (`Guest Mode`) Added `GuestQueryId` value class in `dev.inmo.tgbotapi.types` and `WithOptionalGuestQueryId` interface in `dev.inmo.tgbotapi.abstracts.types`
* (`Guest Mode`) Added `RequestGuestMessage` and `RequestGuestContentMessage<T>` message abstractions (`CommonContentMessage`, `SpecialMessage`, `FromUserMessage`, `PossiblySentViaBot`) exposing `guestQueryId`; added `PossiblyGuestAnswerMessage` exposing `guestBotCallerUser` and `guestBotCallerChat`
* (`Guest Mode`) Added `RequestGuestContentMessageImpl` data class implementing `RequestGuestContentMessage`
* (`Guest Mode`) Added `SentGuestMessage` carrying `InlineMessageId`
* (`Guest Mode`) Added `GuestMessageUpdate` (`BaseSentMessageUpdate`) and `guest_message` update type wiring in `RawUpdate`/`UpdateTypes`/`FlowsUpdatesFilter`
* (`Guest Mode`) Added `AnswerGuestQuery` request returning `SentGuestMessage`
* Introduced sealed `ChatContentMessage<T>` super-type extending `CommonContentMessage` and `ChatMessage`, used as the common return type of chat send/reply operations
* Reworked `ContentMessage`, `Message`, `FromUserMessage`, `PossiblyEditedMessage`, `PossiblyForwardedMessage`, `PossiblyPaymentMessage`, `PossiblySentViaBotCommonMessage`, `PossiblyTopicMessage`, `SignedMessage`, `ChatEventMessage`, `PassportMessage` and related typealiases to integrate guest messages and unify chat content messages
* Updated `RawMessage`, `MessageUpdate`, `ChannelPostUpdate`, `BusinessMessageUpdate`, `EditMessageUpdate`, `EditChannelPostUpdate`, `BaseMessageUpdate`, `BaseEditMessageUpdate`, `BaseSentMessageUpdate` to align with the new hierarchy
* (`Live Photos`) Added `LivePhotoFile` class representing the incoming `LivePhoto` Telegram type (`PollMedia`, `MediaContentVariant`, `UsefulAsPaidMediaFile`)
* (`Live Photos`) Added `LivePhotoContent` (`VisualMediaGroupPartContent`) representing live photo messages
* (`Live Photos`) Added `TelegramMediaLivePhoto` (`TelegramFreeMedia`, `VisualMediaGroupMemberTelegramMedia`, `InputPollMedia`, `InputPollOptionMedia`) — usable in `sendMediaGroup`, `editMessageMedia`, and polls
* (`Live Photos`) Added `TelegramPaidMediaLivePhoto` (`VisualTelegramPaidMedia`) for paid live photos
* (`Live Photos`) Added `PaidMedia.LivePhoto` variant and `PaidMedia.LivePhoto.toTelegramPaidMediaLivePhoto()` conversion
* (`Live Photos`) Added `livePhotoField` constant; added `live_photo` parsing to `RawMessage` and `ReplyInfo.External` surrogate
* (`Live Photos`) Added `SendLivePhoto` request and `SendLivePhotoData`/`SendLivePhotoFiles`
* (`Live Photos`) Added `LivePhotoMessage` typealias
* (`Live Photos`) Added `LivePhotoFile.toTelegramMediaLivePhoto(...)` and `LivePhotoFile.toTelegramPaidMediaLivePhoto()` extensions
* (`Chat Management`) Added `canReactToMessages` field to `ChatPermissions` (interface, `Granular` and `Common`) and `RestrictedMemberChatMember`
* (`Chat Management`) Added optional `retrieveOtherBots` parameter to `GetChatAdministrators` request
* (`Chat Management`) Added `DeleteMessageReaction` request with `@Warning` on primary constructor; added `DeleteUserMessageReaction` and `DeleteActorChatMessageReaction` factory functions
* (`Chat Management`) Added `DeleteAllMessageReactions` request with `@Warning` on primary constructor; added `DeleteAllUserMessageReactions` and `DeleteAllActorChatMessageReactions` factory functions
* (`Polls`) Added `TelegramMediaSticker`, `TelegramMediaLocation` and `TelegramMediaVenue` classes
* (`Polls`) Added `InputPollMedia` and `InputPollOptionMedia` sealed interfaces representing input media variants accepted by `sendPoll`
* (`Polls`) Added `PollMedia` class representing media attached to polls in incoming updates
* (`Polls`) Added `media` field to `Poll`, `PollOption` and `InputPollOption`
* (`Polls`) Added `explanationMedia` field to `QuizPoll`
* (`Polls`) Added `membersOnly` field to `Poll`
* (`Polls`) Added `countryCodes` field to `Poll`
* (`Polls`) Added `media`, `membersOnly`, `countryCodes` parameters to `SendRegularPoll` and `SendPoll` factory functions
* (`Polls`) Added `media`, `explanationMedia`, `membersOnly`, `countryCodes` parameters to `SendQuizPoll` factory functions
* (`Polls`) Decreased minimum allowed poll options count from 2 to 1 (`pollOptionsLimit` is now `1..12`)
* (`Managed Bots Access`) Added `BotAccessSettings` data class in `dev.inmo.tgbotapi.types.managed_bots` with `isAccessRestricted` and `addedUsers` fields
* (`Managed Bots Access`) Added `GetManagedBotAccessSettings` request returning `BotAccessSettings`
* (`Managed Bots Access`) Added `SetManagedBotAccessSettings` request with `userId` and optional `addedUserIds` (`isAccessRestricted` is derived from `addedUserIds`)
* (`Managed Bots Access`) Added `isAccessRestrictedField`, `addedUsersField`, `addedUserIdsField` constants
* (`Personal Chat`) Added `GetUserPersonalChatMessages` request returning `List<ChatContentMessage<*>>`
* (`Drafts`) `SendMessageDraft` now allows empty text via the new `draftMessageTextLength` (`0..textLength.last`) range and logs a warning instead of throwing when the text length is out of range
* `API`:
* (`Guest Mode`) Added `answerGuestQuery` extensions in `dev.inmo.tgbotapi.extensions.api.answers`
* (`Guest Mode`) Added `RepliesWithGuestQueryId.kt` reply extensions accepting `GuestQueryId`
* (`Guest Mode`) Updated reply/send extensions (`Replies`, `RepliesWithChatsAndMessages`, `Sends`, `ResendMessage`, `SendChecklist`, `SendContact`, `SendDice`, `SendLiveLocation`, `SendStaticLocation`, `SendVenue`, `SendMessage`, media `Send*`, `SendGame`, `SendInvoice`, `SendQuizPoll`, `SendRegularPoll`) to return `ChatContentMessage<*>` and align with the new hierarchy
* (`Live Photos`) Added `sendLivePhoto` extensions (`ChatIdentifier`/`Chat` × `InputFile`/`LivePhotoFile` × text/textSources)
* (`Chat Management`) Added optional `retrieveOtherBots` parameter to `getChatAdministrators` extensions
* (`Chat Management`) Added `deleteUserMessageReaction` and `deleteActorChatMessageReaction` extensions
* (`Chat Management`) Added `deleteAllUserMessageReactions` and `deleteAllActorChatMessageReactions` extensions
* (`Chat Management`) Added `@Warning`-marked catch-all `deleteMessageReaction` and `deleteAllMessageReactions` extensions
* (`Polls`) Added `media`, `membersOnly`, `countryCodes` parameters to `sendRegularPoll` extension
* (`Polls`) Added `media`, `explanationMedia`, `membersOnly`, `countryCodes` parameters to `sendQuizPoll` extension
* (`Managed Bots Access`) Added `getManagedBotAccessSettings` extension in `dev.inmo.tgbotapi.extensions.api.managed_bots`
* (`Managed Bots Access`) Added `setManagedBotAccessSettings` extension with `userId` and optional `addedUserIds`
* (`Personal Chat`) Added `getUserPersonalChatMessages` extension returning `List<ContentMessage<*>>`
* `Behaviour Builder`:
* (`Guest Mode`) Added `GuestMessageTriggers` with `onGuestRequestMessage` trigger
* (`Guest Mode`) Updated `WaitContent`, `WaitContentMessage`, `WaitEditedContentMessage`, `WaitMediaGroup`, `WaitMediaGroupMessages`, `WaitCommandsMessages`, `WaitDeepLinks`, `WaitMention`, `WaitMentionMessage`, `ContentTriggers`, `EditedContentTriggers`, `MediaGroupMessagesTriggers`, `MediaGroupTriggers`, `MentionTriggers`, `DeepLinkHandling`, `MessageFilterExcludingMediaGroups` for the unified `ChatContentMessage` hierarchy
* (`Live Photos`) Added `onLivePhoto`, `onEditedLivePhoto`, `onLivePhotoGalleryMessages`, `onLivePhotoGallery` triggers
* (`Live Photos`) Added `onMentionWithLivePhotoContent`/`onTextMentionWithLivePhotoContent` triggers
* (`Live Photos`) Added `waitLivePhoto`, `waitLivePhotoMessage`, `waitEditedLivePhoto`, `waitEditedLivePhotoMessage`, `waitLivePhotoGallery`, `waitLivePhotoGalleryMessages` expectations
* (`Live Photos`) Added `onlyLivePhotoContentMessages` utility
* `Utils`:
* (`Guest Mode`) Added `guestMessageUpdateOrNull` and related casts in `ClassCastsNew`
* (`Guest Mode`) Updated `MediaGroupContentMessageCreator` and `FlowsUpdatesFilter` to support guest messages
## 33.2.0
* `Core`:
* Add `ApiException` as variant of `BotException`
* Add classcasts for bots exceptions
## 33.1.0
* `Versions`:
* `Kotlin`: `2.3.10` -> `2.3.20`
* `Serialization`: `1.10.0` -> `1.11.0`
* `Ktor`: `3.4.1` -> `3.4.2`
* `MicroUtils`: `0.29.1` -> `0.29.2`
* `KSLog`: `1.6.0` -> `1.6.1`
## 33.0.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.6](https://core.telegram.org/bots/api-changelog#april-3-2026)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* **THIS IS BREAKING CHANGE** `MultipleAnswersPoll` removed; `RegularPoll` now directly implements `Poll`
* **THIS IS BREAKING CHANGE** `allowMultipleAnswers` renamed to `allowsMultipleAnswers` across poll types and requests
* **THIS IS BREAKING CHANGE** `QuizPoll.correctOptionId: Int?` changed to `correctOptionIds: List<Int>?`
* **THIS IS BREAKING CHANGE** `PollOption` is now a sealed interface with `PollOption.Simple` and `PollOption.LatelyAdded` subtypes; `SimplePollOption` removed
* **THIS IS BREAKING CHANGE** `PollAnswer.Anonymous.voterChat` type changed from `ChannelChat` to `PreviewPublicChat`
* **THIS IS BREAKING CHANGE** `requestChannelReplyButton` (group variant) renamed to `requestGroupReplyButton`
* Added `BotToken` value class
* Added `SavePreparedKeyboardButton` request with `PreparedKeyboardButton` and `PreparedKeyboardButtonId` types
* Added `GetManagedBotToken` and `ReplaceManagedBotToken` requests
* Added `KeyboardButtonRequestManagedBot` and `RequestManagedBotKeyboardButton`
* Added `ManagedBotCreated` chat event and `ManagedBotUpdated` type with `ManagedBotUpdate`
* Added `PollOptionPersistentId` value class
* Added `PollOptionAdded` and `PollOptionDeleted` chat events
* Added `pollOptionId` support in `ReplyParameters` (`reply_to_poll_option_id`)
* Added `canManageBots` to `ExtendedBot`
* Added `allowsRevoting`, `shuffleOptions`, `allowAddingOptions`, `hideResultsUntilCloses`, `description`/`descriptionTextSources` to poll types and send requests
* Added `chosenPersistentIds` to `PollAnswer`
* Added `UsernameAtLessSerializer`
* Extended `openPeriodPollSecondsLimit` from `5..600` to `5..2628000`
* Fixed quiz poll serialization type (was incorrectly using `regularPollType` in quiz branch)
* Fixed quiz poll explanation serialization (now correctly uses `explanation`/`explanationTextSources`)
* Fixed `SendQuizPoll` correct option index range validation (off-by-one)
* Several poll validation checks changed from throwing exceptions to logging warnings
* `API`:
* Added `savePreparedKeyboardButton` extensions
* Added `getManagedBotToken` and `replaceManagedBotToken` extensions
* Added optional `pollOptionId` parameter to `reply`/`replyWith*` extensions
* Updated `sendQuizPoll` extensions with `correctOptionIds`, `allowsMultipleAnswers`, `allowsRevoting`, `shuffleOptions`, `hideResultsUntilCloses`, `description` parameters
* Updated `sendRegularPoll` extensions with `allowsRevoting`, `shuffleOptions`, `allowAddingOptions`, `hideResultsUntilCloses`, `description` parameters
* `BehaviourBuilder`:
* Added `onManagedBotCreated` and `onManagedBotUpdated` triggers
* Added `onPollOptionAdded` and `onPollOptionDeleted` triggers
* Added `waitManagedBotCreatedEvents` and `waitManagedBotUpdated` expectations
* Added `waitPollOptionAddedEvents` and `waitPollOptionDeletedEvents` expectations
* Added `ManagedBotUpdatedFilterByUser` and `ByUserManagedBotUpdatedMarkerFactory`
* `Utils`:
* Added `managedBotCreationLink` formatting extensions
* Added `requestManagedBotButton` to `ReplyKeyboardBuilder`
* Added class casts for `ManagedBotUpdate`, `ManagedBotCreated`, `PollOptionAdded`, `PollOptionDeleted`
* Removed `MultipleAnswersPoll` class casts
* Updated raw poll accessors to match new model (`allowsMultipleAnswers`, `correctOptionIds`, `explanation`)
* Regenerated class casts extensions
* `WebApps`:
* Added `requestChat` support for `PreparedKeyboardButtonId`
* Fixed `iconCustomEmojiId` passing in `BottomButton`
## 32.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Version`:
* `Kotlin`: `2.2.21` -> `2.3.10`
* `Kotlin Serialization`: `1.9.0` -> `1.10.0`
* `Ktor`: `3.3.2` -> `3.4.1`
* `KSP`: `2.3.2` -> `2.3.6`
* `MicroUtils`: `0.26.9` -> `0.29.1`
* `KSLog`: `1.5.2` -> `1.6.0`
* `Core` + `API`:
* **BREAKING CHANGES: ALL METHODS THAT PREVIOUSLY RETURNED BOOLEAN NOW RETURNS UNIT**
* `Core`:
* **BREAKING CHANGE** `SetChatTitle` init do not throw error in case when `title.length` is outside of `chatTitleLength`
* **BREAKING CHANGE** `SetStickerEmojiList` init do not throw error in case when `emojis.size` is outside of `emojisInStickerLimit`
* **BREAKING CHANGE** `DeleteMessages` init do not throw error in case when title is `messageIds.size` of `deleteMessagesLimit`
* **BREAKING CHANGE** `ForwardMessages` init do not throw error in case when `messageIds.size` is outside of `forwardMessagesLimit`
* **BREAKING CHANGE** `CopyMessages` init do not throw error in case when `messageIds.size` is outside of `copyMessagesLimit`
* **BREAKING CHANGE** `SwitchInlineQueryChosenChat` init do not throw error in case when `messageIds.size` is outside of `copyMessagesLimit`
* **BREAKING CHANGE** `SetStickerKeywords` init do not throw error in case when there are errors in `keywords`
## 31.2.0
* `Core`:
* Potentially fix [#1027](https://github.com/InsanusMokrassar/ktgbotapi/issues/1027) - drop http request exceptions on getting updates
* `Core` + `API`:
* Add `supportsStreaming` in places it haven't been supported (fix of [#1026](https://github.com/InsanusMokrassar/ktgbotapi/issues/1026))
* **PARTIALLY BREAKING CHANGE** `supportStreaming` has been renamed to `supportsStreaming`
## 31.1.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.5](https://core.telegram.org/bots/api-changelog#march-1-2026)**
* `Core`:
* Added `UserTag` value class and `senderTag` field to messages
* Added `SetChatMemberTag` request and `UserTag` support in `PromoteChatMember` and `ChatPermissions`
* Added `DateTimeTextSource` for `tg://time` links support
* Added `DateTimeFormatPart` and `TgDateTimeFormatBuilder` for building date-time format strings
* Added `UnitFromBooleanSerializer`
* `API`:
* Added `setChatMemberTag` extensions
* `Utils`:
* Added `dateTime` and `dateTimeln` extensions to `EntitiesBuilder`
* Added `dateTimeMarkdown`, `dateTimeMarkdownV2`, and `dateTimeHTML` string formatting extensions
* Regenerated class casts extensions
* `WebApps`:
* Added `iconCustomEmojiId` support to `BottomButton` and `BottomButtonParams`
## 31.0.1
* `Core`:
* In `StarTransaction` property `nanostarAmount` become nullable
## 31.0.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.3](https://core.telegram.org/bots/api-changelog#december-31-2025)**
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.4](https://core.telegram.org/bots/api-changelog#february-9-2026)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Version`:
* `MicroUtils`: `0.26.8` -> `0.26.9`
* `Core`:
* **THIS IS BREAKING CHANGE** All media files with sizes changed type of `fileSize` field from `Long` to `FileSize` (value class)
* **THIS IS BREAKING CHANGE** Class `GiftSentOrReceived` have been renamed to `GiftSentOrReceivedEvent` to clarify naming
* **THIS IS BREAKING CHANGE** New interface `OwnedGift` have been created
* **THIS IS BREAKING CHANGE** `OwnedGifts` have changed its generic type to `OwnedGift`
* **THIS IS BREAKING CHANGE** For `CheclistTask` have been made several changes:
* `ChecklistTask.Done` -> `ChecklistTask.Completed`
* `ChecklistTask.Undone` -> `ChecklistTask.Uncompleted`
* Added several inheritors of `ChecklistTask.Completed` - for completed by chat, by user or just completed tasks
* **THIS IS BREAKING CHANGE** `PrivateChat.id` type changed from `UserId` to `IdChatIdentifier`
* **THIS IS BREAKING CHANGE** `ForumChat` no longer extends `SupergroupChat`; new `SupergroupForumChat` interface created for supergroup forums
* **THIS IS BREAKING CHANGE** Added `PrivateForumChat` and `PrivateUserChat` interfaces to support private forums
* Added support of private forums (`ExtendedPrivateForumChatImpl`, `PrivateForumContentMessage`, `PrivateForumEventMessage`)
* Added `ChatOwnerChanged` and `ChatOwnerLeft` chat events
* Added `SetMyProfilePhoto` and `RemoveMyProfilePhoto` requests
* Added `GetUserProfileAudios` request and `UserProfileAudios` type
* Added `GetChatGifts` and `GetUserGifts` requests
* Added `RepostStory` request
* Added `SendMessageDraft` request with `DraftId` and `DraftIdAllocator`
* Added `KeyboardButtonStyle` support and `iconCustomEmojiId` field to keyboard buttons
* Added `style` and `iconCustomEmojiId` fields to `InlineKeyboardButton`
* Added `VideoCodec` and `VideoQuality` types
* Added `Rarity`, `GiftBackground`, `UniqueGiftName`, and `UniqueGiftColors` types for gifts
* Added new fields to `Gift.Regular`: `personalTotalCount`, `personalRemainingCount`, `isPremium`, `hasColors`, `background`, `uniqueGiftVariantCount`
* Added `isBurned` field support in `GiftSentOrReceivedEvent`
* Added `UserRating` type and `rating` field to `ExtendedPrivateChat`
* Added `Level` and `Rating` value classes
* Added `uniqueGiftColors` field to extended chats (channel, group, private)
* Added `paidMessageStarCount` field to `ExtendedGroupChat` and `ExtendedPrivateChat`
* Added `firstProfileAudio` field to `ExtendedPrivateChat`
* Added `purchased_paid_media` to updates list
* Added `effectId` support in `CopyMessage` and `ForwardMessage`
* Added `WithOptionalPaidMessageStarCount` interface
* Fixed serialization of `SimpleKeyboardButton`
* Fixed support of `paidMessageStarCount`
* `API`:
* Added extensions for `SetMyProfilePhoto`, `RemoveMyProfilePhoto`, `GetUserProfileAudios`
* Added extensions for `GetChatGifts` and `GetUserGifts`
* Added extensions for `RepostStory`
* Added extensions for `SendMessageDraft`
* Added `effectId` parameter to `copyMessage` and `forwardMessage` extensions
* Added `GetBusinessAccountGifts` extensions improvements
* `BehaviourBuilder`:
* Updated event triggers for new chat events (`ChatOwnerChanged`, `ChatOwnerLeft`, private forum events)
* Updated expectations for new event types
* `Utils`:
* Regenerated class casts extensions
* Updated `InlineKeyboardBuilder` and `ReplyKeyboardBuilder` with `style` and `iconCustomEmojiId` support
## 30.0.2
* `Version`:
* `Kotlin`: `2.2.20` -> `2.2.21`
* `Ktor`: `3.3.1` -> `3.3.2`
* `KSP`: `2.2.20-2.0.4` -> `2.3.2`
* `MicroUtils`: `0.26.6` -> `0.26.8`
* `KSLog`: `1.5.1` -> `1.5.2`
* `Core`:
* Allow to use `SetWebhook` with `maxAllowedConnections` up to `100000` (fix of [#1019](https://github.com/InsanusMokrassar/ktgbotapi/issues/1019))
* `KSP`:
* Fixed annotation property access for KSP2 compatibility using `withNoSuchElementWorkaround`
* Removed `ksp.useKSP2=false` workaround from `gradle.properties` (KSP2 is now properly supported)
* `Utils`:
* Regenerated class casts extensions
* Allow to use custom `GetUpdates` in `longPollingFlow`
## 30.0.1
* `Core`:
* Potential fix of [#989](https://github.com/InsanusMokrassar/ktgbotapi/issues/989) by:
* In long polling have been added check for causing by unresolved address exception
* Add `TelegramBotPipelinesHandler.onRequestExceptionInLimiter` which will be triggered in ANY exception during
request execution
## 30.0.0
**THIS UPDATE MAY CONTAINS BREAKING CHANGES**
* `Version`:
* `Kotlin`: `2.2.10` -> `2.2.20`
* `Ktor`: `3.2.3` -> `3.3.1`
* `MicroUtils`: `0.26.3` -> `0.26.6`
* `KSLog`: `1.5.0` -> `1.5.1`
* `BehaviourBuilder`:
* `DefaultCustomBehaviourContextAndTypeReceiver` now extends `suspend (BC, U) -> R` instead of `CustomBehaviourContextAndTypeReceiver<BC, R, U>` (no changes in api in fact)
## 29.0.1
* `Core`:
* Fix of [#917](https://github.com/InsanusMokrassar/ktgbotapi/issues/917): all `OrderInfo` fields now have defaults nulls
## 29.0.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.2](https://core.telegram.org/bots/api-changelog#august-15-2025)**
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* Add function `firstOfOrNull(vararg suspend () -> T): T?`
* Change logic of `firstOf` - now it works based on merged flows and __do not require__ `CoroutineScope` as receiver
## 28.0.3
* `Core`:
* Add passing of default engines in `HttpClient` constructors
## 28.0.2
* `Core`:
* [#1001](https://github.com/InsanusMokrassar/ktgbotapi/issues/1001) - `[Bug] Invalid detection of isCausedByCancellation()`
* [#1002](https://github.com/InsanusMokrassar/ktgbotapi/issues/1002) - `Unable to handle UnauthorizedException with buildBehaviourWithLongPolling`
## 28.0.1
* `Version`:
* `Kotlin`: `2.2.0` -> `2.2.10`
* `MicroUtils`: `0.26.2` -> `0.26.3`
* `Ktor`: `3.2.2` -> `3.2.3`
* `Core`:
* Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing
## 28.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES**
* `Core`:
* Add `firstOf` extension
* `BehaviourBuilder`:
* All builders for behaviours got boolean `useDefaultSubcontextInitialAction`
* Add opportunity to pass `BehaviourContextData` in `DefaultBehaviourContext` constructor and `copy` method
* By default, commands to other bots will be ignored in triggers and waiters
## 27.1.2
* `Core`:
* Try to fix cancelling on timeout for long polling
* Since this update phrase `Something web wrong` will not happen from this library 😭
## 27.1.1
* `Version`:
* `MicroUtils`: `0.26.1` -> `0.26.2`
* `Core`:
* Make `BusinessLocation#location` optional (fix of [#990](https://github.com/InsanusMokrassar/ktgbotapi/issues/990))
## 27.1.0
* `Core`:
* Improve support of local bot api servers files. Next call factories will try to resolve file locally before real call:
* [DownloadFileRequestCallFactory.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DownloadFileRequestCallFactory.kt) (for [DownloadFile.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/DownloadFile.kt) as well)
* [DownloadFileChannelRequestCallFactory.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/DownloadFileChannelRequestCallFactory.kt) (for [DownloadFileStream.kt](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/DownloadFileStream.kt) as well)
## 27.0.0
**THIS UPDATE MAY CONTAIN BREAKING CHANGES. IN CASE OF ANY MIGRATION PROBLEMS FEEL FREE TO ASK IN [OUR CHAT](https://t.me/ktgbotapi_chat)**
* `Version`:
* `Kotlin`: `2.1.20` -> `2.2.0`
* `Serialization`: `1.8.1` -> `1.9.0`
* `Ktor`: `3.1.3` -> `3.2.2`
* `MicroUtils`: `0.25.7` -> `0.26.1`
* `KSLog`: `1.4.1` -> `1.5.0`
* `Common`:
* In most `data` classes with non-public constructors has been added `ConsistentCopyVisibility` annotation, preventing
public nature in difference with constructor
* Absence of several API methods for requests has been fixed
## 26.1.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.1](https://core.telegram.org/bots/api-changelog#july-3-2025)**
**THIS UPDATE _MAY_ CONTAINS BREAKING CHANGES**
## 26.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES IN BEHAVIOUR BUILDER AND CORE. BE CAREFUL ON UPDATE**
* `Version`:
* `Serialization`: `1.8.0` -> `1.8.1`
* `Coroutines`: `1.10.1` -> `1.10.2`
* `Ktor`: `3.1.1` -> `3.1.3`
* `MicroUtils`: `0.25.3` -> `0.25.7`
* `Core`:
* **POTENTIALLY BREAKING CHANGE** Long polling has been reworked a bit
* **BREAKING CHANGE** `RequestsExecutor` got property `RequestsExecutor.Log: KSLog`
* `BehaviourContext`:
* **BREAKING CHANGE** All triggers and waiters become non-suspend functions
* **BREAKING CHANGE** Behaviour of counted extensions (commands, data callback queries, etc.) has been changed a bit: now each one will
create subcontext and work in it
* New extension `BehaviourContext.launchInNewSubContext` which will launch some job in subcontext of receiver
## 25.0.1
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 9.0](https://core.telegram.org/bots/api-changelog#april-11-2025)**
* `Core`:
* Previously named `Gift` now presented by `Gift.Regular`
* Fixes in `MultipartRequestCallFactory` for correct handling of all `MultipartRequest.Common` inheritors
* `Username` now can be safely created with `Username.prepare`
* Add extensions `String.splitFor(Text|Caption|StoryCaption)` for preparing several texts for several
messages/captions/story captions
## 24.0.2
* `Version`:
* `Kotlin`: `2.1.10` -> `2.1.20`
* `Ktor`: `3.1.0` -> `3.1.1`
* `MicroUtils`: `0.24.7` -> `0.25.3`
* `DefaultKTgBotAPIKSLog` will drop `CancellationException`s by default
* You may configure `DefaultKTgBotAPIKSLog` in simple way with `SetDefaultKTgBotAPIKSLog`
* `BehaviourBuilder`:
* `FSM`:
* Fix chains cancelling on their ends
## 24.0.1
* `Core`:
* Now you may upload photos with `EditChatMessageMedia`
## 24.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES IN `subcontextUpdatesFilter` WORK. TAKE CARE IN MIGRATION**
* `Version`:
* `MicroUtils`: `0.24.6` -> `0.24.7`
* `Core`:
* `ForumContentMessage` got property `threadCreatingInfo` which represents information about topic where message has been sent
* `BehaviourBuilder`:
* Fix of overall `subcontextUpdatesFilter` behaviour. In fact, this update will fix its affection on scenaries
## 23.2.1
* `Core`:
* Fix of `year` field in `Birthdate`
## 23.2.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 8.3](https://core.telegram.org/bots/api-changelog#february-12-2025)**
* `Version`:
* `MicroUtils`: `0.24.5` -> `0.24.6`
* `Ktor`: `3.0.3` -> `3.1.0`
## 23.1.2
* `Version`:
* `Kotlin`: `2.1.0` -> `2.1.10`
* `Serialization`: `1.7.3` -> `1.8.0`
* `MicroUtils`: `0.24.4` -> `0.24.5`
* `KSLog`: `1.4.0` -> `1.4.1`
## 23.1.1
* `Version`:
* `MicroUtils`: `0.24.0` -> `0.24.4`
* `Core`:
* Replace `removeFirst` with `removeAt(0)` in `createTextSources`
## 23.1.0
**THIS UPDATE CONTAINS ADDING SUPPORT OF [Telegram Bots API 8.2](https://core.telegram.org/bots/api-changelog#january-1-2025)**
## 23.0.0
* `Version`:
* `Coroutines`: `1.9.0` -> `1.10.1`
* `MicroUtils`: `0.23.2` -> `0.24.0`
* `KSLog`: `1.3.6` -> `1.4.0`
* `Ktor`: `3.0.2` -> `3.0.3`
* `Core`:
* All old factory methods for `TextSource`s took suffix `TextSource`. For example: `regular` -> `regularTextSource`.
That has been for excluding names resolution ambiguity with extensions for `EntitiesBuilder`
## 22.0.0
**THIS UPDATE CONTAINS BREAKING CHANGES**
**IN THIS UPDATE HAS BEEN REWORKED EVENTS API IN WEBAPPS**
**THIS UPDATE ADDING SUPPORT OF [BOT API 8.0](https://core.telegram.org/bots/api-changelog#november-17-2024) AND [BOT API 8.1](https://core.telegram.org/bots/api-changelog#december-4-2024)**
* `Version`:
* `MicroUtils`: `0.23.1` -> `0.23.2`
* `Ktor`: `3.0.1` -> `3.0.2`
## 21.0.1
* `Core`:
@@ -20,9 +705,9 @@ due to its redundancy
* `BehaviourBuilder`:
* Add special `val data: BehaviourContextData` into all realizations of `BehaviourContext`
* Add `CombinedSubcontextInitialAction` and functions
`buildSubcontextInitialAction`/`buildSubcontextInitialActionWithSubActions`
`buildSubcontextInitialAction`/`buildSubcontextInitialActionWithSubActions`
* Add `subcontextInitialAction` for all the functions-builders of `BehaviourContext` and
`additionalSubcontextInitialAction` to all triggers
`additionalSubcontextInitialAction` to all triggers
## 20.0.1
+18 -1
View File
@@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.11-blue)](https://core.telegram.org/bots/api-changelog#october-31-2024)
# 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.3-blue)](https://core.telegram.org/bots/api-changelog#august-24-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) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
@@ -120,3 +120,20 @@ suspend fun main() {
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
always welcome in our [docs](https://docs.inmo.dev/tgbotapi/index.html) and
[chat](https://t.me/InMoTelegramBotAPIChat).
### Bot API Server Notice
Under the hood, default bots realizations will try to use links
([PathedFile](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt)#filePath) as files each
time you are trying to download file from telegram in any way - via saving to file, use stream or download as byte array.
To let bot correctly download files from bot api server, you must:
* Run bot api server locally
to proxy requests for files to the server where bot api server has been hosted
* In case of local bot api server (shared one host machine) you must ensure that access to bot api server has been
granted for your bot. For example, [aiogram/telegram-bot-api](https://hub.docker.com/r/aiogram/telegram-bot-api) image
use `101` UID/GID in linux for user and group as owners. So, your bot must run under user included in `101` group
(like `systemd-journal`) or be `101` UID user (like `systemd-resolve`)
* **OR** Use some reverse proxy (like nginx). It will allow you to broadcast your bots files without linux rights problems
* Set [TelegramAPIUrlsKeeper](tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramAPIUrlsKeeper.kt)#fileLinkUrlMapper
to map urls to let bot execute requests to your nginx proxy
+76
View File
@@ -0,0 +1,76 @@
FOLLOW COMMON CODE STYLE. DO NOT COMMIT OR PUSH ANY CHANGES IF PROMPT DO NOT CONTAINS DIRECT INSTRUCTION ABOUT IT. FOLLOW LINKS TO SEE DOCUMENTATION IN THE PROMPT. IF YOU ARE NOT ABLE TO FOLLOW LINK (DO NOT SEE CONTENT YOU NEED TO FOLLOW PROMPT) - ASK OPERATOR
---
`@Warning` package is `dev.inmo.micro_utils.common.Warning`. Its signature: `Warning(val message: String)`
---
If you have edited some constructor or function signature - you MUST update documentation accordingly AND all calls of this constructor/function. THIS RULE WORKS RECURSIVELY
---
Before any laucnhing of `compileKotlinJvm` or other building procedure which must confirm that build is working, you MUST launch two tasks: `./gradlew kspCommonMainKotlinMetadata` and `./gradlew apiDump`. Order is important. They must be launched sequentially.
---
If you are adding `Send*` request - you also must add in `API` (`tgbotapi.api`) module:
* Direct indings (in `tgbitapi.api` module). As example you may look at `dev.inmo.tgbotapi.requests.send.SendTextMessage` a,d its bindings `dev.inmo.tgbotapi.extensions.api.send.sendTextMessage`
* Bindings in [Sends.kt](../tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt)
* Bindings in [Replies.kt](../tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt)
* Bindings in [RepliesWithChatsAndMessages.kt](../tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt)
---
When you need to fill a changelog, you must follow the common changelog style:
```markdown
## 34.0.0 // number of version
* `Core`:
* // list of changes
* `Utils`:
* // list of changes
* `API`:
* // list of changes
* `BehaviourBuilder`:
* // list of changes
* `WebApps`:
* // list of changes
* `BehaviourBuilderWithFSM`:
* // list of changes
// etc...
```
Each section can be ommited if there are no any changes in the section. In case of filling some known telegram bots api changelog part - you may add previx with its title in point with change. For example:
```markdown
* `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.
---
Any type representing an enumerable set of values MUST be implemented as a sealed interface. Every inheritor MUST be declared inside the sealed interface. The sealed interface MUST define the serializer, and every inheritor MUST explicitly use the sealed-interface serializer (for example, `@Serializable(Parent.Serializer::class)`).
---
All work MUST be performed in the normal (main) working worktree of the repository. DO NOT create or do the work inside a separate worktree (for example `.claude/worktrees/...`): commits made there leave the main checkout behind and force an extra fast-forward/pull to land the changes. If some environment forces an isolated worktree, fast-forward the main branch onto those commits and continue in the main worktree.
---
When a prompt contains a list of several subtasks, run each subtask as its own subagent (one subagent per subtask) instead of doing all of them inline in the main thread.
---
For any substantial change, drive it through a three-phase agent pipeline, each phase run as its own subagent(s), and each section/subtask committed separately:
1. **Plan / Architect** the changes — model range best → medium, best is the most suitable.
2. **Coding / implementation** — model range medium → high, medium is the most suitable.
3. **Check / validation** — model range high → best, high is the most suitable.
Model tiers: **best = Fable**, **high = Opus**, **medium = Sonnet**. (Tier names, not the concrete models, are the contract — remap the models if the roster changes.)
+37 -13
View File
@@ -1,8 +1,8 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
mavenLocal()
}
dependencies {
@@ -18,18 +18,38 @@ plugins {
alias(libs.plugins.kotlin.dokka)
alias(libs.plugins.versions)
alias(libs.plugins.validator)
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 {
centralPortal {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
validationTimeout = Duration.ofSeconds(0)
publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
}
publishAllProjectsProbablyBreakingProjectIsolation()
}
}
// temporal crutch until legacy tests will be stabled or legacy target will be removed
allprojects {
repositories {
mavenLocal()
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
mavenCentral()
google()
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
mavenLocal()
}
if (it != rootProject.findProject("docs")) {
tasks.whenTaskAdded { task ->
tasks.configureEach { task ->
if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") {
task.enabled = false
}
@@ -39,21 +59,25 @@ 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()
}
if (new File(projectDir, "secret.gradle").exists()) {
apply from: './secret.gradle'
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
def secretFile = new File(projectDir, "secret.gradle")
if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (githubTokenVariableFromEnv != "" && githubTokenVariableFromEnv != null)) {
if (secretFile.exists()) {
apply from: './secret.gradle'
}
apply plugin: "com.github.breadmoirai.github-release"
def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv
githubRelease {
token "${project.property('GITHUB_RELEASE_TOKEN')}"
token githubReleaseToken
owner = "InsanusMokrassar"
repo = "TelegramBotAPI"
+5 -12
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/tree/master"))
remoteUrl.set(new URI("https://github.com/InsanusMokrassar/ktgbotapi"))
remoteLineSuffix.set("#L")
}
}
@@ -73,6 +69,3 @@ Object callback = {
}
}
}
tasks.dokkaGfm(callback)
tasks.dokkaHtml(callback)
+10
View File
@@ -15,3 +15,13 @@ allprojects {
}
}
}
tasks.register("getPublishableModules") {
doLast {
rootProject.subprojects.each { project ->
if (project.plugins.hasPlugin('maven-publish')) {
println(":${project.name}")
}
}
}
}
+1 -1
View File
@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true
library_group=dev.inmo
library_version=21.0.1
library_version=37.1.0
+20 -11
View File
@@ -1,27 +1,28 @@
[versions]
kotlin = "2.1.0"
kotlin-serialization = "1.7.3"
kotlin-coroutines = "1.9.0"
kotlin = "2.4.21"
kotlin-serialization = "1.11.0"
kotlin-coroutines = "1.11.0"
javax-activation = "1.1.1"
korlibs = "5.4.0"
uuid = "0.8.4"
ktor = "3.0.1"
ktor = "3.6.0"
ksp = "2.1.0-1.0.29"
kotlin-poet = "1.18.1"
ksp = "2.3.11"
kotlin-poet = "2.4.0"
microutils = "0.23.1"
kslog = "1.3.6"
microutils = "0.32.0"
kslog = "2.1.0"
versions = "0.51.0"
versions = "0.65.0"
github-release-plugin = "2.5.2"
dokka = "1.9.20"
dokka = "2.2.0"
validator = "0.16.3"
validator = "0.18.2"
nmcp = "1.6.2"
[libraries]
@@ -36,6 +37,8 @@ kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref =
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }
@@ -57,6 +60,11 @@ microutils-serialization-mapper = { module = "dev.inmo:micro_utils.serialization
microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" }
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
microutils-ksp-generator = { module = "dev.inmo:micro_utils.ksp.generator", version.ref = "microutils" }
microutils-ksp-sealed = { module = "dev.inmo:micro_utils.ksp.sealed", version.ref = "microutils" }
microutils-ksp-sealed-generator = { module = "dev.inmo:micro_utils.ksp.sealed.generator", version.ref = "microutils" }
microutils-ksp-variations = { module = "dev.inmo:micro_utils.ksp.variations", version.ref = "microutils" }
microutils-ksp-variations-generator = { module = "dev.inmo:micro_utils.ksp.variations.generator", version.ref = "microutils" }
kslog = { module = "dev.inmo:kslog", version.ref = "kslog" }
@@ -81,3 +89,4 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "validator" }
nmcp-aggregation = { id = "com.gradleup.nmcp.aggregation", version.ref = "nmcp" }
+3
View File
@@ -4,6 +4,9 @@ project.group = "$group"
apply from: "$mpp_publish"
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
js (IR) {
browser()
nodejs()
@@ -2,6 +2,9 @@ project.version = "$library_version"
project.group = "$library_group"
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-parameters")
}
jvm {
compilations.main {
kotlinOptions {
+40 -47
View File
@@ -19,59 +19,52 @@ publishing {
}
developers {
developer {
id = "InsanusMokrassar"
name = "Ovsiannikov Aleksei"
email = "ovsyannikov.alexey95@gmail.com"
}
developer {
id = "InsanusMokrassar"
name = "Ovsiannikov Aleksei"
email = "ovsyannikov.alexey95@gmail.com"
}
}
licenses {
license {
name = "Apache Software License 2.0"
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
}
license {
name = "Apache Software License 2.0"
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
}
}
}
repositories {
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
credentials {
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
}
}
repositories {
if ((project.hasProperty('GITHUB_USER') || System.getenv('GITHUB_USER') != null) && (project.hasProperty('GITHUB_TOKEN') || System.getenv('GITHUB_TOKEN') != null)) {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi")
credentials {
username = project.hasProperty('GITHUB_USER') ? project.property('GITHUB_USER') : System.getenv('GITHUB_USER')
password = project.hasProperty('GITHUB_TOKEN') ? project.property('GITHUB_TOKEN') : System.getenv('GITHUB_TOKEN')
}
}
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
maven {
name = "InmoNexus"
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
credentials {
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
}
}
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
maven {
name = "InmoNexus"
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
credentials {
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
}
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
}
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
maven {
name = "sonatype"
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
credentials {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
}
}
}
@@ -80,13 +73,13 @@ publishing {
if (project.hasProperty("signing.gnupg.keyName")) {
apply plugin: 'signing'
signing {
useGpgCmd()
sign publishing.publications
}
task signAll {
tasks.withType(Sign).forEach {
dependsOn(it)
+1 -1
View File
@@ -1 +1 @@
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.UsernameAndPassword","usernameProperty":"GITHUB_USER","passwordProperty":"GITHUB_TOKEN"}},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/ktgbotapi","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.UsernameAndPassword","usernameProperty":"GITHUB_USER","passwordProperty":"GITHUB_TOKEN"}},{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"},"includeCentralSonatypeUploadingScript":false}}
Binary file not shown.
+3 -1
View File
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
Vendored
+197 -118
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" "$@"
Vendored
+44 -34
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
+1 -7
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
+7
View File
@@ -2,6 +2,7 @@ plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "org.jetbrains.dokka"
id "com.google.devtools.ksp"
}
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
@@ -14,6 +15,7 @@ kotlin {
commonMain {
dependencies {
api project(":tgbotapi.core")
api libs.microutils.ksp.variations
}
}
configureEach {
@@ -22,3 +24,8 @@ kotlin {
}
explicitApi()
}
dependencies {
add("kspCommonMainMetadata", libs.microutils.ksp.variations.generator)
}
@@ -12,10 +12,11 @@ import io.ktor.client.engine.*
* @param ktorClientEngine Engine like [io.ktor.client.engine.cio.CIO]
* @param ktorClientConfig Config block for preconfiguring of bot [HttpClient]
*/
@ConsistentCopyVisibility
public data class BotBuilder internal constructor(
var proxy: ProxyConfig? = null,
var ktorClientEngineFactory: HttpClientEngineFactory<HttpClientEngineConfig>? = null,
var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null
var ktorClientConfig: (HttpClientConfig<*>.() -> Unit) ? = null,
) {
internal fun createHttpClient(): HttpClient = ktorClientEngineFactory ?.let {
HttpClient(
@@ -41,8 +42,14 @@ public fun buildBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
block: BotBuilder.() -> Unit
): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
BotBuilder().apply(block).createHttpClient()
urlsKeeper = TelegramAPIUrlsKeeper(
token = token,
testServer = testServer,
hostUrl = apiUrl,
fileLinkUrlMapper = fileLinkUrlMapper
),
client = BotBuilder().apply(block).createHttpClient()
)
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.ktor.telegramBot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.defaultKtorEngine
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
@@ -13,7 +14,7 @@ import io.ktor.client.engine.*
*/
public fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient = HttpClient()
client: HttpClient = HttpClient(defaultKtorEngine)
): TelegramBot = telegramBot(urlsKeeper) {
this.client = client
}
@@ -63,22 +64,24 @@ public inline fun telegramBot(
* Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client]
*/
@Suppress("NOTHING_TO_INLINE")
public inline fun telegramBot(
public fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
client: HttpClient = HttpClient()
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client)
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
client: HttpClient = HttpClient(defaultKtorEngine)
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper), client)
@Suppress("NOTHING_TO_INLINE")
public inline fun <T: HttpClientEngineConfig> telegramBot(
public fun <T: HttpClientEngineConfig> telegramBot(
token: String,
clientFactory: HttpClientEngineFactory<T>,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<T>.() -> Unit = {}
): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientFactory,
clientConfig
)
@@ -87,15 +90,15 @@ public inline fun <T: HttpClientEngineConfig> telegramBot(
* Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally
* configure [HttpClient] using [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
public inline fun telegramBot(
public fun telegramBot(
token: String,
clientEngine: HttpClientEngine,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<*>.() -> Unit = {}
): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientEngine,
clientConfig
)
@@ -104,13 +107,13 @@ public inline fun telegramBot(
* Allows to create bot using bot [token] and [apiUrl] and specify [HttpClientEngine] by configuring [HttpClient] using
* [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
public inline fun telegramBot(
public fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
clientConfig: HttpClientConfig<*>.() -> Unit
): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl, fileLinkUrlMapper),
clientConfig
)
@@ -3,5 +3,4 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.local.Close
@Suppress("unused")
public suspend inline fun TelegramBot.close(): Boolean = execute(Close)
public suspend inline fun TelegramBot.executeClose(): Unit = execute(Close)
@@ -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")
)
@@ -12,42 +12,42 @@ import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
public suspend fun TelegramBot.deleteMessage(
chatId: ChatIdentifier,
messageId: MessageId
): Boolean = execute(
): Unit = execute(
DeleteMessage(chatId, messageId)
)
public suspend fun TelegramBot.deleteMessage(
chat: Chat,
messageId: MessageId
): Boolean = deleteMessage(chat.id, messageId)
): Unit = deleteMessage(chat.id, messageId)
public suspend fun TelegramBot.deleteMessage(
message: AccessibleMessage
): Boolean {
): Unit {
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
if (mediaGroupContent == null) {
return deleteMessage(message.chat, message.messageId)
deleteMessage(message.chat, message.messageId)
} else {
return mediaGroupContent.group.map {
mediaGroupContent.group.forEach {
deleteMessage(it.sourceMessage)
}.all { it }
}
}
}
public suspend fun TelegramBot.delete(
chatId: ChatIdentifier,
messageId: MessageId
): Boolean = deleteMessage(chatId, messageId)
): Unit = deleteMessage(chatId, messageId)
public suspend fun TelegramBot.delete(
chat: Chat,
messageId: MessageId
): Boolean = deleteMessage(chat, messageId)
): Unit = deleteMessage(chat, messageId)
public suspend fun TelegramBot.delete(
message: AccessibleMessage
): Boolean = deleteMessage(message)
): Unit = deleteMessage(message)
public suspend fun AccessibleMessage.delete(
requestsExecutor: TelegramBot
): Boolean = requestsExecutor.deleteMessage(this)
): Unit = requestsExecutor.deleteMessage(this)
@@ -10,52 +10,52 @@ import kotlin.jvm.JvmName
public suspend fun TelegramBot.deleteMessages(
chatId: ChatIdentifier,
messageIds: List<MessageId>
): Boolean = messageIds.chunked(deleteMessagesLimit.last).map {
): Unit = messageIds.chunked(deleteMessagesLimit.last).forEach {
execute(
DeleteMessages(
chatId = chatId,
messageIds = it
)
)
}.all { it }
}
public suspend fun TelegramBot.deleteMessages(
chatId: ChatIdentifier,
messageIds: Array<MessageId>
): Boolean = deleteMessages(
): Unit = deleteMessages(
chatId = chatId,
messageIds = messageIds.toList()
)
public suspend fun TelegramBot.deleteMessages(
messagesMetas: List<Message.MetaInfo>
): Boolean = messagesMetas.groupBy { it.chatId }.map { (chatId, messages) ->
): Unit = messagesMetas.groupBy { it.chatId }.forEach { (chatId, messages) ->
deleteMessages(
chatId = chatId,
messageIds = messages.map { it.messageId }
)
}.all { it }
}
@JvmName("deleteMessagesWithMessages")
public suspend fun TelegramBot.deleteMessages(
messages: List<AccessibleMessage>
): Boolean = deleteMessages(messages.map { it.metaInfo })
): Unit = deleteMessages(messages.map { it.metaInfo })
public suspend fun TelegramBot.delete(
chatId: ChatIdentifier,
messageIds: List<MessageId>
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
): Unit = deleteMessages(chatId = chatId, messageIds = messageIds)
public suspend fun TelegramBot.delete(
chatId: ChatIdentifier,
messageIds: Array<MessageId>
): Boolean = deleteMessages(chatId = chatId, messageIds = messageIds)
): Unit = deleteMessages(chatId = chatId, messageIds = messageIds)
public suspend fun TelegramBot.delete(
messagesMetas: List<Message.MetaInfo>
): Boolean = deleteMessages(messagesMetas)
): Unit = deleteMessages(messagesMetas)
@JvmName("deleteWithMessages")
public suspend fun TelegramBot.delete(
messages: List<AccessibleMessage>
): Boolean = deleteMessages(messages)
): Unit = deleteMessages(messages)
@@ -3,11 +3,15 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.ForwardMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.DirectMessageThreadId
import dev.inmo.tgbotapi.types.EffectId
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage
import dev.inmo.tgbotapi.types.directMessageThreadId
import dev.inmo.tgbotapi.types.threadId
public suspend fun TelegramBot.forwardMessage(
@@ -15,10 +19,23 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = execute(
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
ForwardMessage(
fromChatId = fromChatId,
toChatId = toChatId,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
)
public suspend fun TelegramBot.forwardMessage(
@@ -26,40 +43,105 @@ public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChat.id,
toChatId = toChatId,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChatId,
toChatId = toChat.id,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage(
fromChat: Chat,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChatId = fromChat.id,
toChatId = toChat.id,
messageId = messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
message: AccessibleMessage,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChat = message.chat,
toChatId = toChatId,
messageId = message.messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
public suspend fun TelegramBot.forwardMessage(
toChat: Chat,
message: AccessibleMessage,
threadId: MessageThreadId? = toChat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = toChat.id.directMessageThreadId,
startTimestamp: Seconds? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
): PossiblyForwardedMessage = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
protectContent: Boolean = false,
effectId: EffectId? = null
): PossiblyForwardedMessage = forwardMessage(
fromChat = message.chat,
toChat = toChat,
messageId = message.messageId,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
startTimestamp = startTimestamp,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId
)
@@ -13,6 +13,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId: ChatIdentifier,
messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -23,6 +24,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = fromChatId,
messageIds = it,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -35,6 +37,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId: ChatIdentifier,
messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -43,6 +46,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = fromChatId,
messageIds = messageIds.toList(),
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -52,6 +56,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -61,6 +66,7 @@ public suspend fun TelegramBot.forwardMessages(
fromChatId = chatId,
messageIds = messages.map { it.messageId },
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -72,6 +78,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId: ChatIdentifier,
messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -79,6 +86,7 @@ public suspend fun TelegramBot.forwardMessages(
toChatId = toChatId,
messagesMetas = messages.map { it.metaInfo },
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -89,6 +97,7 @@ public suspend fun TelegramBot.forward(
fromChatId: ChatIdentifier,
messageIds: List<MessageId>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -97,6 +106,7 @@ public suspend fun TelegramBot.forward(
fromChatId = fromChatId,
messageIds = messageIds,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -107,6 +117,7 @@ public suspend fun TelegramBot.forward(
fromChatId: ChatIdentifier,
messageIds: Array<MessageId>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -115,6 +126,7 @@ public suspend fun TelegramBot.forward(
fromChatId = fromChatId,
messageIds = messageIds,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -124,6 +136,7 @@ public suspend fun TelegramBot.forward(
toChatId: ChatIdentifier,
messagesMetas: List<Message.MetaInfo>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -131,6 +144,7 @@ public suspend fun TelegramBot.forward(
toChatId = toChatId,
messagesMetas = messagesMetas,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -141,6 +155,7 @@ public suspend fun TelegramBot.forward(
toChatId: ChatIdentifier,
messages: List<AccessibleMessage>,
threadId: MessageThreadId? = toChatId.threadId,
directMessageThreadId: DirectMessageThreadId? = toChatId.directMessageThreadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
removeCaption: Boolean = false
@@ -148,6 +163,7 @@ public suspend fun TelegramBot.forward(
toChatId = toChatId,
messages = messages,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
disableNotification = disableNotification,
protectContent = protectContent,
removeCaption = removeCaption
@@ -0,0 +1,13 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.GetUserPersonalChatMessages
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
public suspend fun TelegramBot.getUserPersonalChatMessages(
userId: ChatId,
limit: Int
): List<ContentMessage<*>> = execute(
GetUserPersonalChatMessages(userId = userId, limit = limit)
)
@@ -17,6 +17,7 @@ internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
for (update in this) {
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
if (it.content is MediaGroupPartContent) {
@Suppress("UNCHECKED_CAST")
it as PossiblySentViaBotCommonMessage<MediaGroupPartContent>
} else {
null
@@ -48,10 +49,4 @@ internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
return resultUpdates
}
/**
* @return [EditMessageMediaGroupUpdate] in case if [this] is [EditMessageUpdate]. When [this] object is
* [EditChannelPostUpdate] instance - will return [EditChannelPostMediaGroupUpdate]
*
* @throws IllegalStateException
*/
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate() = this
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate(): BaseEditMessageUpdate = this
@@ -1,7 +1,6 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.tgbotapi.abstracts.Headed
import dev.inmo.tgbotapi.abstracts.HorizontallyAccured
import dev.inmo.tgbotapi.abstracts.Locationed
@@ -16,9 +15,11 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay
@@ -50,11 +51,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<EditLiveLocationInfo>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
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,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
@@ -63,7 +66,7 @@ public suspend fun TelegramBot.handleLiveLocation(
null
} else {
val scope = currentCoroutineContext().LinkedSupervisorScope()
scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
scope.launchWithBotLogger(start = CoroutineStart.LAZY) {
while (scope.isActive) {
delay(liveTimeMillis)
// Remove previous location message info to resend live location message
@@ -76,25 +79,27 @@ public suspend fun TelegramBot.handleLiveLocation(
if (capturedLiveLocationMessage == null) {
updateMessageJob ?.start()
currentLiveLocationMessage = send(
chatId,
it.latitude,
it.longitude,
if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
chatId = chatId,
latitude = it.latitude,
longitude = it.longitude,
livePeriod = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) {
LiveLocation.INDEFINITE_LIVE_PERIOD
} else {
ceil(liveTimeMillis.toDouble() / 1000).toInt()
},
it.horizontalAccuracy,
it.heading,
it.proximityAlertRadius,
threadId,
businessConnectionId,
disableNotification,
protectContent,
allowPaidBroadcast,
effectId,
replyParameters,
it.replyMarkup
horizontalAccuracy = it.horizontalAccuracy,
heading = it.heading,
proximityAlertRadius = it.proximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = it.replyMarkup
).also {
sentMessageFlow ?.emit(it)
}
@@ -125,11 +130,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Location>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
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,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
@@ -147,11 +154,13 @@ public suspend fun TelegramBot.handleLiveLocation(
},
liveTimeMillis = liveTimeMillis,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow
)
@@ -168,11 +177,13 @@ public suspend fun TelegramBot.handleLiveLocation(
locationsFlow: Flow<Pair<Double, Double>>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
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,
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
@@ -186,11 +197,13 @@ public suspend fun TelegramBot.handleLiveLocation(
},
liveTimeMillis = liveTimeMillis,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
sentMessageFlow = sentMessageFlow
)
@@ -1,3 +1,5 @@
@file:Suppress("KDocUnresolvedReference")
package dev.inmo.tgbotapi.extensions.api
import korlibs.time.DateTime
@@ -11,11 +13,13 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
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.location.LiveLocation
import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.extensions.directMessageThreadIdOrNull
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
import io.ktor.utils.io.core.Closeable
import korlibs.time.millisecondsLong
@@ -96,11 +100,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider {
@@ -115,11 +121,13 @@ public suspend fun TelegramBot.startLiveLocation(
heading = initHeading,
proximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
@@ -147,11 +155,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -164,11 +174,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
@@ -186,11 +198,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -203,11 +217,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
@@ -225,11 +241,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId,
directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -242,11 +260,13 @@ public suspend fun TelegramBot.startLiveLocation(
initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
@@ -265,11 +285,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull,
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -282,11 +304,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup = replyMarkup
)
@@ -304,11 +328,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull,
directMessageThreadId: DirectMessageThreadId? = to.directMessageThreadIdOrNull,
businessConnectionId: BusinessConnectionId? = to.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -320,11 +346,13 @@ public suspend inline fun TelegramBot.replyWithLiveLocation(
initHeading = initHeading,
initProximityAlertRadius = initProximityAlertRadius,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup = replyMarkup
)
@@ -3,4 +3,4 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.local.LogOut
public suspend inline fun TelegramBot.logOut(): Boolean = execute(LogOut)
public suspend inline fun TelegramBot.logOut(): Unit = execute(LogOut)
@@ -0,0 +1,21 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.SavePreparedKeyboardButton
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.buttons.KeyboardButton
import dev.inmo.tgbotapi.types.buttons.PreparedKeyboardButton
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.toChatId
public suspend fun TelegramBot.savePreparedKeyboardButton(
userId: ChatId,
button: KeyboardButton
): PreparedKeyboardButton = execute(
SavePreparedKeyboardButton(userId = userId, button = button)
)
public suspend fun TelegramBot.savePreparedKeyboardButton(
user: User,
button: KeyboardButton
): PreparedKeyboardButton = savePreparedKeyboardButton(userId = user.id.toChatId(), button = button)
@@ -11,7 +11,7 @@ public suspend fun TelegramBot.answerCallbackQuery(
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
): Boolean = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
): Unit = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
public suspend fun TelegramBot.answerCallbackQuery(
callbackQuery: CallbackQuery,
@@ -19,7 +19,7 @@ public suspend fun TelegramBot.answerCallbackQuery(
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
): Unit = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
public suspend fun TelegramBot.answer(
callbackQuery: CallbackQuery,
@@ -27,4 +27,4 @@ public suspend fun TelegramBot.answer(
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
): Boolean = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
): Unit = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.answers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.answers.AnswerGuestQuery
import dev.inmo.tgbotapi.types.GuestQueryId
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
import dev.inmo.tgbotapi.types.guest.SentGuestMessage
public suspend fun TelegramBot.answerGuestQuery(
guestQueryId: GuestQueryId,
result: InlineQueryResult
): SentGuestMessage = execute(AnswerGuestQuery(guestQueryId, result))
public suspend fun TelegramBot.answer(
guestQueryId: GuestQueryId,
result: InlineQueryResult
): SentGuestMessage = execute(AnswerGuestQuery(guestQueryId, result))
@@ -14,7 +14,7 @@ public suspend fun TelegramBot.answerInlineQuery(
isPersonal: Boolean? = null,
nextOffset: String? = null,
button: InlineQueryResultsButton? = null
): Boolean = execute(
): Unit = execute(
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, button)
)
@@ -25,7 +25,7 @@ public suspend fun TelegramBot.answerInlineQuery(
isPersonal: Boolean? = null,
nextOffset: String? = null,
button: InlineQueryResultsButton? = null
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
): Unit = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
public suspend fun TelegramBot.answer(
inlineQuery: InlineQuery,
@@ -34,7 +34,7 @@ public suspend fun TelegramBot.answer(
isPersonal: Boolean? = null,
nextOffset: String? = null,
button: InlineQueryResultsButton? = null
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
): Unit = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, button)
public suspend fun TelegramBot.answerInlineQuery(
inlineQueryID: InlineQueryId,
@@ -44,7 +44,7 @@ public suspend fun TelegramBot.answerInlineQuery(
nextOffset: String? = null,
switchPmText: String?,
switchPmParameter: String?
): Boolean = execute(
): Unit = execute(
AnswerInlineQuery(inlineQueryID, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
)
@@ -56,7 +56,7 @@ public suspend fun TelegramBot.answerInlineQuery(
nextOffset: String? = null,
switchPmText: String?,
switchPmParameter: String?
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
): Unit = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
public suspend fun TelegramBot.answer(
inlineQuery: InlineQuery,
@@ -66,4 +66,4 @@ public suspend fun TelegramBot.answer(
nextOffset: String? = null,
switchPmText: String?,
switchPmParameter: String?
): Boolean = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
): Unit = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
@@ -8,16 +8,16 @@ import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
id: PreCheckoutQueryId
): Boolean = execute(AnswerPreCheckoutQueryOk(id))
): Unit = execute(AnswerPreCheckoutQueryOk(id))
public suspend fun TelegramBot.answerPreCheckoutQueryOk(
preCheckoutQuery: PreCheckoutQuery
): Boolean = answerPreCheckoutQueryOk(preCheckoutQuery.id)
): Unit = answerPreCheckoutQueryOk(preCheckoutQuery.id)
public suspend fun TelegramBot.answerPreCheckoutQueryError(
id: PreCheckoutQueryId,
error: String
): Boolean = execute(AnswerPreCheckoutQueryError(id, error))
): Unit = execute(AnswerPreCheckoutQueryError(id, error))
public suspend fun TelegramBot.answerPreCheckoutQueryError(
preCheckoutQuery: PreCheckoutQuery,
error: String
): Boolean = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
): Unit = answerPreCheckoutQueryError(preCheckoutQuery.id, error)
@@ -10,19 +10,19 @@ import dev.inmo.tgbotapi.types.payments.ShippingQuery
public suspend fun TelegramBot.answerShippingQueryOk(
id: ShippingQueryId,
shippingOptions: List<ShippingOption>
): Boolean = execute(AnswerShippingQueryOk(id, shippingOptions))
): Unit = execute(AnswerShippingQueryOk(id, shippingOptions))
public suspend fun TelegramBot.answerShippingQueryOk(
shippingQuery: ShippingQuery,
shippingOptions: List<ShippingOption>
): Boolean = answerShippingQueryOk(shippingQuery.id, shippingOptions)
): Unit = answerShippingQueryOk(shippingQuery.id, shippingOptions)
public suspend fun TelegramBot.answerShippingQueryError(
id: ShippingQueryId,
error: String
): Boolean = execute(AnswerShippingQueryError(id, error))
): Unit = execute(AnswerShippingQueryError(id, error))
public suspend fun TelegramBot.answerShippingQueryError(
shippingQuery: ShippingQuery,
error: String
): Boolean = answerShippingQueryError(shippingQuery.id, error)
): Unit = answerShippingQueryError(shippingQuery.id, error)
@@ -5,8 +5,8 @@ import dev.inmo.tgbotapi.requests.bot.ClearMyDefaultAdministratorRights
public suspend fun TelegramBot.clearMyDefaultAdministratorRights(
forChannels: Boolean? = null
): Boolean = execute(ClearMyDefaultAdministratorRights(forChannels))
): Unit = execute(ClearMyDefaultAdministratorRights(forChannels))
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels(): Boolean = clearMyDefaultAdministratorRights(forChannels = true)
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels(): Unit = clearMyDefaultAdministratorRights(forChannels = true)
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups(): Boolean = clearMyDefaultAdministratorRights(forChannels = false)
public suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups(): Unit = clearMyDefaultAdministratorRights(forChannels = false)
@@ -9,9 +9,9 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
public suspend fun TelegramBot.deleteMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLang?
): Boolean = execute(DeleteMyCommands(scope, languageCode))
): Unit = execute(DeleteMyCommands(scope, languageCode))
public suspend fun TelegramBot.deleteMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
): Boolean = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
): Unit = deleteMyCommands(scope, languageCode ?.let(::IetfLang))
@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.GetMe
import dev.inmo.tgbotapi.requests.bot.GetMyStarBalance
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
public suspend fun TelegramBot.getMyStarBalance(): StarAmount = execute(GetMyStarBalance)
@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.RemoveMyProfilePhoto
public suspend fun TelegramBot.removeMyProfilePhoto(): Unit = execute(RemoveMyProfilePhoto)
@@ -11,22 +11,22 @@ public suspend fun TelegramBot.setMyCommands(
commands: List<BotCommand>,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLang?
): Boolean = execute(SetMyCommands(commands, scope, languageCode))
): Unit = execute(SetMyCommands(commands, scope, languageCode))
public suspend fun TelegramBot.setMyCommands(
vararg commands: BotCommand,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLang?
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
): Unit = setMyCommands(commands.toList(), scope, languageCode)
public suspend fun TelegramBot.setMyCommands(
commands: List<BotCommand>,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
): Boolean = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
): Unit = setMyCommands(commands, scope, languageCode ?.let(::IetfLang))
public suspend fun TelegramBot.setMyCommands(
vararg commands: BotCommand,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
): Boolean = setMyCommands(commands.toList(), scope, languageCode)
): Unit = setMyCommands(commands.toList(), scope, languageCode)
@@ -7,12 +7,12 @@ import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
public suspend fun TelegramBot.setMyDefaultAdministratorRights(
rights: ChatCommonAdministratorRights,
forChannels: Boolean? = null
): Boolean = execute(SetMyDefaultAdministratorRights(rights, forChannels))
): Unit = execute(SetMyDefaultAdministratorRights(rights, forChannels))
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
rights: ChatCommonAdministratorRights
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = true)
): Unit = setMyDefaultAdministratorRights(rights, forChannels = true)
public suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
rights: ChatCommonAdministratorRights
): Boolean = setMyDefaultAdministratorRights(rights, forChannels = false)
): Unit = setMyDefaultAdministratorRights(rights, forChannels = false)
@@ -11,9 +11,9 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
public suspend fun TelegramBot.setMyDescription(
description: String? = null,
languageCode: IetfLang? = null
): Boolean = execute(SetMyDescription(description, languageCode))
): Unit = execute(SetMyDescription(description, languageCode))
public suspend fun TelegramBot.setMyDescription(
description: String?,
languageCode: String?
): Boolean = setMyDescription(description, languageCode ?.let(::IetfLang))
): Unit = setMyDescription(description, languageCode ?.let(::IetfLang))
@@ -11,9 +11,9 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
public suspend fun TelegramBot.setMyName(
name: String? = null,
languageCode: IetfLang? = null
): Boolean = execute(SetMyName(name, languageCode))
): Unit = execute(SetMyName(name, languageCode))
public suspend fun TelegramBot.setMyName(
name: String?,
languageCode: String?
): Boolean = setMyName(name, languageCode ?.let(::IetfLang))
): Unit = setMyName(name, languageCode ?.let(::IetfLang))
@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.SetMyProfilePhoto
import dev.inmo.tgbotapi.requests.business_connection.InputProfilePhoto
public suspend fun TelegramBot.setMyProfilePhoto(
photo: InputProfilePhoto
): Unit = execute(SetMyProfilePhoto(photo))
@@ -7,9 +7,9 @@ import dev.inmo.tgbotapi.requests.bot.SetMyShortDescription
public suspend fun TelegramBot.setMyShortDescription(
shortDescription: String? = null,
languageCode: IetfLang? = null
): Boolean = execute(SetMyShortDescription(shortDescription, languageCode))
): Unit = execute(SetMyShortDescription(shortDescription, languageCode))
public suspend fun TelegramBot.setMyShortDescription(
shortDescription: String?,
languageCode: String?
): Boolean = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
): Unit = setMyShortDescription(shortDescription, languageCode ?.let(::IetfLang))
@@ -0,0 +1,25 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.GiftId
import dev.inmo.tgbotapi.types.gifts.Gift
public suspend fun TelegramBot.convertGiftToStars(
businessConnectionId: BusinessConnectionId,
ownedGiftId: GiftId
): Unit = execute(
ConvertGiftToStars(businessConnectionId, ownedGiftId)
)
public suspend fun TelegramBot.convertGiftToStars(
businessConnectionId: BusinessConnectionId,
gift: Gift.Regular
): Unit = convertGiftToStars(
businessConnectionId = businessConnectionId,
ownedGiftId = with(gift) {id}
)
@@ -0,0 +1,20 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.DeleteBusinessMessages
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
@GenerateVariations
public suspend fun TelegramBot.deleteBusinessMessages(
businessConnectionId: BusinessConnectionId,
@GenerationVariant(List::class, "messages.map { it.messageId }", "messages", AccessibleMessage::class)
messageIds: List<MessageId>
): Unit = execute(
DeleteBusinessMessages(businessConnectionId, messageIds)
)
@@ -0,0 +1,16 @@
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
// TO REGENERATE IT JUST DELETE FILE
// ORIGINAL FILE: DeleteBusinessMessages.kt
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import kotlin.Boolean
import kotlin.collections.List
public suspend fun TelegramBot.deleteBusinessMessages(businessConnectionId: BusinessConnectionId,
messages: List<AccessibleMessage>): Unit = deleteBusinessMessages(
businessConnectionId = businessConnectionId, messageIds = with(messages) {messages.map {
it.messageId }}
)
@@ -0,0 +1,105 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.OwnedGifts
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
import dev.inmo.tgbotapi.types.gifts.OwnedGift
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlin.runCatching
public suspend fun TelegramBot.getBusinessAccountGifts(
businessConnectionId: BusinessConnectionId,
excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeUnique: Boolean = false,
excludeFromBlockchain: Boolean = false,
sortByPrice: Boolean = false,
offset: String? = null,
limit: Int? = null
): OwnedGifts<OwnedGift.OwnedByBusinessAccount> = execute(
GetBusinessAccountGifts(
businessConnectionId,
excludeUnsaved,
excludeSaved,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeUnique,
excludeFromBlockchain,
sortByPrice,
offset,
limit
)
)
/**
* Creates a flow that emits business account gifts in a paginated manner.
*
* This function will automatically handle pagination by using the `nextOffset` from each response
* to fetch the next page of gifts until there are no more gifts to fetch.
*
* @param businessConnectionId The ID of the business connection
* @param excludeUnsaved Whether to exclude unsaved gifts
* @param excludeSaved Whether to exclude saved gifts
* @param excludeUnlimited Whether to exclude unlimited gifts
* @param excludeLimitedUpgradable Whether to exclude limited upgradable gifts
* @param excludeLimitedNonUpgradable Whether to exclude limited non-upgradable gifts
* @param excludeUnique Whether to exclude unique gifts
* @param excludeFromBlockchain Whether to exclude gifts from blockchain
* @param sortByPrice Whether to sort gifts by price
* @param initialOffset The initial offset to start fetching from. If null, starts from the beginning
* @param limit The maximum number of gifts to fetch per request
* @param onErrorContinueChecker A function that determines whether to continue fetching on error.
* Returns true to continue, false to stop. Default is to stop on any error.
* @return A flow that emits [OwnedGifts] containing the fetched gifts
*/
public fun TelegramBot.getBusinessAccountGiftsFlow(
businessConnectionId: BusinessConnectionId,
excludeUnsaved: Boolean = false,
excludeSaved: Boolean = false,
excludeUnlimited: Boolean = false,
excludeLimitedUpgradable: Boolean = false,
excludeLimitedNonUpgradable: Boolean = false,
excludeUnique: Boolean = false,
excludeFromBlockchain: Boolean = false,
sortByPrice: Boolean = false,
initialOffset: String? = null,
limit: Int? = null,
onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false }
): Flow<OwnedGifts<OwnedGift.OwnedByBusinessAccount>> = flow {
var currentOffset = initialOffset
do {
val response = runCatching {
getBusinessAccountGifts(
businessConnectionId,
excludeUnsaved,
excludeSaved,
excludeUnlimited,
excludeLimitedUpgradable,
excludeLimitedNonUpgradable,
excludeUnique,
excludeFromBlockchain,
sortByPrice,
currentOffset,
limit
)
}
if (response.isSuccess) {
val result = response.getOrThrow()
emit(result)
currentOffset = result.nextOffset
} else {
if (onErrorContinueChecker(response.exceptionOrNull())) {
continue
} else {
break
}
}
} while (currentOffset != null)
}
@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountStarBalance
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
public suspend fun TelegramBot.getBusinessAccountStarBalance(
businessConnectionId: BusinessConnectionId
): StarAmount = execute(
GetBusinessAccountStarBalance(businessConnectionId)
)
@@ -0,0 +1,27 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.ReadBusinessMessage
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.toChatId
@GenerateVariations
public suspend fun TelegramBot.readBusinessMessage(
businessConnectionId: BusinessConnectionId,
@GenerationVariant(Chat::class, "chat.id.toChatId()", "chat")
chatId: ChatId,
messageId: MessageId
): Unit = execute(
ReadBusinessMessage(businessConnectionId, chatId, messageId)
)
public suspend fun TelegramBot.readBusinessMessage(
businessConnectionId: BusinessConnectionId,
message: AccessibleMessage
): Unit = readBusinessMessage(businessConnectionId, message.chat.id.toChatId(), message.messageId)
@@ -0,0 +1,20 @@
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
// TO REGENERATE IT JUST DELETE FILE
// ORIGINAL FILE: ReadBusinessMessage.kt
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.toChatId
import kotlin.Boolean
public suspend fun TelegramBot.readBusinessMessage(
businessConnectionId: BusinessConnectionId,
chat: Chat,
messageId: MessageId,
): Unit = readBusinessMessage(
businessConnectionId = businessConnectionId, chatId = with(chat) {chat.id.toChatId()}, messageId
= messageId
)
@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.RemoveBusinessAccountProfilePhoto
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
public suspend fun TelegramBot.removeBusinessAccountProfilePhoto(
businessConnectionId: BusinessConnectionId,
isPublic: Boolean = false
): Unit = execute(
RemoveBusinessAccountProfilePhoto(businessConnectionId = businessConnectionId, isPublic = isPublic)
)
@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountBio
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
public suspend fun TelegramBot.setBusinessAccountBio(
businessConnectionId: BusinessConnectionId,
bio: String
): Unit = execute(
SetBusinessAccountBio(businessConnectionId, bio)
)
@@ -0,0 +1,35 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountGiftSettings
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.gifts.AcceptedGiftTypes
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
/**
* Sets the gift settings for a business account
*/
public suspend fun TelegramBot.setBusinessAccountGiftSettings(
businessConnectionId: BusinessConnectionId,
showGiftButton: Boolean,
acceptedGiftTypes: AcceptedGiftTypes
): Unit = execute(
SetBusinessAccountGiftSettings(
businessConnectionId = businessConnectionId,
showGiftButton = showGiftButton,
acceptedGiftTypes = acceptedGiftTypes
)
)
/**
* Sets the gift settings for a business account using business message context
*/
public suspend fun TelegramBot.setBusinessAccountGiftSettings(
message: BusinessContentMessage<*>,
showGiftButton: Boolean,
acceptedGiftTypes: AcceptedGiftTypes
): Unit = setBusinessAccountGiftSettings(
businessConnectionId = message.businessConnectionId,
showGiftButton = showGiftButton,
acceptedGiftTypes = acceptedGiftTypes
)
@@ -0,0 +1,13 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountName
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
public suspend fun TelegramBot.setBusinessAccountName(
businessConnectionId: BusinessConnectionId,
firstName: String,
lastName: String? = null
): Unit = execute(
SetBusinessAccountName(businessConnectionId, firstName, lastName)
)
@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.InputProfilePhoto
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountProfilePhoto
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
public suspend fun TelegramBot.setBusinessAccountProfilePhoto(
businessConnectionId: BusinessConnectionId,
photo: InputProfilePhoto,
isPublic: Boolean = false
): Unit = execute(
SetBusinessAccountProfilePhoto(businessConnectionId, photo, isPublic)
)
@@ -0,0 +1,15 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.SetBusinessAccountUsername
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.Username
public suspend fun TelegramBot.setBusinessAccountUsername(
businessConnectionId: BusinessConnectionId,
username: Username? = null
): Unit = execute(
SetBusinessAccountUsername(businessConnectionId, username)
)
@@ -0,0 +1,18 @@
// THIS CODE HAVE BEEN GENERATED AUTOMATICALLY
// TO REGENERATE IT JUST DELETE FILE
// ORIGINAL FILE: SetBusinessAccountUsername.kt
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.types.Username
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import kotlin.Boolean
import kotlin.String
public suspend fun TelegramBot.setBusinessAccountUsername(
businessConnectionId: BusinessConnectionId,
username: String?
): Unit = setBusinessAccountUsername(
businessConnectionId = businessConnectionId,
username = username ?.let { Username.prepare(username) }
)
@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.TransferBusinessAccountStars
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
public suspend fun TelegramBot.transferBusinessAccountStars(
businessConnectionId: BusinessConnectionId,
amount: Int
): Unit = execute(
TransferBusinessAccountStars(businessConnectionId, amount)
)
@@ -0,0 +1,43 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
import dev.inmo.tgbotapi.requests.business_connection.TransferGift
import dev.inmo.tgbotapi.requests.business_connection.UpgradeGift
import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.GiftId
import dev.inmo.tgbotapi.types.businessConnectionIdField
import dev.inmo.tgbotapi.types.gifts.Gift
import dev.inmo.tgbotapi.types.keepOriginalDetailsField
import dev.inmo.tgbotapi.types.ownedGiftIdField
import dev.inmo.tgbotapi.types.starCountField
import kotlinx.serialization.SerialName
public suspend fun TelegramBot.transferGift(
businessConnectionId: BusinessConnectionId,
ownedGiftId: GiftId,
newOwnerChatId: ChatId,
transferPaymentStarCount: Int? = null,
): Unit = execute(
TransferGift(
businessConnectionId = businessConnectionId,
ownedGiftId = ownedGiftId,
newOwnerChatId = newOwnerChatId,
transferPaymentStarCount = transferPaymentStarCount
)
)
public suspend fun TelegramBot.transferGift(
businessConnectionId: BusinessConnectionId,
gift: Gift.Regular,
newOwnerChatId: ChatId,
transferPaymentStarCount: Int? = null,
): Unit = transferGift(
businessConnectionId = businessConnectionId,
ownedGiftId = gift.id,
newOwnerChatId = newOwnerChatId,
transferPaymentStarCount = transferPaymentStarCount
)
@@ -0,0 +1,42 @@
package dev.inmo.tgbotapi.extensions.api.business
import dev.inmo.micro_utils.ksp.variations.GenerateVariations
import dev.inmo.micro_utils.ksp.variations.GenerationVariant
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.business_connection.ConvertGiftToStars
import dev.inmo.tgbotapi.requests.business_connection.UpgradeGift
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.GiftId
import dev.inmo.tgbotapi.types.businessConnectionIdField
import dev.inmo.tgbotapi.types.gifts.Gift
import dev.inmo.tgbotapi.types.keepOriginalDetailsField
import dev.inmo.tgbotapi.types.ownedGiftIdField
import dev.inmo.tgbotapi.types.starCountField
import kotlinx.serialization.SerialName
public suspend fun TelegramBot.convertGiftToStars(
businessConnectionId: BusinessConnectionId,
ownedGiftId: GiftId,
keepOriginalDetails: Boolean = false,
starCount: Int? = null
): Unit = execute(
UpgradeGift(
businessConnectionId = businessConnectionId,
ownedGiftId = ownedGiftId,
keepOriginalDetails = keepOriginalDetails,
starCount = starCount
)
)
public suspend fun TelegramBot.convertGiftToStars(
businessConnectionId: BusinessConnectionId,
gift: Gift.Regular,
keepOriginalDetails: Boolean = false,
): Unit = execute(
UpgradeGift(
businessConnectionId = businessConnectionId,
ownedGiftId = gift.id,
keepOriginalDetails = keepOriginalDetails,
starCount = gift.upgradeStarCount
)
)
@@ -7,8 +7,8 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
public suspend fun TelegramBot.leaveChat(
chatId: ChatIdentifier
): Boolean = execute(LeaveChat(chatId))
): Unit = execute(LeaveChat(chatId))
public suspend fun TelegramBot.leaveChat(
chat: PublicChat
): Boolean = leaveChat(chat.id)
): Unit = leaveChat(chat.id)
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.closeForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
): Boolean = execute(
): Unit = execute(
CloseForumTopic(
chatId,
messageThreadId
@@ -20,9 +20,9 @@ public suspend fun TelegramBot.closeForumTopic(
public suspend fun TelegramBot.closeForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
): Boolean = closeForumTopic(chat.id, messageThreadId)
): Unit = closeForumTopic(chat.id, messageThreadId)
public suspend fun TelegramBot.closeForumTopic(
chat: Chat,
forumTopic: ForumTopic
): Boolean = closeForumTopic(chat.id, forumTopic.messageThreadId)
): Unit = closeForumTopic(chat.id, forumTopic.messageThreadId)
@@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.closeGeneralForumTopic(
chatId: ChatIdentifier
): Boolean = execute(
): Unit = execute(
CloseGeneralForumTopic(chatId)
)
public suspend fun TelegramBot.closeGeneralForumTopic(
chat: Chat
): Boolean = closeGeneralForumTopic(chat.id)
): Unit = closeGeneralForumTopic(chat.id)
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.deleteForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
): Boolean = execute(
): Unit = execute(
DeleteForumTopic(
chatId,
messageThreadId
@@ -20,14 +20,14 @@ public suspend fun TelegramBot.deleteForumTopic(
public suspend fun TelegramBot.deleteForumTopic(
chatId: ChatIdentifier,
forumTopic: ForumTopic
): Boolean = deleteForumTopic(chatId, forumTopic.messageThreadId)
): Unit = deleteForumTopic(chatId, forumTopic.messageThreadId)
public suspend fun TelegramBot.deleteForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
): Boolean = deleteForumTopic(chat.id, messageThreadId)
): Unit = deleteForumTopic(chat.id, messageThreadId)
public suspend fun TelegramBot.deleteForumTopic(
chat: Chat,
forumTopic: ForumTopic
): Boolean = deleteForumTopic(chat.id, forumTopic.messageThreadId)
): Unit = deleteForumTopic(chat.id, forumTopic.messageThreadId)
@@ -13,7 +13,7 @@ public suspend fun TelegramBot.editForumTopic(
messageThreadId: MessageThreadId,
name: String? = null,
iconEmojiId: CustomEmojiId? = null
): Boolean = execute(
): Unit = execute(
EditForumTopic(
chatId,
messageThreadId,
@@ -27,10 +27,10 @@ public suspend fun TelegramBot.editForumTopic(
messageThreadId: MessageThreadId,
name: String? = null,
iconEmojiId: CustomEmojiId? = null
): Boolean = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
): Unit = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
public suspend fun TelegramBot.editForumTopic(
chatIdentifier: ChatIdentifier,
forumTopic: ForumTopic,
iconEmojiId: CustomEmojiId? = forumTopic.iconEmojiId
): Boolean = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
): Unit = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)
@@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.editGeneralForumTopic(
chatId: ChatIdentifier,
name: String
): Boolean = execute(
): Unit = execute(
EditGeneralForumTopic(
chatId,
name
@@ -22,9 +22,9 @@ public suspend fun TelegramBot.editGeneralForumTopic(
public suspend fun TelegramBot.editGeneralForumTopic(
chat: Chat,
name: String
): Boolean = editGeneralForumTopic(chat.id, name)
): Unit = editGeneralForumTopic(chat.id, name)
public suspend fun TelegramBot.editGeneralForumTopic(
chatIdentifier: ChatIdentifier,
forumTopic: ForumTopic,
): Boolean = editGeneralForumTopic(chatIdentifier, forumTopic.name)
): Unit = editGeneralForumTopic(chatIdentifier, forumTopic.name)
@@ -11,10 +11,10 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.hideGeneralForumTopic(
chatId: ChatIdentifier
): Boolean = execute(
): Unit = execute(
HideGeneralForumTopic(chatId)
)
public suspend fun TelegramBot.hideGeneralForumTopic(
chat: Chat
): Boolean = hideGeneralForumTopic(chat.id)
): Unit = hideGeneralForumTopic(chat.id)
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.reopenForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
): Boolean = execute(
): Unit = execute(
ReopenForumTopic(
chatId,
messageThreadId
@@ -20,9 +20,9 @@ public suspend fun TelegramBot.reopenForumTopic(
public suspend fun TelegramBot.reopenForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
): Boolean = reopenForumTopic(chat.id, messageThreadId)
): Unit = reopenForumTopic(chat.id, messageThreadId)
public suspend fun TelegramBot.reopenForumTopic(
chat: Chat,
forumTopic: ForumTopic
): Boolean = reopenForumTopic(chat.id, forumTopic.messageThreadId)
): Unit = reopenForumTopic(chat.id, forumTopic.messageThreadId)
@@ -10,10 +10,10 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.reopenGeneralForumTopic(
chatId: ChatIdentifier
): Boolean = execute(
): Unit = execute(
ReopenGeneralForumTopic(chatId)
)
public suspend fun TelegramBot.reopenGeneralForumTopic(
chat: Chat
): Boolean = reopenGeneralForumTopic(chat.id)
): Unit = reopenGeneralForumTopic(chat.id)
@@ -12,10 +12,10 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.unhideGeneralForumTopic(
chatId: ChatIdentifier
): Boolean = execute(
): Unit = execute(
UnhideGeneralForumTopic(chatId)
)
public suspend fun TelegramBot.unhideGeneralForumTopic(
chat: Chat
): Boolean = unhideGeneralForumTopic(chat.id)
): Unit = unhideGeneralForumTopic(chat.id)
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.unpinAllForumTopicMessages(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
): Boolean = execute(
): Unit = execute(
UnpinAllForumTopicMessages(
chatId,
messageThreadId
@@ -20,9 +20,9 @@ public suspend fun TelegramBot.unpinAllForumTopicMessages(
public suspend fun TelegramBot.unpinAllForumTopicMessages(
chat: Chat,
messageThreadId: MessageThreadId
): Boolean = unpinAllForumTopicMessages(chat.id, messageThreadId)
): Unit = unpinAllForumTopicMessages(chat.id, messageThreadId)
public suspend fun TelegramBot.unpinAllForumTopicMessages(
chat: Chat,
forumTopic: ForumTopic
): Boolean = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
): Unit = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)
@@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
chatId: ChatIdentifier
): Boolean = execute(
): Unit = execute(
UnpinAllGeneralForumTopicMessages(
chatId
)
@@ -18,4 +18,4 @@ public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
public suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
chat: Chat
): Boolean = unpinAllGeneralForumTopicMessages(chat.id)
): Unit = unpinAllGeneralForumTopicMessages(chat.id)
@@ -117,6 +117,17 @@ public suspend fun TelegramBot.getChat(
chat: PrivateChatImpl
): ExtendedPrivateChatImpl = getChat(chat.id) as ExtendedPrivateChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPrivateForumChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
*/
@PreviewFeature
public suspend fun TelegramBot.getChat(
chat: PrivateForumChatImpl
): ExtendedPrivateForumChatImpl = getChat(chat.id) as ExtendedPrivateForumChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedUser] with unsafe operator "as"
@@ -7,9 +7,11 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember
public suspend fun TelegramBot.getChatAdministrators(
chatId: ChatIdentifier
): List<AdministratorChatMember> = execute(GetChatAdministrators(chatId))
chatId: ChatIdentifier,
retrieveOtherBots: Boolean? = null
): List<AdministratorChatMember> = execute(GetChatAdministrators(chatId = chatId, retrieveOtherBots = retrieveOtherBots))
public suspend fun TelegramBot.getChatAdministrators(
chat: PublicChat
): List<AdministratorChatMember> = getChatAdministrators(chat.id)
chat: PublicChat,
retrieveOtherBots: Boolean? = null
): List<AdministratorChatMember> = getChatAdministrators(chat.id, retrieveOtherBots)
@@ -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)
@@ -12,31 +12,31 @@ import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
public suspend fun TelegramBot.approveChatJoinRequest(
chatId: ChatIdentifier,
userId: UserId
): Boolean = execute(ApproveChatJoinRequest(chatId, userId))
): Unit = execute(ApproveChatJoinRequest(chatId, userId))
public suspend fun TelegramBot.approveChatJoinRequest(
chat: PublicChat,
userId: UserId
): Boolean = approveChatJoinRequest(chat.id, userId)
): Unit = approveChatJoinRequest(chat.id, userId)
public suspend fun TelegramBot.approveChatJoinRequest(
chatId: ChatIdentifier,
user: User
): Boolean = approveChatJoinRequest(chatId, user.id)
): Unit = approveChatJoinRequest(chatId, user.id)
public suspend fun TelegramBot.approveChatJoinRequest(
chat: PublicChat,
user: User
): Boolean = approveChatJoinRequest(chat.id, user.id)
): Unit = approveChatJoinRequest(chat.id, user.id)
public suspend fun TelegramBot.approveChatJoinRequest(
chatJoinRequest: ChatJoinRequest
): Boolean = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
): Unit = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
public suspend fun TelegramBot.approve(
chatJoinRequest: ChatJoinRequest
): Boolean = approveChatJoinRequest(chatJoinRequest)
): Unit = approveChatJoinRequest(chatJoinRequest)
public suspend fun TelegramBot.approveChatJoinRequest(
chatJoinRequestUpdate: ChatJoinRequestUpdate
): Boolean = approveChatJoinRequest(chatJoinRequestUpdate.data)
): Unit = approveChatJoinRequest(chatJoinRequestUpdate.data)
@@ -12,31 +12,31 @@ import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
public suspend fun TelegramBot.declineChatJoinRequest(
chatId: ChatIdentifier,
userId: UserId
): Boolean = execute(DeclineChatJoinRequest(chatId, userId))
): Unit = execute(DeclineChatJoinRequest(chatId, userId))
public suspend fun TelegramBot.declineChatJoinRequest(
chat: PublicChat,
userId: UserId
): Boolean = declineChatJoinRequest(chat.id, userId)
): Unit = declineChatJoinRequest(chat.id, userId)
public suspend fun TelegramBot.declineChatJoinRequest(
chatId: ChatIdentifier,
user: User
): Boolean = declineChatJoinRequest(chatId, user.id)
): Unit = declineChatJoinRequest(chatId, user.id)
public suspend fun TelegramBot.declineChatJoinRequest(
chat: PublicChat,
user: User
): Boolean = declineChatJoinRequest(chat.id, user.id)
): Unit = declineChatJoinRequest(chat.id, user.id)
public suspend fun TelegramBot.declineChatJoinRequest(
chatJoinRequest: ChatJoinRequest
): Boolean = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
): Unit = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
public suspend fun TelegramBot.decline(
chatJoinRequest: ChatJoinRequest
): Boolean = declineChatJoinRequest(chatJoinRequest)
): Unit = declineChatJoinRequest(chatJoinRequest)
public suspend fun TelegramBot.declineChatJoinRequest(
chatJoinRequestUpdate: ChatJoinRequestUpdate
): Boolean = declineChatJoinRequest(chatJoinRequestUpdate.data)
): Unit = declineChatJoinRequest(chatJoinRequestUpdate.data)
@@ -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)
@@ -14,25 +14,25 @@ public suspend fun TelegramBot.banChatMember(
userId: UserId,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
): Boolean = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
): Unit = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
public suspend fun TelegramBot.banChatMember(
chat: PublicChat,
userId: UserId,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
): Boolean = banChatMember(chat.id, userId, untilDate, revokeMessages)
): Unit = banChatMember(chat.id, userId, untilDate, revokeMessages)
public suspend fun TelegramBot.banChatMember(
chatId: IdChatIdentifier,
user: User,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
): Boolean = banChatMember(chatId, user.id, untilDate, revokeMessages)
): Unit = banChatMember(chatId, user.id, untilDate, revokeMessages)
public suspend fun TelegramBot.banChatMember(
chat: PublicChat,
user: User,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
): Boolean = banChatMember(chat.id, user.id, untilDate, revokeMessages)
): Unit = banChatMember(chat.id, user.id, untilDate, revokeMessages)
@@ -9,19 +9,19 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
public suspend fun TelegramBot.banChatSenderChat(
chatId: ChatIdentifier,
senderChatId: IdChatIdentifier
): Boolean = execute(BanChatSenderChat(chatId, senderChatId))
): Unit = execute(BanChatSenderChat(chatId, senderChatId))
public suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChatId: IdChatIdentifier
): Boolean = banChatSenderChat(chat.id, senderChatId)
): Unit = banChatSenderChat(chat.id, senderChatId)
public suspend fun TelegramBot.banChatSenderChat(
chatId: IdChatIdentifier,
senderChat: PublicChat
): Boolean = banChatSenderChat(chatId, senderChat.id)
): Unit = banChatSenderChat(chatId, senderChat.id)
public suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
): Boolean = banChatSenderChat(chat.id, senderChat)
): Unit = banChatSenderChat(chat.id, senderChat)
@@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.PromoteChannelAdministrator
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.TelegramDate
@@ -26,8 +25,10 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = execute(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = execute(
PromoteChannelAdministrator(
chatId = chatId,
userId = userId,
@@ -44,7 +45,9 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canSendWelcomeMessages = canSendWelcomeMessages,
)
)
@@ -64,8 +67,10 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChannelAdministrator(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChannelAdministrator(
chat.id,
userId,
untilDate = untilDate,
@@ -81,7 +86,9 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canSendWelcomeMessages = canSendWelcomeMessages,
)
public suspend fun TelegramBot.promoteChannelAdministrator(
@@ -100,8 +107,10 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChannelAdministrator(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChannelAdministrator(
chatId,
user.id,
untilDate = untilDate,
@@ -117,7 +126,9 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canSendWelcomeMessages = canSendWelcomeMessages,
)
public suspend fun TelegramBot.promoteChannelAdministrator(
@@ -136,8 +147,10 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChannelAdministrator(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChannelAdministrator(
chat.id,
user.id,
untilDate = untilDate,
@@ -153,5 +166,7 @@ public suspend fun TelegramBot.promoteChannelAdministrator(
canManageChat = canManageChat,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canSendWelcomeMessages = canSendWelcomeMessages,
)
@@ -21,19 +21,23 @@ public suspend fun TelegramBot.promoteChatAdministrator(
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
): Boolean = execute(
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = execute(
PromoteChatMember(
chatId,
userId,
untilDate,
isAnonymous,
canChangeInfo,
canDeleteMessages,
canInviteUsers,
canRestrictMembers,
canPromoteMembers,
canManageVideoChats,
canManageChat
chatId = chatId,
userId = userId,
untilDate = untilDate,
isAnonymous = isAnonymous,
canChangeInfo = canChangeInfo,
canDeleteMessages = canDeleteMessages,
canInviteUsers = canInviteUsers,
canRestrictMembers = canRestrictMembers,
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
)
@@ -49,18 +53,22 @@ public suspend fun TelegramBot.promoteChatAdministrator(
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
): Boolean = promoteChatAdministrator(
chat.id,
userId,
untilDate,
isAnonymous,
canChangeInfo,
canDeleteMessages,
canInviteUsers,
canRestrictMembers,
canPromoteMembers,
canManageVideoChats,
canManageChat
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChatAdministrator(
chatId = chat.id,
userId = userId,
untilDate = untilDate,
isAnonymous = isAnonymous,
canChangeInfo = canChangeInfo,
canDeleteMessages = canDeleteMessages,
canInviteUsers = canInviteUsers,
canRestrictMembers = canRestrictMembers,
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
public suspend fun TelegramBot.promoteChatAdministrator(
@@ -75,18 +83,22 @@ public suspend fun TelegramBot.promoteChatAdministrator(
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
): Boolean = promoteChatAdministrator(
chatId,
user.id,
untilDate,
isAnonymous,
canChangeInfo,
canDeleteMessages,
canInviteUsers,
canRestrictMembers,
canPromoteMembers,
canManageVideoChats,
canManageChat
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChatAdministrator(
chatId = chatId,
userId = user.id,
untilDate = untilDate,
isAnonymous = isAnonymous,
canChangeInfo = canChangeInfo,
canDeleteMessages = canDeleteMessages,
canInviteUsers = canInviteUsers,
canRestrictMembers = canRestrictMembers,
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
public suspend fun TelegramBot.promoteChatAdministrator(
@@ -101,16 +113,20 @@ public suspend fun TelegramBot.promoteChatAdministrator(
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
): Boolean = promoteChatAdministrator(
chat.id,
user.id,
untilDate,
isAnonymous,
canChangeInfo,
canDeleteMessages,
canInviteUsers,
canRestrictMembers,
canPromoteMembers,
canManageVideoChats,
canManageChat
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteChatAdministrator(
chatId = chat.id,
userId = user.id,
untilDate = untilDate,
isAnonymous = isAnonymous,
canChangeInfo = canChangeInfo,
canDeleteMessages = canDeleteMessages,
canInviteUsers = canInviteUsers,
canRestrictMembers = canRestrictMembers,
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
@@ -26,8 +26,11 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = execute(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null
): Unit = execute(
PromoteChatMember(
chatId = chatId,
userId = userId,
@@ -46,7 +49,10 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
)
@@ -69,8 +75,11 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChatMember(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null
): Unit = promoteChatMember(
chat.id,
userId,
untilDate = untilDate,
@@ -88,7 +97,10 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
@Warning("This method is too common. Use it with caution")
@@ -110,8 +122,11 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChatMember(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null
): Unit = promoteChatMember(
chatId,
user.id,
untilDate = untilDate,
@@ -129,7 +144,10 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
@Warning("This method is too common. Use it with caution")
@@ -151,8 +169,11 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics: Boolean? = null,
canPostStories: Boolean? = null,
canEditStories: Boolean? = null,
canDeleteStories: Boolean? = null
): Boolean = promoteChatMember(
canDeleteStories: Boolean? = null,
canManageDirectMessages: Boolean? = null,
canManageTags: Boolean? = null,
canSendWelcomeMessages: Boolean? = null
): Unit = promoteChatMember(
chat.id,
user.id,
untilDate = untilDate,
@@ -170,5 +191,8 @@ public suspend fun TelegramBot.promoteChatMember(
canManageTopics = canManageTopics,
canPostStories = canPostStories,
canEditStories = canEditStories,
canDeleteStories = canDeleteStories
canDeleteStories = canDeleteStories,
canManageDirectMessages = canManageDirectMessages,
canManageTags = canManageTags,
canSendWelcomeMessages = canSendWelcomeMessages,
)
@@ -24,7 +24,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null,
): Boolean = execute(
canSendWelcomeMessages: Boolean? = null,
): Unit = execute(
PromoteSupergroupAdministrator(
chatId = chatId,
userId = userId,
@@ -38,7 +39,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTopics = canManageTopics
canManageTopics = canManageTopics,
canSendWelcomeMessages = canSendWelcomeMessages
)
)
@@ -56,7 +58,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null,
): Boolean = promoteSupergroupAdministrator(
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteSupergroupAdministrator(
chat.id,
userId,
untilDate = untilDate,
@@ -69,7 +72,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTopics = canManageTopics
canManageTopics = canManageTopics,
canSendWelcomeMessages = canSendWelcomeMessages
)
public suspend fun TelegramBot.promoteSupergroupAdministrator(
@@ -86,7 +90,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null,
): Boolean = promoteSupergroupAdministrator(
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteSupergroupAdministrator(
chatId,
user.id,
untilDate = untilDate,
@@ -99,7 +104,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTopics = canManageTopics
canManageTopics = canManageTopics,
canSendWelcomeMessages = canSendWelcomeMessages
)
public suspend fun TelegramBot.promoteSupergroupAdministrator(
@@ -116,7 +122,8 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null,
): Boolean = promoteSupergroupAdministrator(
canSendWelcomeMessages: Boolean? = null,
): Unit = promoteSupergroupAdministrator(
chat.id,
user.id,
untilDate = untilDate,
@@ -129,5 +136,6 @@ public suspend fun TelegramBot.promoteSupergroupAdministrator(
canPromoteMembers = canPromoteMembers,
canManageVideoChats = canManageVideoChats,
canManageChat = canManageChat,
canManageTopics = canManageTopics
canManageTopics = canManageTopics,
canSendWelcomeMessages = canSendWelcomeMessages
)
@@ -16,7 +16,7 @@ public suspend fun TelegramBot.restrictChatMember(
untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions(),
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
): Boolean = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions))
): Unit = execute(RestrictChatMember(chatId, userId, untilDate, permissions, useIndependentChatPermissions))
public suspend fun TelegramBot.restrictChatMember(
chat: PublicChat,
@@ -24,7 +24,7 @@ public suspend fun TelegramBot.restrictChatMember(
untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions(),
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
): Boolean = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions)
): Unit = restrictChatMember(chat.id, userId, untilDate, permissions, useIndependentChatPermissions)
public suspend fun TelegramBot.restrictChatMember(
chatId: IdChatIdentifier,
@@ -32,7 +32,7 @@ public suspend fun TelegramBot.restrictChatMember(
untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions(),
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
): Boolean = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions)
): Unit = restrictChatMember(chatId, user.id, untilDate, permissions, useIndependentChatPermissions)
public suspend fun TelegramBot.restrictChatMember(
chat: PublicChat,
@@ -40,5 +40,5 @@ public suspend fun TelegramBot.restrictChatMember(
untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions(),
useIndependentChatPermissions: Boolean? = permissions.isGranular.takeIf { it }
): Boolean = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions)
): Unit = restrictChatMember(chat.id, user.id, untilDate, permissions, useIndependentChatPermissions)
@@ -11,22 +11,22 @@ public suspend fun TelegramBot.setChatAdministratorCustomTitle(
chatId: IdChatIdentifier,
userId: UserId,
customTitle: String
): Boolean = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
): Unit = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
chat: PublicChat,
userId: UserId,
customTitle: String
): Boolean = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
): Unit = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
chatId: IdChatIdentifier,
user: User,
customTitle: String
): Boolean = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
): Unit = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
public suspend fun TelegramBot.setChatAdministratorCustomTitle(
chat: PublicChat,
user: User,
customTitle: String
): Boolean = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
): Unit = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
@@ -0,0 +1,31 @@
package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.SetChatMemberTag
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
public suspend fun TelegramBot.setChatMemberTag(
chatId: ChatIdentifier,
userId: UserId,
tag: UserTag? = null
): Unit = execute(SetChatMemberTag(chatId, userId, tag))
public suspend fun TelegramBot.setChatMemberTag(
chat: PublicChat,
userId: UserId,
tag: UserTag? = null
): Unit = setChatMemberTag(chat.id, userId, tag)
public suspend fun TelegramBot.setChatMemberTag(
chatId: ChatIdentifier,
user: User,
tag: UserTag? = null
): Unit = setChatMemberTag(chatId, user.id, tag)
public suspend fun TelegramBot.setChatMemberTag(
chat: PublicChat,
user: User,
tag: UserTag? = null
): Unit = setChatMemberTag(chat.id, user.id, tag)
@@ -12,23 +12,23 @@ public suspend fun TelegramBot.unbanChatMember(
chatId: ChatIdentifier,
userId: UserId,
onlyIfBanned: Boolean? = null
): Boolean = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
): Unit = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
public suspend fun TelegramBot.unbanChatMember(
chat: PublicChat,
userId: UserId,
onlyIfBanned: Boolean? = null
): Boolean = unbanChatMember(chat.id, userId, onlyIfBanned)
): Unit = unbanChatMember(chat.id, userId, onlyIfBanned)
public suspend fun TelegramBot.unbanChatMember(
chatId: IdChatIdentifier,
user: User,
onlyIfBanned: Boolean? = null
): Boolean = unbanChatMember(chatId, user.id, onlyIfBanned)
): Unit = unbanChatMember(chatId, user.id, onlyIfBanned)
public suspend fun TelegramBot.unbanChatMember(
chat: PublicChat,
user: User,
onlyIfBanned: Boolean? = null
): Boolean = unbanChatMember(chat.id, user.id, onlyIfBanned)
): Unit = unbanChatMember(chat.id, user.id, onlyIfBanned)
@@ -9,19 +9,19 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
public suspend fun TelegramBot.unbanChatSenderChat(
chatId: ChatIdentifier,
senderChatId: IdChatIdentifier
): Boolean = execute(UnbanChatSenderChat(chatId, senderChatId))
): Unit = execute(UnbanChatSenderChat(chatId, senderChatId))
public suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChatId: IdChatIdentifier
): Boolean = unbanChatSenderChat(chat.id, senderChatId)
): Unit = unbanChatSenderChat(chat.id, senderChatId)
public suspend fun TelegramBot.unbanChatSenderChat(
chatId: IdChatIdentifier,
senderChat: PublicChat
): Boolean = unbanChatSenderChat(chatId, senderChat.id)
): Unit = unbanChatSenderChat(chatId, senderChat.id)
public suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
): Boolean = unbanChatSenderChat(chat.id, senderChat)
): Unit = unbanChatSenderChat(chat.id, senderChat)
@@ -7,8 +7,8 @@ import dev.inmo.tgbotapi.types.chat.PublicChat
public suspend fun TelegramBot.deleteChatPhoto(
chatId: ChatIdentifier
): Boolean = execute(DeleteChatPhoto(chatId))
): Unit = execute(DeleteChatPhoto(chatId))
public suspend fun TelegramBot.deleteChatPhoto(
chat: PublicChat
): Boolean = deleteChatPhoto(chat.id)
): Unit = deleteChatPhoto(chat.id)
Loaded 100 of 1017 files, more files were not shown because too many files have changed in this diff. Show more