diff --git a/CHANGELOG.md b/CHANGELOG.md index d5050e6606..ba782918db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,55 @@ ## 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`: + * **BREAKING CHANGE** `PollOption` reimplemented as a sealed interface hierarchy: + * `PollOption.Simple` replaces `SimplePollOption` + * `PollOption.LatelyAdded` sealed interface added with `AddedByUser` and `AddedByChat` variants + * `PollOption` now has `id: PollOptionPersistentId` field + * **BREAKING CHANGE** `QuizPoll.correctOptionId` replaced with `correctOptionIds: List` (multiple correct options support) + * **BREAKING CHANGE** `PollAnswer.Anonymous.voterChat` type changed from `ChannelChat` to `PreviewPublicChat` + * **BREAKING CHANGE** `SendPoll` and `SendRegularPoll` init checks no longer throw errors, warnings are logged instead + * **BREAKING CHANGE** `requestChannelReplyButton` for groups renamed to `requestGroupReplyButton` + * **BREAKING CHANGE** `openPeriodPollSecondsLimit` changed from `5 .. 600` to `5 .. 2628000` + * Added `PollOptionPersistentId` value class + * Added `PollOptionAdded` and `PollOptionDeleted` chat events + * Added `chosenPersistentIds` to `PollAnswer` + * Added `pollOptionId` support in `ReplyParameters` and `ReplyInfo` (`reply_to_poll_option_id`) + * Added `allowsRevoting`, `shuffleOptions`, `hideResultsUntilCloses` fields to `SendRegularPoll` and `SendQuizPoll` + * Added `allowAddingOptions` field to `SendRegularPoll` + * Added `description`, `descriptionParseMode`, `descriptionTextSources` fields to `SendQuizPoll` and `SendRegularPoll` + * Added `allowsMultipleAnswers` field to `SendQuizPoll` + * Added `openPeriod` and `closeDate` parameters to `SendPoll` function + * Added `ManagedBotCreated` and `ManagedBotUpdated` chat events + * Added `ManagedBotUpdate` update type and `UPDATE_MANAGED_BOT` constant + * Added `GetManagedBotToken` and `ReplaceManagedBotToken` requests + * Added `BotToken` value class + * Added `KeyboardButtonRequestManagedBot` and `RequestManagedBotKeyboardButton` + * Added `requestManagedBotReplyButton` shortcuts + * Added `SavePreparedKeyboardButton` request + * Added `PreparedKeyboardButton` and `PreparedKeyboardButtonId` types + * Added `canManageBots` field to `ExtendedBot` + * Added `managedBotNewBotUsername` constant +* `API`: + * Added `savePreparedKeyboardButton` extensions + * Added `getManagedBotToken` and `replaceManagedBotToken` extensions +* `BehaviourBuilder`: + * Added event triggers: `onManagedBotCreated`, `onManagedBotUpdated`, `onPollOptionAdded`, `onPollOptionDeleted` + * Added `onManagedBotUpdate` trigger for `ManagedBotUpdated` updates + * Added `waitManagedBotCreatedEvents`, `waitManagedBotUpdatedEvents`, `waitPollOptionAddedEvents`, `waitPollOptionDeletedEvents` expectations + * Added `waitManagedBotUpdated` expectation + * Added `ManagedBotUpdatedFilterByUser` and `ByUserManagedBotUpdatedMarkerFactory` +* `Utils`: + * Added `managedBotCreationLink` functions for building managed bot creation links + * Added `requestManagedBotButton` extensions to `ReplyKeyboardRowBuilder` + * Regenerated class casts extensions +* `WebApps`: + * Added `requestChat` method to `WebApp` + ## 32.0.0 **THIS UPDATE CONTAINS BREAKING CHANGES** diff --git a/README.md b/README.md index 5f658c3798..c275f01707 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-9.5-blue)](https://core.telegram.org/bots/api-changelog#march-1-2026) +# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-9.6-blue)](https://core.telegram.org/bots/api-changelog#april-3-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) | |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt index 0325afdde8..29e2217934 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt @@ -14,6 +14,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializ import dev.inmo.tgbotapi.types.message.content.PollContent import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.polls.* +import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog import korlibs.time.millisecondsLong import korlibs.time.seconds import kotlinx.serialization.* @@ -244,7 +245,9 @@ internal fun ScheduledCloseInfo.checkSendData() { is ApproximateScheduledCloseInfo -> openDuration.seconds }.toInt() if (span !in openPeriodPollSecondsLimit) { - error("Duration of autoclose for polls must be in range $openPeriodPollSecondsLimit, but was $span") + DefaultKTgBotAPIKSLog.w("checkSendData") { + "Duration of autoclose for polls must be in range $openPeriodPollSecondsLimit, but was $span" + } } }