1
0
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:
2026-03-02 15:29:26 +06:00
parent b17d7a868a
commit 4f97327d29
11 changed files with 436 additions and 5 deletions

View File

@@ -71,6 +71,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
public static final fun asCustomDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/CustomDiceAnimationType;
public static final fun asDartsDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/DartsDiceAnimationType;
public static final fun asDataCallbackQuery (Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery;
public static final fun asDateTimeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/DateTimeTextSource;
public static final fun asDeleteChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto;
public static final fun asDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/DescribedInlineQueryResult;
public static final fun asDiceContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/DiceContent;
@@ -416,6 +417,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
public static final fun requireCustomDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/CustomDiceAnimationType;
public static final fun requireDartsDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/DartsDiceAnimationType;
public static final fun requireDataCallbackQuery (Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery;
public static final fun requireDateTimeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/DateTimeTextSource;
public static final fun requireDeleteChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto;
public static final fun requireDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/DescribedInlineQueryResult;
public static final fun requireDiceContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/DiceContent;
@@ -761,6 +763,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
public static final fun whenCustomDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDartsDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDataCallbackQuery (Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDateTimeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDeleteChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun whenDiceContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1337,6 +1340,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun dartsDiceAnimationTypeOrThrow (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/DartsDiceAnimationType;
public static final fun dataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery;
public static final fun dataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery;
public static final fun dateTimeTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/DateTimeTextSource;
public static final fun dateTimeTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/DateTimeTextSource;
public static final fun deleteChatPhotoOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto;
public static final fun deleteChatPhotoOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto;
public static final fun deletedBusinessMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/DeletedBusinessMessageUpdate;
@@ -1710,6 +1715,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifCustomEmojiVideoSticker (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDartsDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDateTimeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDeleteChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDeletedBusinessMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;

View File

@@ -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)

View File

@@ -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