1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-10-23 21:20:38 +00:00

Add Bot API 10.3 General support

This commit is contained in:
2026-08-25 13:32:42 +06:00
parent f86bb6662e
commit 93a4bf1da0
30 changed files with 684 additions and 111 deletions

View File

@@ -2338,6 +2338,16 @@ inline fun Update.asBotSubscriptionUpdatedUpdate(): BotSubscriptionUpdatedUpdate
@PreviewFeature
inline fun Update.requireBotSubscriptionUpdatedUpdate(): BotSubscriptionUpdatedUpdate = this as BotSubscriptionUpdatedUpdate
@PreviewFeature
inline fun <T> Update.whenMessageGenerationStoppedUpdate(block: (MessageGenerationStoppedUpdate) -> T) =
asMessageGenerationStoppedUpdate()?.let(block)
@PreviewFeature
inline fun Update.asMessageGenerationStoppedUpdate(): MessageGenerationStoppedUpdate? = this as? MessageGenerationStoppedUpdate
@PreviewFeature
inline fun Update.requireMessageGenerationStoppedUpdate(): MessageGenerationStoppedUpdate = this as MessageGenerationStoppedUpdate
@PreviewFeature
inline fun <T> TelegramMediaFile.whenAnimationFile(block: (AnimationFile) -> T) = asAnimationFile()?.let(block)

View File

@@ -204,6 +204,7 @@ import dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.communities.CommunityChatAdded
import dev.inmo.tgbotapi.types.communities.CommunityChatJoined
import dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType
import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType
@@ -660,6 +661,7 @@ import dev.inmo.tgbotapi.types.update.EditMessageUpdate
import dev.inmo.tgbotapi.types.update.GuestMessageUpdate
import dev.inmo.tgbotapi.types.update.InlineQueryUpdate
import dev.inmo.tgbotapi.types.update.ManagedBotUpdate
import dev.inmo.tgbotapi.types.update.MessageGenerationStoppedUpdate
import dev.inmo.tgbotapi.types.update.MessageUpdate
import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate
import dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate
@@ -2134,6 +2136,12 @@ public inline fun ChatEvent.communityChatAddedOrThrow(): CommunityChatAdded = th
public inline fun <T> ChatEvent.ifCommunityChatAdded(block: (CommunityChatAdded) -> T): T? = communityChatAddedOrNull() ?.let(block)
public inline fun ChatEvent.communityChatJoinedOrNull(): CommunityChatJoined? = this as? dev.inmo.tgbotapi.types.communities.CommunityChatJoined
public inline fun ChatEvent.communityChatJoinedOrThrow(): CommunityChatJoined = this as dev.inmo.tgbotapi.types.communities.CommunityChatJoined
public inline fun <T> ChatEvent.ifCommunityChatJoined(block: (CommunityChatJoined) -> T): T? = communityChatJoinedOrNull() ?.let(block)
public inline fun ChatEvent.communityChatRemovedOrNull(): CommunityChatRemoved? = this as? dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
public inline fun ChatEvent.communityChatRemovedOrThrow(): CommunityChatRemoved = this as dev.inmo.tgbotapi.types.communities.CommunityChatRemoved
@@ -4156,6 +4164,12 @@ public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = thi
public inline fun <T> Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T): T? = shippingQueryUpdateOrNull() ?.let(block)
public inline fun Update.messageGenerationStoppedUpdateOrNull(): MessageGenerationStoppedUpdate? = this as? dev.inmo.tgbotapi.types.update.MessageGenerationStoppedUpdate
public inline fun Update.messageGenerationStoppedUpdateOrThrow(): MessageGenerationStoppedUpdate = this as dev.inmo.tgbotapi.types.update.MessageGenerationStoppedUpdate
public inline fun <T> Update.ifMessageGenerationStoppedUpdate(block: (MessageGenerationStoppedUpdate) -> T): T? = messageGenerationStoppedUpdateOrNull() ?.let(block)
public inline fun Update.chatBoostUpdatedUpdateOrNull(): ChatBoostUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate
public inline fun Update.chatBoostUpdatedUpdateOrThrow(): ChatBoostUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate