1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 12:08:43 +00:00

remove redundant class casts

This commit is contained in:
InsanusMokrassar 2023-04-22 10:51:37 +06:00
parent e2cbd5ee0b
commit 8e6b3b7260

View File

@ -16,8 +16,6 @@ import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
import dev.inmo.tgbotapi.requests.stickers.InputSticker import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.ChatFolderInviteLink
import dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.ChatIdWithThreadId import dev.inmo.tgbotapi.types.ChatIdWithThreadId
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
@ -563,25 +561,6 @@ public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlim
public inline fun <T> WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? public inline fun <T> WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T?
= chatInviteLinkUnlimitedOrNull() ?.let(block) = chatInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkOrNull(): ChatFolderInviteLink? = this as?
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun WithUser.chatFolderInviteLinkOrThrow(): ChatFolderInviteLink = this as
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun <T> WithUser.ifChatFolderInviteLink(block: (ChatFolderInviteLink) -> T): T? =
chatFolderInviteLinkOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrNull(): ChatFolderInviteLinkUnlimited? =
this as? dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrThrow(): ChatFolderInviteLinkUnlimited =
this as dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun <T>
WithUser.ifChatFolderInviteLinkUnlimited(block: (ChatFolderInviteLinkUnlimited) -> T): T? =
chatFolderInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as?
dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult