mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-03-03 17:32:23 +00:00
add support of date_time messages entities
This commit is contained in:
@@ -3036,6 +3036,15 @@ inline fun TextSource.asTextMentionTextSource(): TextMentionTextSource? = this a
|
||||
@PreviewFeature
|
||||
inline fun TextSource.requireTextMentionTextSource(): TextMentionTextSource = this as TextMentionTextSource
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> TextSource.whenDateTimeTextSource(block: (DateTimeTextSource) -> T) = asDateTimeTextSource()?.let(block)
|
||||
|
||||
@PreviewFeature
|
||||
inline fun TextSource.asDateTimeTextSource(): DateTimeTextSource? = this as? DateTimeTextSource
|
||||
|
||||
@PreviewFeature
|
||||
inline fun TextSource.requireDateTimeTextSource(): DateTimeTextSource = this as DateTimeTextSource
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> TextSource.whenURLTextSource(block: (URLTextSource) -> T) = asURLTextSource()?.let(block)
|
||||
|
||||
|
||||
@@ -402,6 +402,7 @@ import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.CodeTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource
|
||||
import dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource
|
||||
@@ -2805,6 +2806,12 @@ public inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this
|
||||
|
||||
public inline fun <T> TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T): T? = italicTextSourceOrNull() ?.let(block)
|
||||
|
||||
public inline fun TextSource.dateTimeTextSourceOrNull(): DateTimeTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource
|
||||
|
||||
public inline fun TextSource.dateTimeTextSourceOrThrow(): DateTimeTextSource = this as dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource
|
||||
|
||||
public inline fun <T> TextSource.ifDateTimeTextSource(block: (DateTimeTextSource) -> T): T? = dateTimeTextSourceOrNull() ?.let(block)
|
||||
|
||||
public inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource
|
||||
|
||||
public inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource
|
||||
|
||||
Reference in New Issue
Block a user