mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-25 15:45:47 +00:00
Compare commits
4 Commits
8de584b292
...
e4a3acdd68
| Author | SHA1 | Date | |
|---|---|---|---|
| e4a3acdd68 | |||
| 953bdef657 | |||
| 64ef0fa160 | |||
| c1f40c1030 |
@@ -7170,6 +7170,33 @@ public final class dev/inmo/tgbotapi/types/BotShortDescription$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/BusinessChatId : dev/inmo/tgbotapi/types/IdChatIdentifier {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/BusinessChatId$Companion;
|
||||
public static final synthetic fun box-impl (Lkotlin/Pair;)Ldev/inmo/tgbotapi/types/BusinessChatId;
|
||||
public static fun constructor-impl (JLjava/lang/String;)Lkotlin/Pair;
|
||||
public static fun constructor-impl (Lkotlin/Pair;)Lkotlin/Pair;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public static fun equals-impl (Lkotlin/Pair;Ljava/lang/Object;)Z
|
||||
public static final fun equals-impl0 (Lkotlin/Pair;Lkotlin/Pair;)Z
|
||||
public fun getBusinessId-T-_HSQI ()Ljava/lang/String;
|
||||
public static fun getBusinessId-T-_HSQI (Lkotlin/Pair;)Ljava/lang/String;
|
||||
public synthetic fun getBusinessId-nXr5wdE ()Ljava/lang/String;
|
||||
public fun getChatId-iyD94Bc ()J
|
||||
public static fun getChatId-iyD94Bc (Lkotlin/Pair;)J
|
||||
public final fun getChatIdWithBusinessConnectionId ()Lkotlin/Pair;
|
||||
public fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
public static fun getThreadId-S3HF-10 (Lkotlin/Pair;)Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
public fun hashCode ()I
|
||||
public static fun hashCode-impl (Lkotlin/Pair;)I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
public static fun toString-impl (Lkotlin/Pair;)Ljava/lang/String;
|
||||
public final synthetic fun unbox-impl ()Lkotlin/Pair;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/BusinessChatId$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/CallbackQueryId {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/CallbackQueryId$Companion;
|
||||
public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/CallbackQueryId;
|
||||
@@ -7207,6 +7234,8 @@ public final class dev/inmo/tgbotapi/types/ChatId : dev/inmo/tgbotapi/types/IdCh
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public static fun equals-impl (JLjava/lang/Object;)Z
|
||||
public static final fun equals-impl0 (JJ)Z
|
||||
public fun getBusinessId-nXr5wdE ()Ljava/lang/String;
|
||||
public static fun getBusinessId-nXr5wdE (J)Ljava/lang/String;
|
||||
public fun getChatId-iyD94Bc ()J
|
||||
public fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
public static fun getThreadId-S3HF-10 (J)Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
@@ -7229,6 +7258,8 @@ public final class dev/inmo/tgbotapi/types/ChatIdWithThreadId : dev/inmo/tgbotap
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public static fun equals-impl (Lkotlin/Pair;Ljava/lang/Object;)Z
|
||||
public static final fun equals-impl0 (Lkotlin/Pair;Lkotlin/Pair;)Z
|
||||
public fun getBusinessId-nXr5wdE ()Ljava/lang/String;
|
||||
public static fun getBusinessId-nXr5wdE (Lkotlin/Pair;)Ljava/lang/String;
|
||||
public fun getChatId-iyD94Bc ()J
|
||||
public static fun getChatId-iyD94Bc (Lkotlin/Pair;)J
|
||||
public final fun getChatIdWithThreadId ()Lkotlin/Pair;
|
||||
@@ -7262,6 +7293,7 @@ public final class dev/inmo/tgbotapi/types/ChatIdentifierKt {
|
||||
public static final fun getUserLink (Ldev/inmo/tgbotapi/types/chat/User;)Ljava/lang/String;
|
||||
public static final fun getUserLink-0218hRU (J)Ljava/lang/String;
|
||||
public static final fun getUserLink-HZVsHAI (J)Ljava/lang/String;
|
||||
public static final fun toBusinessChatId-X6RVWW0 (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public static final fun toChatId (B)Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public static final fun toChatId (I)Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public static final fun toChatId (J)J
|
||||
@@ -7527,6 +7559,9 @@ public final class dev/inmo/tgbotapi/types/CommonKt {
|
||||
public static final field botIsMemberField Ljava/lang/String;
|
||||
public static final field botUsernameField Ljava/lang/String;
|
||||
public static final field businessConnectionIdField Ljava/lang/String;
|
||||
public static final field businessIntroField Ljava/lang/String;
|
||||
public static final field businessLocationField Ljava/lang/String;
|
||||
public static final field businessOpeningHoursField Ljava/lang/String;
|
||||
public static final field buttonField Ljava/lang/String;
|
||||
public static final field buttonTextField Ljava/lang/String;
|
||||
public static final field cacheTimeField Ljava/lang/String;
|
||||
@@ -8097,6 +8132,7 @@ public final class dev/inmo/tgbotapi/types/FullChatIdentifierSerializer : kotlin
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/IdChatIdentifier : dev/inmo/tgbotapi/types/ChatIdentifier {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/IdChatIdentifier$Companion;
|
||||
public abstract fun getBusinessId-nXr5wdE ()Ljava/lang/String;
|
||||
public abstract fun getChatId-iyD94Bc ()J
|
||||
public abstract fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
}
|
||||
@@ -8104,10 +8140,12 @@ public abstract interface class dev/inmo/tgbotapi/types/IdChatIdentifier : dev/i
|
||||
public final class dev/inmo/tgbotapi/types/IdChatIdentifier$Companion {
|
||||
public final fun invoke-0PTMirw (J)J
|
||||
public final fun invoke-FNqv5JM (JLdev/inmo/tgbotapi/types/MessageThreadId;)Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public final fun invoke-y2sHuGA (JLjava/lang/String;)Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/IdChatIdentifier$DefaultImpls {
|
||||
public static fun getBusinessId-nXr5wdE (Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Ljava/lang/String;
|
||||
public static fun getThreadId-S3HF-10 (Ldev/inmo/tgbotapi/types/IdChatIdentifier;)Ldev/inmo/tgbotapi/types/MessageThreadId;
|
||||
}
|
||||
|
||||
@@ -12868,6 +12906,47 @@ public final class dev/inmo/tgbotapi/types/chat/Bot$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/BusinessChat : dev/inmo/tgbotapi/types/chat/Chat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/BusinessChat$Companion;
|
||||
public abstract fun getId-y8AA8dk ()Lkotlin/Pair;
|
||||
public abstract fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/PrivateChat;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/BusinessChat$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/BusinessChatImpl : dev/inmo/tgbotapi/types/chat/PreviewBusinessChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl$Companion;
|
||||
public synthetic fun <init> (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-y8AA8dk ()Lkotlin/Pair;
|
||||
public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;
|
||||
public final fun copy-rh-56jM (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;)Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl;
|
||||
public static synthetic fun copy-rh-56jM$default (Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public fun getId-y8AA8dk ()Lkotlin/Pair;
|
||||
public fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;
|
||||
public synthetic fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/PrivateChat;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/BusinessChatImpl$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl$$serializer;
|
||||
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/chat/BusinessChatImpl;)V
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/BusinessChatImpl$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/ChannelChat : dev/inmo/tgbotapi/types/chat/SuperPublicChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ChannelChat$Companion;
|
||||
public abstract fun getId-tHkBKVM ()J
|
||||
@@ -13491,6 +13570,51 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChat : dev/inmo/tgbotapi/types/chat/BusinessChat, dev/inmo/tgbotapi/types/chat/ExtendedChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChat$Companion;
|
||||
public abstract fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChat$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedBusinessChat, dev/inmo/tgbotapi/types/chat/ExtendedChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl$Companion;
|
||||
public synthetic fun <init> (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-y8AA8dk ()Lkotlin/Pair;
|
||||
public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;
|
||||
public final fun copy-rh-56jM (Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;)Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl;
|
||||
public static synthetic fun copy-rh-56jM$default (Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl;Lkotlin/Pair;Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getAccentColorId-f3WtEc0 ()I
|
||||
public fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String;
|
||||
public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto;
|
||||
public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
public fun getId-y8AA8dk ()Lkotlin/Pair;
|
||||
public fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;
|
||||
public synthetic fun getOriginal ()Ldev/inmo/tgbotapi/types/chat/PrivateChat;
|
||||
public fun getProfileAccentColorId-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId;
|
||||
public fun getProfileBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl$$serializer;
|
||||
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl;)V
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/ExtendedChannelChat : dev/inmo/tgbotapi/types/chat/ChannelChat, dev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername, dev/inmo/tgbotapi/types/chat/ExtendedPublicChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat$Companion;
|
||||
public abstract fun getLinkedGroupChatId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier;
|
||||
@@ -13585,6 +13709,12 @@ public abstract class dev/inmo/tgbotapi/types/chat/ExtendedChatSerializer : kotl
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedChatSerializer$BasedOnBusinessConnection : dev/inmo/tgbotapi/types/chat/ExtendedChatSerializer {
|
||||
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/chat/ExtendedChat;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedChatSerializer$BasedOnForumThread : dev/inmo/tgbotapi/types/chat/ExtendedChatSerializer {
|
||||
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/chat/ExtendedChat;
|
||||
@@ -13775,6 +13905,9 @@ public abstract interface class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChat
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat$Companion;
|
||||
public abstract fun getAllowCreateUserIdLink ()Z
|
||||
public abstract fun getBio ()Ljava/lang/String;
|
||||
public abstract fun getBusinessIntro ()Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;
|
||||
public abstract fun getBusinessLocation ()Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;
|
||||
public abstract fun getBusinessOpeningHours ()Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;
|
||||
public abstract fun getHasPrivateForwards ()Z
|
||||
public abstract fun getHasRestrictedVoiceAndVideoMessages ()Z
|
||||
}
|
||||
@@ -13789,8 +13922,8 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChat$DefaultImpls
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedPrivateChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl$Companion;
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-tHkBKVM ()J
|
||||
public final fun component10-GbmMWyQ ()Ljava/lang/String;
|
||||
public final fun component11 ()Ldev/inmo/tgbotapi/types/TelegramDate;
|
||||
@@ -13798,6 +13931,9 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl : dev/in
|
||||
public final fun component13-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId;
|
||||
public final fun component14-GbmMWyQ ()Ljava/lang/String;
|
||||
public final fun component15-GbmMWyQ ()Ljava/lang/String;
|
||||
public final fun component16 ()Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;
|
||||
public final fun component17 ()Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;
|
||||
public final fun component18 ()Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;
|
||||
public final fun component2 ()Ldev/inmo/tgbotapi/types/ChatPhoto;
|
||||
public final fun component3-san03mo ()Ljava/lang/String;
|
||||
public final fun component4 ()Ljava/util/List;
|
||||
@@ -13806,14 +13942,17 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl : dev/in
|
||||
public final fun component7 ()Ljava/lang/String;
|
||||
public final fun component8 ()Z
|
||||
public final fun component9 ()Z
|
||||
public final fun copy-e_ALIDo (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;
|
||||
public static synthetic fun copy-e_ALIDo$default (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;
|
||||
public final fun copy-4P93q3c (JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;)Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;
|
||||
public static synthetic fun copy-4P93q3c$default (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;JLdev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getAccentColorId-f3WtEc0 ()I
|
||||
public fun getActiveUsernames ()Ljava/util/List;
|
||||
public fun getAllowCreateUserIdLink ()Z
|
||||
public fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String;
|
||||
public fun getBio ()Ljava/lang/String;
|
||||
public fun getBusinessIntro ()Ldev/inmo/tgbotapi/types/business_connection/BusinessIntro;
|
||||
public fun getBusinessLocation ()Ldev/inmo/tgbotapi/types/business_connection/BusinessLocation;
|
||||
public fun getBusinessOpeningHours ()Ldev/inmo/tgbotapi/types/business_connection/BusinessOpeningHours;
|
||||
public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto;
|
||||
public fun getFirstName ()Ljava/lang/String;
|
||||
public fun getHasPrivateForwards ()Z
|
||||
@@ -14050,6 +14189,14 @@ public final class dev/inmo/tgbotapi/types/chat/PreviewBot$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/PreviewBusinessChat : dev/inmo/tgbotapi/types/chat/BusinessChat, dev/inmo/tgbotapi/types/chat/PreviewChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/PreviewBusinessChat$Companion;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/chat/PreviewBusinessChat$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public abstract interface class dev/inmo/tgbotapi/types/chat/PreviewChannelChat : dev/inmo/tgbotapi/types/chat/ChannelChat, dev/inmo/tgbotapi/types/chat/PreviewSuperPublicChat {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat$Companion;
|
||||
}
|
||||
@@ -17132,13 +17279,16 @@ public final class dev/inmo/tgbotapi/types/message/AnonymousGroupContentMessageI
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/message/BusinessContentMessageImpl : dev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage {
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/ForwardInfo;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/ForwardInfo;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/ForwardInfo;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-APLFQys ()J
|
||||
public final fun component10 ()Ldev/inmo/tgbotapi/types/ReplyInfo;
|
||||
public final fun component11 ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public final fun component12 ()Ldev/inmo/tgbotapi/types/chat/CommonBot;
|
||||
public final fun component13-CsYhHCU ()Ljava/lang/String;
|
||||
public final fun component14 ()Ldev/inmo/tgbotapi/types/chat/PreviewBot;
|
||||
public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/User;
|
||||
public final fun component3 ()Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;
|
||||
public final fun component4-T-_HSQI ()Ljava/lang/String;
|
||||
@@ -17147,8 +17297,8 @@ public final class dev/inmo/tgbotapi/types/message/BusinessContentMessageImpl :
|
||||
public final fun component7-Ivn3T5g ()Lkorlibs/time/DateTime;
|
||||
public final fun component8 ()Z
|
||||
public final fun component9 ()Ldev/inmo/tgbotapi/types/message/MessageOrigin;
|
||||
public final fun copy-DsA41C8 (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;
|
||||
public static synthetic fun copy-DsA41C8$default (Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;
|
||||
public final fun copy-FGAwJ3U (JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;)Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;
|
||||
public static synthetic fun copy-FGAwJ3U$default (Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;JLdev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewBot;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/BusinessContentMessageImpl;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getBusinessConnectionId-T-_HSQI ()Ljava/lang/String;
|
||||
public synthetic fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String;
|
||||
@@ -17169,6 +17319,7 @@ public final class dev/inmo/tgbotapi/types/message/BusinessContentMessageImpl :
|
||||
public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;
|
||||
public fun getReplyTo ()Ldev/inmo/tgbotapi/types/message/abstracts/Message;
|
||||
public fun getSenderBot ()Ldev/inmo/tgbotapi/types/chat/CommonBot;
|
||||
public fun getSenderBusinessBot ()Ldev/inmo/tgbotapi/types/chat/PreviewBot;
|
||||
public fun getUser ()Ldev/inmo/tgbotapi/types/chat/User;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
@@ -18447,6 +18598,7 @@ public final class dev/inmo/tgbotapi/types/message/abstracts/AnonymousGroupConte
|
||||
public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage : dev/inmo/tgbotapi/abstracts/types/WithBusinessConnectionId, dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage, dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage {
|
||||
public abstract fun getBusinessConnectionId-T-_HSQI ()Ljava/lang/String;
|
||||
public abstract fun getChat ()Ldev/inmo/tgbotapi/types/chat/PreviewPrivateChat;
|
||||
public abstract fun getSenderBusinessBot ()Ldev/inmo/tgbotapi/types/chat/PreviewBot;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage$DefaultImpls {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.abstracts.types
|
||||
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
|
||||
interface OptionallyBusinessConnectionRequest {
|
||||
val businessConnectionId: BusinessConnectionId?
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.chat.get
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.ChatRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.BusinessChatId
|
||||
import dev.inmo.tgbotapi.types.ChatIdWithThreadId
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChatSerializer
|
||||
@@ -16,10 +17,10 @@ data class GetChat(
|
||||
): ChatRequest, SimpleRequest<ExtendedChat> {
|
||||
override fun method(): String = "getChat"
|
||||
@Transient
|
||||
override val resultDeserializer: DeserializationStrategy<ExtendedChat> = if (chatId is ChatIdWithThreadId) {
|
||||
ExtendedChatSerializer.BasedOnForumThread(chatId.threadId)
|
||||
} else {
|
||||
ExtendedChatSerializer.Companion
|
||||
override val resultDeserializer: DeserializationStrategy<ExtendedChat> = when {
|
||||
chatId is ChatIdWithThreadId -> ExtendedChatSerializer.BasedOnForumThread(chatId.threadId)
|
||||
chatId is BusinessChatId -> ExtendedChatSerializer.BasedOnBusinessConnection(chatId.businessId)
|
||||
else -> ExtendedChatSerializer.Companion
|
||||
}
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
|
||||
@@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -28,6 +29,7 @@ fun CopyMessage(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -40,6 +42,7 @@ fun CopyMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -52,6 +55,7 @@ fun CopyMessage(
|
||||
messageId: MessageId,
|
||||
entities: List<TextSource>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -64,6 +68,7 @@ fun CopyMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -77,6 +82,7 @@ fun CopyMessage(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -89,6 +95,7 @@ fun CopyMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -101,6 +108,7 @@ fun CopyMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
entities: List<TextSource>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -113,6 +121,7 @@ fun CopyMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -135,6 +144,8 @@ data class CopyMessage internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -2,10 +2,12 @@ package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
||||
import dev.inmo.tgbotapi.abstracts.types.MessagesAction
|
||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
||||
import dev.inmo.tgbotapi.abstracts.types.ProtectContent
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
@@ -20,6 +22,7 @@ fun CopyMessages(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageIds: Array<MessageId>,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
removeCaption: Boolean = false
|
||||
@@ -43,6 +46,8 @@ data class CopyMessages (
|
||||
override val messageIds: List<MessageId>,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -53,6 +58,7 @@ data class CopyMessages (
|
||||
MessagesAction,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyBusinessConnectionRequest,
|
||||
DisableNotification {
|
||||
override val chatId: ChatIdentifier
|
||||
get() = fromChatId
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendChatMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.actions.BotAction
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
|
||||
@@ -17,8 +19,10 @@ data class SendAction(
|
||||
@SerialName(actionField)
|
||||
val action: BotAction,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId
|
||||
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest {
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||
): SendChatMessageRequest<Boolean>, OptionallyMessageThreadRequest, OptionallyBusinessConnectionRequest {
|
||||
override fun method(): String = "sendChatAction"
|
||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||
get() = Boolean.serializer()
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -24,6 +25,8 @@ data class SendContact(
|
||||
val lastName: String? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -39,6 +42,7 @@ data class SendContact(
|
||||
chatId: ChatIdentifier,
|
||||
contact: Contact,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -49,6 +53,7 @@ data class SendContact(
|
||||
contact.firstName,
|
||||
contact.lastName,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -65,6 +70,7 @@ data class SendContact(
|
||||
fun Contact.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -73,6 +79,7 @@ fun Contact.toRequest(
|
||||
chatId,
|
||||
this,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
|
||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
@@ -21,7 +22,9 @@ data class SendDice(
|
||||
@SerialName(emojiField)
|
||||
val animationType: DiceAnimationType? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId?,
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -19,6 +20,7 @@ fun SendLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -32,6 +34,7 @@ fun SendLocation(
|
||||
null,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -43,11 +46,12 @@ fun SendStaticLocation(
|
||||
latitude: Double,
|
||||
longitude: Double,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = SendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||
|
||||
fun SendLiveLocation(
|
||||
chatId: ChatIdentifier,
|
||||
@@ -58,6 +62,7 @@ fun SendLiveLocation(
|
||||
heading: Degrees? = null,
|
||||
proximityAlertRadius: Meters? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -71,6 +76,7 @@ fun SendLiveLocation(
|
||||
heading,
|
||||
proximityAlertRadius,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -95,6 +101,8 @@ data class SendLocation internal constructor(
|
||||
override val proximityAlertRadius: Meters? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
import dev.inmo.tgbotapi.abstracts.types.LinkPreviewOptionsContainer
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -26,6 +27,7 @@ fun SendTextMessage(
|
||||
parseMode: ParseMode? = null,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -36,6 +38,7 @@ fun SendTextMessage(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
linkPreviewOptions,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
@@ -48,6 +51,7 @@ fun SendTextMessage(
|
||||
entities: TextSourcesList,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -58,6 +62,7 @@ fun SendTextMessage(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
linkPreviewOptions,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
@@ -77,6 +82,8 @@ data class SendTextMessage internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(disableNotificationField)
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -34,6 +35,8 @@ data class SendVenue(
|
||||
val googlePlaceType: GooglePlaceType? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -51,6 +54,7 @@ data class SendVenue(
|
||||
chatId: ChatIdentifier,
|
||||
venue: Venue,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -82,6 +86,7 @@ data class SendVenue(
|
||||
fun Venue.toRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -90,6 +95,7 @@ fun Venue.toRequest(
|
||||
chatId,
|
||||
this,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
|
||||
@@ -6,4 +6,5 @@ interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>,
|
||||
WithReplyParameters,
|
||||
DisableNotification,
|
||||
ProtectContent,
|
||||
OptionallyMessageThreadRequest
|
||||
OptionallyMessageThreadRequest,
|
||||
OptionallyBusinessConnectionRequest
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.requests.send.games
|
||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -20,6 +21,8 @@ data class SendGame (
|
||||
val gameShortName: String,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -31,6 +32,7 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -51,6 +53,7 @@ fun SendAnimation(
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -77,6 +80,7 @@ fun SendAnimation(
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -97,6 +101,7 @@ fun SendAnimation(
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -140,6 +145,8 @@ data class SendAnimationData internal constructor(
|
||||
override val height: Int? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -31,6 +32,7 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -50,6 +52,7 @@ fun SendAudio(
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -75,6 +78,7 @@ fun SendAudio(
|
||||
performer: String? = null,
|
||||
title: String? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -94,6 +98,7 @@ fun SendAudio(
|
||||
performer,
|
||||
title,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -135,6 +140,8 @@ data class SendAudioData internal constructor(
|
||||
override val title: String? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -36,6 +37,7 @@ fun SendDocument(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -53,6 +55,7 @@ fun SendDocument(
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -85,6 +88,7 @@ fun SendDocument(
|
||||
thumbnail: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -102,6 +106,7 @@ fun SendDocument(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -147,6 +152,8 @@ data class SendDocumentData internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.media.*
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
|
||||
@@ -32,6 +33,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<MediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -56,6 +58,7 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
|
||||
chatId,
|
||||
media,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters
|
||||
@@ -81,11 +84,12 @@ inline fun SendPlaylist(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<AudioMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<AudioContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<AudioContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
/**
|
||||
* Use this method to be sure that you are correctly sending documents media group
|
||||
@@ -97,11 +101,12 @@ inline fun SendDocumentsGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<DocumentMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
/**
|
||||
* Use this method to be sure that you are correctly sending visual media group
|
||||
@@ -114,11 +119,12 @@ inline fun SendVisualMediaGroup(
|
||||
chatId: ChatIdentifier,
|
||||
media: List<VisualMediaGroupMemberTelegramMedia>,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
allowSendingWithoutReply: Boolean? = null
|
||||
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply)
|
||||
|
||||
private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> {
|
||||
private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>())
|
||||
@@ -142,6 +148,8 @@ data class SendMediaGroupData internal constructor(
|
||||
val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -26,6 +27,7 @@ fun SendPhoto(
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -39,6 +41,7 @@ fun SendPhoto(
|
||||
null,
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -60,6 +63,7 @@ fun SendPhoto(
|
||||
entities: TextSourcesList,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -73,6 +77,7 @@ fun SendPhoto(
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -108,6 +113,8 @@ data class SendPhotoData internal constructor(
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -15,6 +16,7 @@ fun SendSticker(
|
||||
chatId: ChatIdentifier,
|
||||
sticker: InputFile,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
emoji: String? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -24,6 +26,7 @@ fun SendSticker(
|
||||
chatId,
|
||||
sticker,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -49,6 +52,8 @@ data class SendStickerByFileId internal constructor(
|
||||
val sticker: InputFile,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -32,6 +33,7 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -53,6 +55,7 @@ fun SendVideo(
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -80,6 +83,7 @@ fun SendVideo(
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -101,6 +105,7 @@ fun SendVideo(
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -146,6 +151,8 @@ data class SendVideoData internal constructor(
|
||||
val supportStreaming: Boolean? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -19,6 +20,7 @@ fun SendVideoNote(
|
||||
duration: Long? = null,
|
||||
size: Int? = null, // in documentation - length (size of video side)
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -34,6 +36,7 @@ fun SendVideoNote(
|
||||
duration,
|
||||
size,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -67,6 +70,8 @@ data class SendVideoNoteData internal constructor(
|
||||
override val width: Int? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.media.base.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
@@ -27,6 +28,7 @@ fun SendVoice(
|
||||
parseMode: ParseMode? = null,
|
||||
duration: Long? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -42,6 +44,7 @@ fun SendVoice(
|
||||
null,
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -63,6 +66,7 @@ fun SendVoice(
|
||||
voice: InputFile,
|
||||
entities: TextSourcesList,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
duration: Long? = null,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
@@ -79,6 +83,7 @@ fun SendVoice(
|
||||
entities.toRawMessageEntities(),
|
||||
duration,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -114,6 +119,8 @@ data class SendVoiceData internal constructor(
|
||||
override val duration: Long? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
|
||||
import dev.inmo.tgbotapi.abstracts.types.*
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
@@ -60,6 +61,8 @@ data class SendInvoice(
|
||||
override val priceDependOnShipAddress: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.abstracts.TextedOutput
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
@@ -51,6 +52,7 @@ fun SendPoll(
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -75,6 +77,7 @@ fun SendPoll(
|
||||
fun Poll.createRequest(
|
||||
chatId: ChatIdentifier,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -89,6 +92,7 @@ fun Poll.createRequest(
|
||||
allowMultipleAnswers,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -119,6 +123,7 @@ fun Poll.createRequest(
|
||||
false,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -133,6 +138,7 @@ fun Poll.createRequest(
|
||||
false,
|
||||
scheduledCloseInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -198,6 +204,8 @@ data class SendRegularPoll(
|
||||
override val closeDate: LongSeconds?,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
@@ -226,6 +234,7 @@ fun SendRegularPoll(
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -240,6 +249,7 @@ fun SendRegularPoll(
|
||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -257,6 +267,7 @@ fun SendQuizPoll(
|
||||
parseMode: ParseMode? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -273,6 +284,7 @@ fun SendQuizPoll(
|
||||
null,
|
||||
closeInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -289,6 +301,7 @@ fun SendQuizPoll(
|
||||
entities: List<TextSource>,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -305,6 +318,7 @@ fun SendQuizPoll(
|
||||
entities.toRawMessageEntities(),
|
||||
closeInfo,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -323,6 +337,7 @@ internal fun SendQuizPoll(
|
||||
rawEntities: List<RawMessageEntity>? = null,
|
||||
closeInfo: ScheduledCloseInfo? = null,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
@@ -340,6 +355,7 @@ internal fun SendQuizPoll(
|
||||
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
|
||||
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
@@ -372,6 +388,8 @@ data class SendQuizPoll internal constructor(
|
||||
override val closeDate: LongSeconds? = null,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = chatId.threadId,
|
||||
@SerialName(businessConnectionIdField)
|
||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@SerialName(disableNotificationField)
|
||||
override val disableNotification: Boolean = false,
|
||||
@SerialName(protectContentField)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||
@@ -29,12 +30,17 @@ sealed interface IdChatIdentifier : ChatIdentifier {
|
||||
abstract val chatId: RawChatId
|
||||
val threadId: MessageThreadId?
|
||||
get() = null
|
||||
val businessId: BusinessConnectionId?
|
||||
get() = null
|
||||
|
||||
companion object {
|
||||
operator fun invoke(chatId: RawChatId) = ChatId(chatId)
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId?) = threadId ?.let {
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId? = null, businessConnectionId: BusinessConnectionId? = null) = threadId ?.let {
|
||||
ChatIdWithThreadId(chatId, threadId)
|
||||
} ?: businessConnectionId ?.let {
|
||||
BusinessChatId(chatId, businessConnectionId)
|
||||
} ?: ChatId(chatId)
|
||||
operator fun invoke(chatId: RawChatId, threadId: MessageThreadId) = ChatIdWithThreadId(chatId, threadId)
|
||||
operator fun invoke(chatId: RawChatId, businessConnectionId: BusinessConnectionId) = BusinessChatId(chatId, businessConnectionId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,16 +58,31 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair<RawChatId, MessageTh
|
||||
|
||||
constructor(chatId: RawChatId, threadId: MessageThreadId): this(chatId to threadId)
|
||||
}
|
||||
@Serializable(ChatIdentifierSerializer::class)
|
||||
@JvmInline
|
||||
value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, BusinessConnectionId>) : IdChatIdentifier {
|
||||
override val chatId: RawChatId
|
||||
get() = chatIdWithBusinessConnectionId.first
|
||||
override val businessId: BusinessConnectionId
|
||||
get() = chatIdWithBusinessConnectionId.second
|
||||
|
||||
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
|
||||
}
|
||||
|
||||
val ChatIdentifier.threadId: MessageThreadId?
|
||||
get() = (this as? IdChatIdentifier) ?.threadId
|
||||
|
||||
val ChatIdentifier.businessConnectionId: BusinessConnectionId?
|
||||
get() = (this as? IdChatIdentifier) ?.businessConnectionId
|
||||
|
||||
fun IdChatIdentifier.toChatId() = when (this) {
|
||||
is ChatId -> this
|
||||
is ChatIdWithThreadId -> ChatId(chatId)
|
||||
is BusinessChatId -> ChatId(chatId)
|
||||
}
|
||||
|
||||
fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId)
|
||||
fun IdChatIdentifier.toBusinessChatId(businessConnectionId: BusinessConnectionId) = IdChatIdentifier(chatId, businessConnectionId)
|
||||
|
||||
/**
|
||||
* https://core.telegram.org/bots/api#formatting-options
|
||||
@@ -145,14 +166,22 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
ChatId(RawChatId(it))
|
||||
} ?:let {
|
||||
val splitted = id.content.split("/")
|
||||
if (splitted.size == 2) {
|
||||
val (chatId, threadId) = splitted
|
||||
ChatIdWithThreadId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
threadId.toLongOrNull() ?.let(::MessageThreadId) ?: return@let null
|
||||
)
|
||||
} else {
|
||||
null
|
||||
when (splitted.size) {
|
||||
2 -> {
|
||||
val (chatId, threadId) = splitted
|
||||
ChatIdWithThreadId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
threadId.toLongOrNull() ?.let(::MessageThreadId) ?: return@let null
|
||||
)
|
||||
}
|
||||
3 -> {
|
||||
val (chatId, _, businessConnectionId) = splitted
|
||||
BusinessChatId(
|
||||
chatId.toLongOrNull() ?.let(::RawChatId) ?: return@let null,
|
||||
businessConnectionId.let(::BusinessConnectionId) ?: return@let null
|
||||
)
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
} ?: id.content.let {
|
||||
if (!it.startsWith("@")) {
|
||||
@@ -167,6 +196,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
when (value) {
|
||||
is ChatId -> encoder.encodeLong(value.chatId.long)
|
||||
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
|
||||
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessId}")
|
||||
is Username -> encoder.encodeString(value.full)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ const val accentColorIdField = "accent_color_id"
|
||||
const val profileAccentColorIdField = "profile_accent_color_id"
|
||||
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
||||
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
||||
const val personalChatField = "personal_chat"
|
||||
const val hasVisibleHistoryField = "has_visible_history"
|
||||
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
||||
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
||||
@@ -158,6 +159,7 @@ const val canJoinGroupsField = "can_join_groups"
|
||||
const val canReadAllGroupMessagesField = "can_read_all_group_messages"
|
||||
const val canReplyField = "can_reply"
|
||||
const val supportInlineQueriesField = "supports_inline_queries"
|
||||
const val canConnectToBusinessField = "can_connect_to_business"
|
||||
const val textEntitiesField = "text_entities"
|
||||
const val entitiesField = "entities"
|
||||
const val stickerSetNameField = "set_name"
|
||||
|
||||
@@ -7,4 +7,8 @@ import kotlin.jvm.JvmInline
|
||||
@JvmInline
|
||||
value class BusinessConnectionId(
|
||||
val string: String
|
||||
)
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,12 @@ sealed interface PrivateChat : Chat, UsernameChat {
|
||||
val lastName: String
|
||||
}
|
||||
|
||||
@Serializable(ChatSerializer::class)
|
||||
sealed interface BusinessChat : Chat {
|
||||
override val id: BusinessChatId
|
||||
val original: PrivateChat
|
||||
}
|
||||
|
||||
@Serializable(ChatSerializer::class)
|
||||
sealed interface PublicChat : Chat {
|
||||
val title: String
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.chat
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
import kotlinx.serialization.*
|
||||
@@ -62,8 +63,9 @@ object ChatSerializer : KSerializer<Chat> {
|
||||
return try {
|
||||
formatter.decodeFromJsonElement(ExtendedChatSerializer, decodedJson)
|
||||
} catch (e: SerializationException) {
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson")
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
|
||||
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val original = decodedJson[originField]
|
||||
|
||||
when (type) {
|
||||
ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
|
||||
@@ -80,6 +82,12 @@ object ChatSerializer : KSerializer<Chat> {
|
||||
decodedJson.toString(),
|
||||
decodedJson
|
||||
)
|
||||
null -> {
|
||||
when {
|
||||
original != null -> formatter.decodeFromJsonElement(BusinessChatImpl.serializer(), decodedJson)
|
||||
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,8 +109,9 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
|
||||
override fun deserialize(decoder: Decoder): PreviewChat {
|
||||
val decodedJson = JsonObject.serializer().deserialize(decoder)
|
||||
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson")
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
|
||||
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val original = decodedJson[originField]
|
||||
|
||||
return when (type) {
|
||||
ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
|
||||
@@ -119,12 +128,19 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
|
||||
decodedJson.toString(),
|
||||
decodedJson
|
||||
)
|
||||
null -> {
|
||||
when {
|
||||
original != null -> formatter.decodeFromJsonElement(PreviewBusinessChat.serializer(), decodedJson)
|
||||
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: PreviewChat) {
|
||||
when (value) {
|
||||
is PrivateChatImpl -> PrivateChatImpl.serializer().serialize(encoder, value)
|
||||
is BusinessChatImpl -> BusinessChatImpl.serializer().serialize(encoder, value)
|
||||
is GroupChatImpl -> GroupChatImpl.serializer().serialize(encoder, value)
|
||||
is SupergroupChatImpl -> SupergroupChatImpl.serializer().serialize(encoder, value)
|
||||
is ForumChatImpl -> ForumChatImpl.serializer().serialize(encoder, value)
|
||||
@@ -144,8 +160,9 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
|
||||
override fun deserialize(decoder: Decoder): ExtendedChat {
|
||||
val decodedJson = JsonObject.serializer().deserialize(decoder)
|
||||
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType ?: error("Field $typeField must be presented, but absent in $decodedJson")
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
|
||||
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val original = decodedJson[originField]
|
||||
|
||||
return when (type) {
|
||||
ChatType.Sender -> formatter.decodeFromJsonElement(ExtendedPrivateChatImpl.serializer(), decodedJson)
|
||||
@@ -162,11 +179,18 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
|
||||
decodedJson.toString(),
|
||||
decodedJson
|
||||
)
|
||||
null -> {
|
||||
when {
|
||||
original != null -> formatter.decodeFromJsonElement(ExtendedBusinessChatImpl.serializer(), decodedJson)
|
||||
else -> error("Field $typeField must be presented for common types (excluding Business chats), but absent in $decodedJson")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: ExtendedChat) {
|
||||
when (value) {
|
||||
is ExtendedBusinessChatImpl -> ExtendedBusinessChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedPrivateChatImpl -> ExtendedPrivateChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedGroupChatImpl -> ExtendedGroupChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedSupergroupChatImpl -> ExtendedSupergroupChatImpl.serializer().serialize(encoder, value)
|
||||
@@ -190,6 +214,20 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
|
||||
}
|
||||
}
|
||||
}
|
||||
class BasedOnBusinessConnection(private val businessConnectionId: BusinessConnectionId) : ExtendedChatSerializer() {
|
||||
override fun deserialize(decoder: Decoder): ExtendedChat {
|
||||
return super.deserialize(decoder).let {
|
||||
if (it is ExtendedPrivateChatImpl) {
|
||||
ExtendedBusinessChatImpl(
|
||||
BusinessChatId(it.id.chatId, businessConnectionId),
|
||||
it
|
||||
)
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object : ExtendedChatSerializer()
|
||||
}
|
||||
|
||||
@@ -133,6 +133,9 @@ data class ExtendedPrivateChatImpl(
|
||||
override val businessLocation: BusinessLocation? = null,
|
||||
@SerialName(businessOpeningHoursField)
|
||||
override val businessOpeningHours: BusinessOpeningHours? = null,
|
||||
@SerialName(personalChatField)
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
override val personalChat: PreviewChannelChat? = null
|
||||
) : ExtendedPrivateChat
|
||||
|
||||
typealias ExtendedUser = ExtendedPrivateChatImpl
|
||||
@@ -263,6 +266,7 @@ data class ExtendedForumChatImpl(
|
||||
|
||||
@Serializable
|
||||
data class ExtendedBot(
|
||||
@SerialName(idField)
|
||||
override val id: UserId,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@@ -276,6 +280,8 @@ data class ExtendedBot(
|
||||
val canReadAllGroupMessages: Boolean = false,
|
||||
@SerialName(supportInlineQueriesField)
|
||||
val supportsInlineQueries: Boolean = false,
|
||||
@SerialName(canConnectToBusinessField)
|
||||
val canConnectToBusiness: Boolean = false,
|
||||
@SerialName(photoField)
|
||||
override val chatPhoto: ChatPhoto? = null,
|
||||
@SerialName(accentColorIdField)
|
||||
@@ -291,6 +297,14 @@ data class ExtendedBot(
|
||||
private val isBot = true
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ExtendedBusinessChatImpl(
|
||||
@SerialName(idField)
|
||||
override val id: BusinessChatId,
|
||||
@SerialName(originField)
|
||||
override val original: ExtendedPrivateChat
|
||||
) : ExtendedBusinessChat, ExtendedChat by original
|
||||
|
||||
data class UnknownExtendedChat(
|
||||
override val id: IdChatIdentifier,
|
||||
val raw: String,
|
||||
|
||||
@@ -46,6 +46,8 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
|
||||
val businessLocation: BusinessLocation?
|
||||
val businessOpeningHours: BusinessOpeningHours?
|
||||
|
||||
val personalChat: PreviewChannelChat?
|
||||
|
||||
val allowCreateUserIdLink: Boolean
|
||||
get() = hasPrivateForwards
|
||||
}
|
||||
@@ -93,3 +95,8 @@ sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat
|
||||
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
|
||||
val activeUsernames: List<Username>
|
||||
}
|
||||
|
||||
@Serializable(ExtendedChatSerializer.Companion::class)
|
||||
sealed interface ExtendedBusinessChat : BusinessChat, ExtendedChat {
|
||||
override val original: ExtendedPrivateChat
|
||||
}
|
||||
|
||||
@@ -30,6 +30,15 @@ data class PrivateChatImpl(
|
||||
override val lastName: String = ""
|
||||
) : PreviewPrivateChat
|
||||
|
||||
@Serializable
|
||||
@RiskFeature("This class is a subject of changes. It is better to use PrivateChat due")
|
||||
data class BusinessChatImpl(
|
||||
@SerialName(idField)
|
||||
override val id: BusinessChatId,
|
||||
@SerialName(originField)
|
||||
override val original: PreviewPrivateChat
|
||||
) : PreviewBusinessChat
|
||||
|
||||
@Serializable
|
||||
@RiskFeature("This class is a subject of changes. It is better to use SupergroupChat due")
|
||||
data class SupergroupChatImpl(
|
||||
|
||||
@@ -11,6 +11,9 @@ sealed interface PreviewUsernameChat : PreviewChat, UsernameChat
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PreviewPrivateChat : PreviewUsernameChat, PrivateChat
|
||||
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PreviewBusinessChat : BusinessChat, PreviewChat
|
||||
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PreviewPublicChat : PreviewChat, PublicChat
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
data class BusinessContentMessageImpl<T: MessageContent>(
|
||||
override val messageId: MessageId,
|
||||
override val from: User,
|
||||
override val chat: PreviewPrivateChat,
|
||||
override val chat: PreviewBusinessChat,
|
||||
override val businessConnectionId: BusinessConnectionId,
|
||||
override val content: T,
|
||||
override val date: DateTime,
|
||||
@@ -26,12 +26,13 @@ data class BusinessContentMessageImpl<T: MessageContent>(
|
||||
override val replyMarkup: InlineKeyboardMarkup?,
|
||||
override val senderBot: CommonBot?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val senderBusinessBot: PreviewBot? = null
|
||||
override val senderBusinessBot: PreviewBot?,
|
||||
override val fromOffline: Boolean,
|
||||
) : BusinessContentMessage<T> {
|
||||
constructor(
|
||||
messageId: MessageId,
|
||||
from: User,
|
||||
chat: PreviewPrivateChat,
|
||||
chat: PreviewBusinessChat,
|
||||
businessConnectionId: BusinessConnectionId,
|
||||
content: T,
|
||||
date: DateTime,
|
||||
@@ -42,7 +43,8 @@ data class BusinessContentMessageImpl<T: MessageContent>(
|
||||
replyMarkup: InlineKeyboardMarkup?,
|
||||
senderBot: CommonBot?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
senderBusinessBot: PreviewBot? = null,
|
||||
senderBusinessBot: PreviewBot?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
messageId = messageId,
|
||||
from = from,
|
||||
@@ -57,6 +59,7 @@ data class BusinessContentMessageImpl<T: MessageContent>(
|
||||
replyMarkup = replyMarkup,
|
||||
senderBot = senderBot,
|
||||
mediaGroupId = mediaGroupId,
|
||||
senderBusinessBot = senderBusinessBot
|
||||
senderBusinessBot = senderBusinessBot,
|
||||
fromOffline = fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ data class ChannelContentMessageImpl<T: MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : ChannelContentMessage<T> {
|
||||
constructor(
|
||||
messageId: MessageId,
|
||||
@@ -35,7 +36,8 @@ data class ChannelContentMessageImpl<T: MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
messageId, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId
|
||||
messageId, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ data class ConnectedFromChannelGroupContentMessageImpl<T : MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : ConnectedFromChannelGroupContentMessage<T> {
|
||||
|
||||
constructor(
|
||||
@@ -39,8 +40,9 @@ data class ConnectedFromChannelGroupContentMessageImpl<T : MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, channel, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId
|
||||
chat, channel, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -58,6 +60,7 @@ data class UnconnectedFromChannelGroupContentMessageImpl<T: MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : UnconnectedFromChannelGroupContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewGroupChat,
|
||||
@@ -73,8 +76,9 @@ data class UnconnectedFromChannelGroupContentMessageImpl<T: MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, channel, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId
|
||||
chat, channel, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -91,6 +95,7 @@ data class AnonymousGroupContentMessageImpl<T : MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : AnonymousGroupContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewGroupChat,
|
||||
@@ -105,8 +110,9 @@ data class AnonymousGroupContentMessageImpl<T : MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId
|
||||
chat, messageId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -123,7 +129,8 @@ data class CommonGroupContentMessageImpl<T : MessageContent>(
|
||||
override val content: T,
|
||||
override val senderBot: CommonBot?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val senderBoostsCount: Int?
|
||||
override val senderBoostsCount: Int?,
|
||||
override val fromOffline: Boolean,
|
||||
) : CommonGroupContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewGroupChat,
|
||||
@@ -139,8 +146,9 @@ data class CommonGroupContentMessageImpl<T : MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
senderBoostsCount: Int?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, messageId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount
|
||||
chat, messageId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -159,6 +167,7 @@ data class FromChannelForumContentMessageImpl<T: MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : FromChannelForumContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewForumChat,
|
||||
@@ -175,8 +184,9 @@ data class FromChannelForumContentMessageImpl<T: MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, channel, messageId, threadId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId
|
||||
chat, channel, messageId, threadId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -194,6 +204,7 @@ data class AnonymousForumContentMessageImpl<T : MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : AnonymousForumContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewForumChat,
|
||||
@@ -209,8 +220,9 @@ data class AnonymousForumContentMessageImpl<T : MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, messageId, threadId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId
|
||||
chat, messageId, threadId, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, authorSignature, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -229,6 +241,7 @@ data class CommonForumContentMessageImpl<T : MessageContent>(
|
||||
override val senderBot: CommonBot?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val senderBoostsCount: Int?,
|
||||
override val fromOffline: Boolean,
|
||||
) : CommonForumContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewForumChat,
|
||||
@@ -245,7 +258,8 @@ data class CommonForumContentMessageImpl<T : MessageContent>(
|
||||
senderBot: CommonBot?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
senderBoostsCount: Int?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
chat, messageId, threadId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount
|
||||
chat, messageId, threadId, from, date, forwardInfo.messageOrigin(), editDate, hasProtectedContent, replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, content, senderBot, mediaGroupId, senderBoostsCount, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ data class PrivateContentMessageImpl<T: MessageContent>(
|
||||
override val replyMarkup: InlineKeyboardMarkup?,
|
||||
override val senderBot: CommonBot?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
) : PrivateContentMessage<T> {
|
||||
constructor(
|
||||
messageId: MessageId,
|
||||
@@ -37,7 +38,8 @@ data class PrivateContentMessageImpl<T: MessageContent>(
|
||||
replyMarkup: InlineKeyboardMarkup?,
|
||||
senderBot: CommonBot?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
) : this(
|
||||
messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, mediaGroupId
|
||||
messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, mediaGroupId, fromOffline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ internal data class RawMessage(
|
||||
private val users_shared: UsersShared? = null,
|
||||
private val chat_shared: ChatShared? = null,
|
||||
|
||||
private val is_from_offline: Boolean = false,
|
||||
|
||||
// Voice Chat Service Messages
|
||||
private val video_chat_scheduled: VideoChatScheduled? = null,
|
||||
private val video_chat_started: VideoChatStarted? = null,
|
||||
@@ -313,18 +315,19 @@ internal data class RawMessage(
|
||||
when (chat) {
|
||||
is PreviewPublicChat -> when (chat) {
|
||||
is PreviewChannelChat -> ChannelContentMessageImpl(
|
||||
messageId,
|
||||
chat,
|
||||
content,
|
||||
date.asDate,
|
||||
edit_date?.asDate,
|
||||
has_protected_content == true,
|
||||
forward_origin,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
messageId = messageId,
|
||||
chat = chat,
|
||||
content = content,
|
||||
date = date.asDate,
|
||||
editDate = edit_date?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
forwardOrigin = forward_origin,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
is PreviewForumChat -> if (messageThreadId != null) {
|
||||
val chatId = ChatIdWithThreadId(
|
||||
@@ -336,215 +339,231 @@ internal data class RawMessage(
|
||||
}
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> FromChannelForumContentMessageImpl(
|
||||
actualForumChat,
|
||||
sender_chat,
|
||||
messageId,
|
||||
messageThreadId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = actualForumChat,
|
||||
channel = sender_chat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
is PreviewGroupChat -> AnonymousForumContentMessageImpl(
|
||||
actualForumChat,
|
||||
messageId,
|
||||
messageThreadId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = actualForumChat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
null -> CommonForumContentMessageImpl(
|
||||
actualForumChat,
|
||||
messageId,
|
||||
messageThreadId,
|
||||
from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
media_group_id,
|
||||
sender_boost_count
|
||||
chat = actualForumChat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
mediaGroupId = media_group_id,
|
||||
senderBoostsCount = sender_boost_count,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
} else {
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> if (is_automatic_forward == true) {
|
||||
ConnectedFromChannelGroupContentMessageImpl(
|
||||
chat,
|
||||
sender_chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
channel = sender_chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
} else {
|
||||
UnconnectedFromChannelGroupContentMessageImpl(
|
||||
chat,
|
||||
sender_chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
channel = sender_chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
is GroupChat -> AnonymousGroupContentMessageImpl(
|
||||
chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
null -> CommonGroupContentMessageImpl(
|
||||
chat,
|
||||
messageId,
|
||||
from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
media_group_id,
|
||||
sender_boost_count
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
mediaGroupId = media_group_id,
|
||||
senderBoostsCount = sender_boost_count,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
}
|
||||
is PreviewGroupChat -> when (sender_chat) {
|
||||
is PreviewChannelChat -> if (is_automatic_forward == true) {
|
||||
ConnectedFromChannelGroupContentMessageImpl(
|
||||
chat,
|
||||
sender_chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
channel = sender_chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
} else {
|
||||
UnconnectedFromChannelGroupContentMessageImpl(
|
||||
chat,
|
||||
sender_chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
channel = sender_chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
is PreviewGroupChat -> AnonymousGroupContentMessageImpl(
|
||||
chat,
|
||||
messageId,
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
author_signature,
|
||||
media_group_id
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
authorSignature = author_signature,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
null -> CommonGroupContentMessageImpl(
|
||||
chat,
|
||||
messageId,
|
||||
from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date.asDate,
|
||||
forward_origin,
|
||||
edit_date ?.asDate,
|
||||
has_protected_content == true,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
content,
|
||||
via_bot,
|
||||
media_group_id,
|
||||
sender_boost_count
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"),
|
||||
date = date.asDate,
|
||||
forwardOrigin = forward_origin,
|
||||
editDate = edit_date ?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
content = content,
|
||||
senderBot = via_bot,
|
||||
mediaGroupId = media_group_id,
|
||||
senderBoostsCount = sender_boost_count,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
}
|
||||
is PreviewPrivateChat -> if (business_connection_id == null) {
|
||||
PrivateContentMessageImpl(
|
||||
messageId,
|
||||
from ?: error("Was detected common message, but owner (sender) of the message was not found"),
|
||||
chat,
|
||||
content,
|
||||
date.asDate,
|
||||
edit_date?.asDate,
|
||||
has_protected_content == true,
|
||||
forward_origin,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
via_bot,
|
||||
media_group_id
|
||||
messageId = messageId,
|
||||
from = from ?: error("Was detected common message, but owner (sender) of the message was not found"),
|
||||
chat = chat,
|
||||
content = content,
|
||||
date = date.asDate,
|
||||
editDate = edit_date?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
forwardOrigin = forward_origin,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
senderBot = via_bot,
|
||||
mediaGroupId = media_group_id,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
} else {
|
||||
BusinessContentMessageImpl(
|
||||
messageId,
|
||||
from ?: error("Was detected common message, but owner (sender) of the message was not found"),
|
||||
chat,
|
||||
business_connection_id,
|
||||
content,
|
||||
date.asDate,
|
||||
edit_date?.asDate,
|
||||
has_protected_content == true,
|
||||
forward_origin,
|
||||
replyInfo,
|
||||
reply_markup,
|
||||
via_bot,
|
||||
media_group_id,
|
||||
sender_business_bot
|
||||
messageId = messageId,
|
||||
from = from ?: error("Was detected common message, but owner (sender) of the message was not found"),
|
||||
chat = BusinessChatImpl(
|
||||
chat.id.toBusinessChatId(business_connection_id),
|
||||
chat
|
||||
),
|
||||
businessConnectionId = business_connection_id,
|
||||
content = content,
|
||||
date = date.asDate,
|
||||
editDate = edit_date?.asDate,
|
||||
hasProtectedContent = has_protected_content == true,
|
||||
forwardOrigin = forward_origin,
|
||||
replyInfo = replyInfo,
|
||||
replyMarkup = reply_markup,
|
||||
senderBot = via_bot,
|
||||
mediaGroupId = media_group_id,
|
||||
senderBusinessBot = sender_business_bot,
|
||||
fromOffline = is_from_offline
|
||||
)
|
||||
}
|
||||
else -> error("Unknown type of chat: $chat")
|
||||
|
||||
@@ -3,12 +3,13 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
||||
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewBot
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewPrivateChat
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
|
||||
interface BusinessContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage,
|
||||
WithBusinessConnectionId {
|
||||
override val chat: PreviewPrivateChat
|
||||
override val chat: PreviewBusinessChat
|
||||
override val businessConnectionId: BusinessConnectionId
|
||||
val senderBusinessBot: PreviewBot?
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@ sealed interface CommonMessage<out T: MessageContent> : AccessibleMessage,
|
||||
PossiblyReplyMessage,
|
||||
PossiblyMarkedUp,
|
||||
PossiblyBusinessMessage,
|
||||
PossiblyOfflineMessage,
|
||||
PossiblyMediaGroupMessage<T>,
|
||||
ContentMessage<T>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.message.abstracts
|
||||
|
||||
interface PossiblyOfflineMessage : Message {
|
||||
val fromOffline: Boolean
|
||||
}
|
||||
@@ -3,6 +3,6 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewPrivateChat
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
|
||||
interface PrivateContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage {
|
||||
interface PrivateContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage, PossiblyOfflineMessage {
|
||||
override val chat: PreviewPrivateChat
|
||||
}
|
||||
|
||||
@@ -1745,7 +1745,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifPollAnswerUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPollContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPollUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPossiblyBusinessMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPossiblyEditedMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPossiblyForwardedMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPossiblyMediaGroupMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -2158,8 +2157,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun pollContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PollContent;
|
||||
public static final fun pollUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PollUpdate;
|
||||
public static final fun pollUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PollUpdate;
|
||||
public static final fun possiblyBusinessMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyBusinessMessage;
|
||||
public static final fun possiblyBusinessMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyBusinessMessage;
|
||||
public static final fun possiblyEditedMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyEditedMessage;
|
||||
public static final fun possiblyEditedMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyEditedMessage;
|
||||
public static final fun possiblyForwardedMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyForwardedMessage;
|
||||
|
||||
@@ -16,6 +16,7 @@ import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
|
||||
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
|
||||
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.types.BusinessChatId
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.ChatIdWithThreadId
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
@@ -112,6 +113,7 @@ import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove
|
||||
import dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat
|
||||
import dev.inmo.tgbotapi.types.chat.Bot
|
||||
import dev.inmo.tgbotapi.types.chat.BusinessChat
|
||||
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
@@ -119,6 +121,7 @@ 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.ExtendedBot
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername
|
||||
@@ -132,6 +135,7 @@ import dev.inmo.tgbotapi.types.chat.ForumChat
|
||||
import dev.inmo.tgbotapi.types.chat.GroupChat
|
||||
import dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewBot
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChannelChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewForumChat
|
||||
@@ -1108,6 +1112,15 @@ public inline fun ChatIdentifier.chatIdWithThreadIdOrThrow(): ChatIdWithThreadId
|
||||
public inline fun <T> ChatIdentifier.ifChatIdWithThreadId(block: (ChatIdWithThreadId) -> T): T? =
|
||||
chatIdWithThreadIdOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatIdentifier.businessChatIdOrNull(): BusinessChatId? = this as?
|
||||
dev.inmo.tgbotapi.types.BusinessChatId
|
||||
|
||||
public inline fun ChatIdentifier.businessChatIdOrThrow(): BusinessChatId = this as
|
||||
dev.inmo.tgbotapi.types.BusinessChatId
|
||||
|
||||
public inline fun <T> ChatIdentifier.ifBusinessChatId(block: (BusinessChatId) -> T): T? =
|
||||
businessChatIdOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatIdentifier.usernameOrNull(): Username? = this as?
|
||||
dev.inmo.tgbotapi.types.Username
|
||||
|
||||
@@ -2047,6 +2060,15 @@ public inline fun Chat.privateChatOrThrow(): PrivateChat = this as
|
||||
public inline fun <T> Chat.ifPrivateChat(block: (PrivateChat) -> T): T? = privateChatOrNull()
|
||||
?.let(block)
|
||||
|
||||
public inline fun Chat.businessChatOrNull(): BusinessChat? = this as?
|
||||
dev.inmo.tgbotapi.types.chat.BusinessChat
|
||||
|
||||
public inline fun Chat.businessChatOrThrow(): BusinessChat = this as
|
||||
dev.inmo.tgbotapi.types.chat.BusinessChat
|
||||
|
||||
public inline fun <T> Chat.ifBusinessChat(block: (BusinessChat) -> T): T? = businessChatOrNull()
|
||||
?.let(block)
|
||||
|
||||
public inline fun Chat.publicChatOrNull(): PublicChat? = this as?
|
||||
dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
@@ -2217,6 +2239,15 @@ public inline fun Chat.extendedChatWithUsernameOrThrow(): ExtendedChatWithUserna
|
||||
public inline fun <T> Chat.ifExtendedChatWithUsername(block: (ExtendedChatWithUsername) -> T): T? =
|
||||
extendedChatWithUsernameOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.extendedBusinessChatOrNull(): ExtendedBusinessChat? = this as?
|
||||
dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat
|
||||
|
||||
public inline fun Chat.extendedBusinessChatOrThrow(): ExtendedBusinessChat = this as
|
||||
dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat
|
||||
|
||||
public inline fun <T> Chat.ifExtendedBusinessChat(block: (ExtendedBusinessChat) -> T): T? =
|
||||
extendedBusinessChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.userOrNull(): User? = this as? dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
public inline fun Chat.userOrThrow(): User = this as dev.inmo.tgbotapi.types.chat.User
|
||||
@@ -2291,6 +2322,15 @@ public inline fun Chat.previewPrivateChatOrThrow(): PreviewPrivateChat = this as
|
||||
public inline fun <T> Chat.ifPreviewPrivateChat(block: (PreviewPrivateChat) -> T): T? =
|
||||
previewPrivateChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.previewBusinessChatOrNull(): PreviewBusinessChat? = this as?
|
||||
dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
||||
|
||||
public inline fun Chat.previewBusinessChatOrThrow(): PreviewBusinessChat = this as
|
||||
dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
||||
|
||||
public inline fun <T> Chat.ifPreviewBusinessChat(block: (PreviewBusinessChat) -> T): T? =
|
||||
previewBusinessChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.previewPublicChatOrNull(): PreviewPublicChat? = this as?
|
||||
dev.inmo.tgbotapi.types.chat.PreviewPublicChat
|
||||
|
||||
|
||||
Reference in New Issue
Block a user