mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-22 16:47:13 +00:00
update ClassCasts
This commit is contained in:
parent
f07a179448
commit
65bcf83517
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user