mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-04-07 02:22:27 +00:00
complete support of ManagedBotCreated and ManagedBotUpdated, add getManagedBotToken and replaceManagedBotToken
This commit is contained in:
@@ -1268,6 +1268,14 @@ public final class dev/inmo/tgbotapi/extensions/api/inline/SavePreparedInlineMes
|
||||
public static synthetic fun savePreparedInlineMessage$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;ZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/managed_bots/GetManagedBotTokenKt {
|
||||
public static final fun getManagedBotToken-dEpx-Zg (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/managed_bots/ReplaceManagedBotTokenKt {
|
||||
public static final fun replaceManagedBotToken-dEpx-Zg (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrorsKt {
|
||||
public static final fun setPassportDataErrors (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/passport/PassportData;Ldev/inmo/tgbotapi/utils/passport/Decryptor;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setPassportDataErrors (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.managed_bots
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.managed_bots.GetManagedBotToken
|
||||
import dev.inmo.tgbotapi.types.BotToken
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
|
||||
public suspend fun TelegramBot.getManagedBotToken(
|
||||
userId: ChatId
|
||||
): BotToken = execute(
|
||||
GetManagedBotToken(userId = userId)
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.managed_bots
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.managed_bots.ReplaceManagedBotToken
|
||||
import dev.inmo.tgbotapi.types.BotToken
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
|
||||
public suspend fun TelegramBot.replaceManagedBotToken(
|
||||
userId: ChatId
|
||||
): BotToken = execute(
|
||||
ReplaceManagedBotToken(userId = userId)
|
||||
)
|
||||
@@ -106,6 +106,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
||||
public fun getFlowsUpdatesFilter ()Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;
|
||||
public fun getInlineQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getLog ()Ldev/inmo/kslog/common/KSLog;
|
||||
public fun getManagedBotUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMyChatMemberUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
|
||||
@@ -852,6 +852,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitLocationInlineQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitManagedBotUpdateKt {
|
||||
public static final fun waitManagedBotUpdated (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitManagedBotUpdated$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupKt {
|
||||
public static final fun waitDocumentsGroup (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
public static synthetic fun waitDocumentsGroup$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -981,6 +986,7 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/filters/Messag
|
||||
public static final fun getChatJoinRequestFilterByChat ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getChatMemberUpdatedFilterByChat ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getInlineQueryFilterByUser ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getManagedBotUpdatedFilterByUser ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getMessageFilterByChat ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getMessagesFilterByChat ()Lkotlin/jvm/functions/Function4;
|
||||
public static final fun getPreCheckoutQueryFilterByUser ()Lkotlin/jvm/functions/Function4;
|
||||
@@ -1495,6 +1501,11 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onLocationInlineQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ManagedBotUpdateTriggersKt {
|
||||
public static final fun onManagedBotUpdate (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onManagedBotUpdate$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggersKt {
|
||||
public static final fun onDocumentsGroupMessages (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||
public static synthetic fun onDocumentsGroupMessages$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||
@@ -1837,6 +1848,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_f
|
||||
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserManagedBotUpdatedMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserManagedBotUpdatedMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public synthetic fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserMessageMarkerFactory : dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/ByUserMessageMarkerFactory;
|
||||
public fun invoke (Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.utils.managedBotUpdateOrNull
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
fun BehaviourContext.waitManagedBotUpdated(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
): Flow<ManagedBotUpdated> = expectFlow(
|
||||
initRequest,
|
||||
errorFactory
|
||||
) {
|
||||
(it.managedBotUpdateOrNull() ?.data).let(::listOfNotNull)
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceUser
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
@@ -60,6 +61,14 @@ val InlineQueryFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, Inline
|
||||
it.id == query.user.id
|
||||
} != false
|
||||
}
|
||||
/**
|
||||
* Allow only updates from the same user as base [ManagedBotUpdated.user]
|
||||
*/
|
||||
val ManagedBotUpdatedFilterByUser: BehaviourContextAndTwoTypesReceiver<Boolean, ManagedBotUpdated, Update> = { managedBotUpdated, update ->
|
||||
update.sourceUser() ?.let {
|
||||
it.id == managedBotUpdated.user.id
|
||||
} != false
|
||||
}
|
||||
/**
|
||||
* Allow only events from the same chat as base [ChatMemberUpdated]
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTwoTypesReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserManagedBotUpdatedMarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.utils.managedBotUpdateOrNull
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
/**
|
||||
* @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call
|
||||
* @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example,
|
||||
* this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage].
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own.
|
||||
* Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times]
|
||||
* to combinate several filters
|
||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||
* [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for
|
||||
* "stream"
|
||||
* @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that
|
||||
* data
|
||||
*/
|
||||
fun <BC : BehaviourContext> BC.onManagedBotUpdate(
|
||||
initialFilter: SimpleFilter<ManagedBotUpdated>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ManagedBotUpdated, Update>? = null,
|
||||
markerFactory: MarkerFactory<in ManagedBotUpdated, Any>? = ByUserManagedBotUpdatedMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ManagedBotUpdated>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ManagedBotUpdated>
|
||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, additionalSubcontextInitialAction, scenarioReceiver) {
|
||||
(it.managedBotUpdateOrNull() ?.data) ?.let(::listOfNotNull)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
|
||||
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
|
||||
object ByUserManagedBotUpdatedMarkerFactory : MarkerFactory<ManagedBotUpdated, Any> {
|
||||
override suspend fun invoke(data: ManagedBotUpdated) = data.user
|
||||
}
|
||||
@@ -5741,6 +5741,66 @@ public final class dev/inmo/tgbotapi/requests/local/LogOut : dev/inmo/tgbotapi/r
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken$Companion;
|
||||
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-tHkBKVM ()J
|
||||
public final fun copy-HZVsHAI (J)Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken;
|
||||
public static synthetic fun copy-HZVsHAI$default (Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken;JILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy;
|
||||
public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy;
|
||||
public final fun getUserId-tHkBKVM ()J
|
||||
public fun hashCode ()I
|
||||
public fun method ()Ljava/lang/String;
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final synthetic class dev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/managed_bots/GetManagedBotToken;)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/requests/managed_bots/GetManagedBotToken$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken$Companion;
|
||||
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-tHkBKVM ()J
|
||||
public final fun copy-HZVsHAI (J)Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken;
|
||||
public static synthetic fun copy-HZVsHAI$default (Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken;JILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy;
|
||||
public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy;
|
||||
public final fun getUserId-tHkBKVM ()J
|
||||
public fun hashCode ()I
|
||||
public fun method ()Ljava/lang/String;
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final synthetic class dev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/managed_bots/ReplaceManagedBotToken;)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/requests/managed_bots/ReplaceManagedBotToken$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/requests/send/CopyMessage : dev/inmo/tgbotapi/abstracts/TextedOutput, dev/inmo/tgbotapi/abstracts/WithCustomStartMediaData, dev/inmo/tgbotapi/abstracts/types/MessageAction, dev/inmo/tgbotapi/abstracts/types/OptionallyWithEffectId, dev/inmo/tgbotapi/abstracts/types/ProtectContent, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest, dev/inmo/tgbotapi/requests/send/abstracts/OptionallyMessageThreadRequest, dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/WithCustomizableCaptionRequest {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/requests/send/CopyMessage$Companion;
|
||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/Integer;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
@@ -9954,6 +10014,36 @@ public final class dev/inmo/tgbotapi/types/BotShortDescription$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/BotToken {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/BotToken$Companion;
|
||||
public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/BotToken;
|
||||
public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z
|
||||
public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z
|
||||
public final fun getString ()Ljava/lang/String;
|
||||
public fun hashCode ()I
|
||||
public static fun hashCode-impl (Ljava/lang/String;)I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public final synthetic fun unbox-impl ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final synthetic class dev/inmo/tgbotapi/types/BotToken$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/types/BotToken$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun deserialize-Xc4KczI (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
|
||||
public final fun serialize-Y8d-Zco (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V
|
||||
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/BotToken$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;
|
||||
@@ -14557,6 +14647,7 @@ public final class dev/inmo/tgbotapi/types/UpdateTypesKt {
|
||||
public static final field UPDATE_EDITED_CHANNEL_POST Ljava/lang/String;
|
||||
public static final field UPDATE_EDITED_MESSAGE Ljava/lang/String;
|
||||
public static final field UPDATE_INLINE_QUERY Ljava/lang/String;
|
||||
public static final field UPDATE_MANAGED_BOT Ljava/lang/String;
|
||||
public static final field UPDATE_MESSAGE Ljava/lang/String;
|
||||
public static final field UPDATE_MESSAGE_REACTION Ljava/lang/String;
|
||||
public static final field UPDATE_MESSAGE_REACTION_COUNT Ljava/lang/String;
|
||||
@@ -33604,6 +33695,36 @@ public final class dev/inmo/tgbotapi/types/update/InlineQueryUpdate : dev/inmo/t
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/update/ManagedBotUpdate : dev/inmo/tgbotapi/types/update/abstracts/Update {
|
||||
public static final field Companion Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate$Companion;
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-4k5XoGU ()J
|
||||
public final fun component2 ()Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;
|
||||
public final fun copy-VElHuNg (JLdev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public static synthetic fun copy-VElHuNg$default (Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;JLdev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun getData ()Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;
|
||||
public synthetic fun getData ()Ljava/lang/Object;
|
||||
public fun getUpdateId-4k5XoGU ()J
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final synthetic class dev/inmo/tgbotapi/types/update/ManagedBotUpdate$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
|
||||
public static final field INSTANCE Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate$$serializer;
|
||||
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
|
||||
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
|
||||
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;)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/update/ManagedBotUpdate$Companion {
|
||||
public final fun serializer ()Lkotlinx/serialization/KSerializer;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/types/update/MessageUpdate : dev/inmo/tgbotapi/types/update/abstracts/BaseSentMessageUpdate {
|
||||
public synthetic fun <init> (JLdev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1-4k5XoGU ()J
|
||||
@@ -33891,6 +34012,7 @@ public abstract class dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilt
|
||||
public fun getEditedMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getEditedMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getInlineQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getManagedBotUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMyChatMemberUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -33932,6 +34054,7 @@ public abstract interface class dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFi
|
||||
public fun getEditedMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun getEditedMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun getInlineQueriesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun getManagedBotUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public fun getMessageMediaGroupsFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun getMessagesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun getMyChatMemberUpdatesFlow ()Lkotlinx/coroutines/flow/Flow;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.tgbotapi.requests.managed_bots
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.BotToken
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.userIdField
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
data class GetManagedBotToken(
|
||||
@SerialName(userIdField)
|
||||
val userId: ChatId
|
||||
) : SimpleRequest<BotToken> {
|
||||
override fun method(): String = "getManagedBotToken"
|
||||
override val resultDeserializer: DeserializationStrategy<BotToken>
|
||||
get() = BotToken.serializer()
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.tgbotapi.requests.managed_bots
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.BotToken
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.userIdField
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
data class ReplaceManagedBotToken(
|
||||
@SerialName(userIdField)
|
||||
val userId: ChatId
|
||||
) : SimpleRequest<BotToken> {
|
||||
override fun method(): String = "replaceManagedBotToken"
|
||||
override val resultDeserializer: DeserializationStrategy<BotToken>
|
||||
get() = BotToken.serializer()
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class BotToken(val string: String)
|
||||
@@ -24,6 +24,8 @@ const val UPDATE_BUSINESS_MESSAGE = "business_message"
|
||||
const val UPDATE_EDITED_BUSINESS_MESSAGE = "edited_business_message"
|
||||
const val UPDATE_DELETED_BUSINESS_MESSAGES = "deleted_business_messages"
|
||||
|
||||
const val UPDATE_MANAGED_BOT = "managed_bot"
|
||||
|
||||
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_MESSAGE,
|
||||
UPDATE_EDITED_MESSAGE,
|
||||
@@ -57,6 +59,8 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_CHAT_BOOST,
|
||||
|
||||
UPDATE_REMOVE_CHAT_BOOST,
|
||||
|
||||
UPDATE_MANAGED_BOT,
|
||||
)
|
||||
|
||||
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(
|
||||
|
||||
@@ -18,6 +18,7 @@ import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent
|
||||
import dev.inmo.tgbotapi.types.giveaway.*
|
||||
import dev.inmo.tgbotapi.types.message.content.GiveawayContent
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotCreated
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.*
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||
@@ -206,7 +207,7 @@ internal data class RawMessage(
|
||||
private val gift_upgrade_sent: GiftSentOrReceivedEvent.RegularGift? = null,
|
||||
private val chat_owner_left: ChatOwnerLeft? = null,
|
||||
private val chat_owner_changed: ChatOwnerChanged? = null,
|
||||
private val managed_bot_updated: ManagedBotUpdated? = null
|
||||
private val managed_bot_created: ManagedBotCreated? = null
|
||||
) {
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
private val checkedFrom = from ?.takeIf { !it.isFakeTelegramUser() }
|
||||
@@ -345,7 +346,7 @@ internal data class RawMessage(
|
||||
suggested_post_declined != null -> suggested_post_declined
|
||||
suggested_post_paid != null -> suggested_post_paid
|
||||
suggested_post_refunded != null -> suggested_post_refunded
|
||||
managed_bot_updated != null -> managed_bot_updated
|
||||
managed_bot_created != null -> managed_bot_created
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.types.update
|
||||
|
||||
import dev.inmo.tgbotapi.types.UpdateId
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ManagedBotUpdate(
|
||||
override val updateId: UpdateId,
|
||||
override val data: ManagedBotUpdated
|
||||
) : Update {
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.ChatMessageReactionsCountUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.managed_bots.ManagedBotUpdated
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
@@ -64,6 +65,7 @@ internal data class RawUpdate constructor(
|
||||
private val edited_business_message: BusinessContentMessage<*>? = null,
|
||||
private val deleted_business_messages: BusinessMessagesDeleted? = null,
|
||||
private val purchased_paid_media: PaidMediaPurchased? = null,
|
||||
private val managed_bot: ManagedBotUpdated? = null,
|
||||
) {
|
||||
@Transient
|
||||
private var initedUpdate: Update? = null
|
||||
@@ -100,6 +102,7 @@ internal data class RawUpdate constructor(
|
||||
edited_business_message != null -> EditBusinessMessageUpdate(updateId, edited_business_message)
|
||||
deleted_business_messages != null -> DeletedBusinessMessageUpdate(updateId, deleted_business_messages)
|
||||
purchased_paid_media != null -> PaidMediaPurchasedUpdate(updateId, purchased_paid_media)
|
||||
managed_bot != null -> ManagedBotUpdate(updateId, managed_bot)
|
||||
else -> UnknownUpdate(
|
||||
updateId,
|
||||
raw
|
||||
|
||||
@@ -45,6 +45,7 @@ interface FlowsUpdatesFilter : UpdatesFilter {
|
||||
val editBusinessMessageUpdatesFlow: Flow<EditBusinessMessageUpdate>
|
||||
val deleteBusinessMessageUpdatesFlow: Flow<DeletedBusinessMessageUpdate>
|
||||
val paidMediaPurchasedUpdatesFlow: Flow<PaidMediaPurchasedUpdate>
|
||||
val managedBotUpdatesFlow: Flow<ManagedBotUpdate>
|
||||
val unknownUpdatesFlow: Flow<UnknownUpdate>
|
||||
}
|
||||
|
||||
@@ -73,6 +74,7 @@ abstract class AbstractFlowsUpdatesFilter : FlowsUpdatesFilter {
|
||||
override val editBusinessMessageUpdatesFlow: Flow<EditBusinessMessageUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val deleteBusinessMessageUpdatesFlow: Flow<DeletedBusinessMessageUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val paidMediaPurchasedUpdatesFlow: Flow<PaidMediaPurchasedUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
override val managedBotUpdatesFlow: Flow<ManagedBotUpdate> by lazy { allUpdatesFlow.filterIsInstance() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -177,6 +177,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
|
||||
public static final fun asLocationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LocationContent;
|
||||
public static final fun asLocationInlineQuery (Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery;
|
||||
public static final fun asLoginURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton;
|
||||
public static final fun asManagedBotUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public static final fun asMediaCollectionContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaCollectionContent;
|
||||
public static final fun asMediaContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaContent;
|
||||
public static final fun asMediaGroupContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaGroupPartContent;
|
||||
@@ -523,6 +524,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
|
||||
public static final fun requireLocationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LocationContent;
|
||||
public static final fun requireLocationInlineQuery (Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery;
|
||||
public static final fun requireLoginURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton;
|
||||
public static final fun requireManagedBotUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public static final fun requireMediaCollectionContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaCollectionContent;
|
||||
public static final fun requireMediaContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaContent;
|
||||
public static final fun requireMediaGroupContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaGroupPartContent;
|
||||
@@ -869,6 +871,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsKt {
|
||||
public static final fun whenLocationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenLocationInlineQuery (Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenLoginURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenManagedBotUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenMediaCollectionContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenMediaContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun whenMediaGroupContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1894,6 +1897,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifLocationInlineQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifLoginURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifManagedBotCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifManagedBotUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifManagedBotUpdated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifMask (Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifMaskAnimatedSticker (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -2308,6 +2312,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun loginURLInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton;
|
||||
public static final fun managedBotCreatedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotCreated;
|
||||
public static final fun managedBotCreatedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotCreated;
|
||||
public static final fun managedBotUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public static final fun managedBotUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ManagedBotUpdate;
|
||||
public static final fun managedBotUpdatedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;
|
||||
public static final fun managedBotUpdatedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/managed_bots/ManagedBotUpdated;
|
||||
public static final fun maskAnimatedStickerOrNull (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/MaskAnimatedSticker;
|
||||
|
||||
@@ -2193,6 +2193,15 @@ inline fun Update.asInlineQueryUpdate(): InlineQueryUpdate? = this as? InlineQue
|
||||
@PreviewFeature
|
||||
inline fun Update.requireInlineQueryUpdate(): InlineQueryUpdate = this as InlineQueryUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> Update.whenManagedBotUpdate(block: (ManagedBotUpdate) -> T) = asManagedBotUpdate()?.let(block)
|
||||
|
||||
@PreviewFeature
|
||||
inline fun Update.asManagedBotUpdate(): ManagedBotUpdate? = this as? ManagedBotUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun Update.requireManagedBotUpdate(): ManagedBotUpdate = this as ManagedBotUpdate
|
||||
|
||||
@PreviewFeature
|
||||
inline fun <T> Update.whenMessageUpdate(block: (MessageUpdate) -> T) = asMessageUpdate()?.let(block)
|
||||
|
||||
|
||||
@@ -531,6 +531,7 @@ import dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.EditChannelPostUpdate
|
||||
import dev.inmo.tgbotapi.types.update.EditMessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.InlineQueryUpdate
|
||||
import dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MessageUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate
|
||||
@@ -4092,6 +4093,12 @@ public inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUp
|
||||
|
||||
public inline fun <T> Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T): T? = chosenInlineResultUpdateOrNull() ?.let(block)
|
||||
|
||||
public inline fun Update.managedBotUpdateOrNull(): ManagedBotUpdate? = this as? dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
|
||||
public inline fun Update.managedBotUpdateOrThrow(): ManagedBotUpdate = this as dev.inmo.tgbotapi.types.update.ManagedBotUpdate
|
||||
|
||||
public inline fun <T> Update.ifManagedBotUpdate(block: (ManagedBotUpdate) -> T): T? = managedBotUpdateOrNull() ?.let(block)
|
||||
|
||||
public inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? dev.inmo.tgbotapi.types.update.ShippingQueryUpdate
|
||||
|
||||
public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as dev.inmo.tgbotapi.types.update.ShippingQueryUpdate
|
||||
|
||||
Reference in New Issue
Block a user