1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-16 13:49:26 +00:00

Partially add DirectMessagesTopic

This commit is contained in:
2025-08-25 16:39:23 +06:00
parent b69be31362
commit 048f65b8d4
14 changed files with 121 additions and 34 deletions

View File

@@ -1335,6 +1335,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun diceContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/DiceContent;
public static final fun dimmableOrNull (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$Dimmable;
public static final fun dimmableOrThrow (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$Dimmable;
public static final fun directMessagesTopicOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/DirectMessagesTopic;
public static final fun directMessagesTopicOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/DirectMessagesTopic;
public static final fun disabledOrNull (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;)Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection$Disabled;
public static final fun disabledOrThrow (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;)Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection$Disabled;
public static final fun documentContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/DocumentContent;
@@ -1686,6 +1688,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDiceContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDimmable (Ldev/inmo/tgbotapi/types/BackgroundType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDirectMessagesTopic (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDisabled (Ldev/inmo/tgbotapi/types/business_connection/BusinessConnection;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDocumentContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifDocumentFile (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;

View File

@@ -130,6 +130,7 @@ import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
import dev.inmo.tgbotapi.types.chat.CommonBot
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.chat.DirectMessagesTopic
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
@@ -641,6 +642,12 @@ public inline fun OptionallyWithUser.chatJoinRequestOrThrow(): ChatJoinRequest =
public inline fun <T> OptionallyWithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = chatJoinRequestOrNull() ?.let(block)
public inline fun OptionallyWithUser.directMessagesTopicOrNull(): DirectMessagesTopic? = this as? dev.inmo.tgbotapi.types.chat.DirectMessagesTopic
public inline fun OptionallyWithUser.directMessagesTopicOrThrow(): DirectMessagesTopic = this as dev.inmo.tgbotapi.types.chat.DirectMessagesTopic
public inline fun <T> OptionallyWithUser.ifDirectMessagesTopic(block: (DirectMessagesTopic) -> T): T? = directMessagesTopicOrNull() ?.let(block)
public inline fun OptionallyWithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember
public inline fun OptionallyWithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember