1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

update ClassCasts

This commit is contained in:
InsanusMokrassar 2023-05-19 22:42:42 +06:00
parent f07a179448
commit 65bcf83517

View File

@ -329,6 +329,7 @@ import dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent
import dev.inmo.tgbotapi.types.message.content.StaticLocationContent
import dev.inmo.tgbotapi.types.message.content.StickerContent
import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.content.TextedContent
import dev.inmo.tgbotapi.types.message.content.TextedMediaContent
import dev.inmo.tgbotapi.types.message.content.VenueContent
import dev.inmo.tgbotapi.types.message.content.VideoContent
@ -3712,6 +3713,15 @@ public inline fun <T>
ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent<TelegramMediaFile>) -> T):
T? = mediaCollectionContentOrNull() ?.let(block)
public inline fun ResendableContent.textedContentOrNull(): TextedContent? = this as?
dev.inmo.tgbotapi.types.message.content.TextedContent
public inline fun ResendableContent.textedContentOrThrow(): TextedContent = this as
dev.inmo.tgbotapi.types.message.content.TextedContent
public inline fun <T> ResendableContent.ifTextedContent(block: (TextedContent) -> T): T? =
textedContentOrNull() ?.let(block)
public inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as?
dev.inmo.tgbotapi.types.message.content.MediaContent