mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-04-08 02:52:27 +00:00
complete support of ManagedBotCreated and ManagedBotUpdated, add getManagedBotToken and replaceManagedBotToken
This commit is contained in:
@@ -2193,6 +2193,15 @@ inline fun Update.asInlineQueryUpdate(): InlineQueryUpdate? = this as? InlineQue
|
||||
@PreviewFeature
|
||||
inline fun Update.requireInlineQueryUpdate(): InlineQueryUpdate = this as InlineQueryUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> Update.whenManagedBotUpdate(block: (ManagedBotUpdate) -> T) = asManagedBotUpdate()?.let(block)
|
||||
|
||||
@PreviewFeature
|
||||
inline fun Update.asManagedBotUpdate(): ManagedBotUpdate? = this as? ManagedBotUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun Update.requireManagedBotUpdate(): ManagedBotUpdate = this as ManagedBotUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> Update.whenMessageUpdate(block: (MessageUpdate) -> T) = asMessageUpdate()?.let(block)
|
||||
|
||||
|
||||
@@ -531,6 +531,7 @@ import dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.EditChannelPostUpdate
|
||||
import dev.inmo.tgbotapi.types.update.EditMessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.InlineQueryUpdate
|
||||
import dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate
|
||||
@@ -4092,6 +4093,12 @@ public inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUp
|
||||
|
||||
public inline fun <T> Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T): T? = chosenInlineResultUpdateOrNull() ?.let(block)
|
||||
|
||||
public inline fun Update.managedBotUpdateOrNull(): ManagedBotUpdate? = this as? dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
|
||||
public inline fun Update.managedBotUpdateOrThrow(): ManagedBotUpdate = this as dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
|
||||
public inline fun <T> Update.ifManagedBotUpdate(block: (ManagedBotUpdate) -> T): T? = managedBotUpdateOrNull() ?.let(block)
|
||||
|
||||
public inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? dev.inmo.tgbotapi.types.update.ShippingQueryUpdate
|
||||
|
||||
public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as dev.inmo.tgbotapi.types.update.ShippingQueryUpdate
|
||||
|
||||
Reference in New Issue
Block a user