1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 07:09:23 +00:00

add support of general changes

This commit is contained in:
2025-07-07 21:48:23 +06:00
parent b8530f14ca
commit c990d987f5
13 changed files with 265 additions and 1 deletions

View File

@@ -294,6 +294,10 @@ public final class dev/inmo/tgbotapi/extensions/api/bot/GetMyShortDescriptionKt
public static synthetic fun getMyShortDescription$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun getMyShortDescription$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
} }
public final class dev/inmo/tgbotapi/extensions/api/bot/GetMyStarBalanceKt {
public static final fun getMyStarBalance (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
public final class dev/inmo/tgbotapi/extensions/api/bot/SetMyCommandsKt { public final class dev/inmo/tgbotapi/extensions/api/bot/SetMyCommandsKt {
public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ldev/inmo/micro_utils/language_codes/IetfLang;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun setMyCommands (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/util/List;Ldev/inmo/tgbotapi/types/commands/BotCommandScope;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.GetMe
import dev.inmo.tgbotapi.requests.bot.GetMyStarBalance
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
public suspend fun TelegramBot.getMyStarBalance(): StarAmount = execute(GetMyStarBalance)

View File

@@ -612,6 +612,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionKt {
public static final fun waitChannelChatCreatedEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChannelChatCreatedEvents (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 waitChannelChatCreatedEvents$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 static synthetic fun waitChannelChatCreatedEvents$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 static final fun waitChannelDirectMessagesConfigurationChanged (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 waitChannelDirectMessagesConfigurationChanged$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 static final fun waitChannelEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChannelEvents (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 waitChannelEvents$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 static synthetic fun waitChannelEvents$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 static final fun waitChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static final fun waitChatBackgroundSet (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
@@ -1322,6 +1324,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggersKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggersKt {
public static final fun onChannelChatCreated (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 final fun onChannelChatCreated (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 onChannelChatCreated$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 static synthetic fun onChannelChatCreated$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 static final fun onChannelDirectMessagesConfigurationChanged (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 onChannelDirectMessagesConfigurationChanged$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 static final fun onChannelEvent (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 final fun onChannelEvent (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 onChannelEvent$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 static synthetic fun onChannelEvent$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 static final fun onChatBackgroundSet (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 final fun onChatBackgroundSet (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;

View File

@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
@@ -276,3 +277,8 @@ fun BehaviourContext.waitChecklistTasksAdded(
initRequest: Request<*>? = null, initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null } errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChecklistTasksAdded>(initRequest, errorFactory) ) = waitEvents<ChecklistTasksAdded>(initRequest, errorFactory)
fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged(
initRequest: Request<*>? = null,
errorFactory: NullableRequestBuilder<*> = { null }
) = waitEvents<ChannelDirectMessagesConfigurationChanged>(initRequest, errorFactory)

View File

@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull
import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PaidMessagePriceChanged
import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatBackground
import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded
@@ -17,6 +18,7 @@ import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone
import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived
import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated
import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults
import dev.inmo.tgbotapi.types.message.ChannelEventMessage
import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.*
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed
@@ -1158,3 +1160,25 @@ fun <BC : BehaviourContext> BC.onChecklistTasksAdded(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksAdded>>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChatEventMessage<ChecklistTasksAdded>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksAdded>> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChatEventMessage<ChecklistTasksAdded>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
/**
* @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.onChannelDirectMessagesConfigurationChanged(
initialFilter: SimpleFilter<ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null,
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)

View File

@@ -1737,6 +1737,14 @@ public final class dev/inmo/tgbotapi/requests/bot/GetMyShortDescription$Companio
public final fun serializer ()Lkotlinx/serialization/KSerializer; public final fun serializer ()Lkotlinx/serialization/KSerializer;
} }
public final class dev/inmo/tgbotapi/requests/bot/GetMyStarBalance : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest {
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/bot/GetMyStarBalance;
public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy;
public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy;
public fun method ()Ljava/lang/String;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public abstract interface class dev/inmo/tgbotapi/requests/bot/MyCommandsRequest : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest, dev/inmo/tgbotapi/types/abstracts/WithOptionalLanguageCode { public abstract interface class dev/inmo/tgbotapi/requests/bot/MyCommandsRequest : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest, dev/inmo/tgbotapi/types/abstracts/WithOptionalLanguageCode {
public abstract fun getScope ()Ldev/inmo/tgbotapi/types/commands/BotCommandScope; public abstract fun getScope ()Ldev/inmo/tgbotapi/types/commands/BotCommandScope;
} }
@@ -9378,6 +9386,62 @@ public final class dev/inmo/tgbotapi/types/CallbackQueryId$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer; public final fun serializer ()Lkotlinx/serialization/KSerializer;
} }
public abstract interface class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent {
public static final field Companion Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Companion;
public abstract fun getCost ()Ljava/lang/Integer;
public abstract fun getEnabled ()Z
}
public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Companion : kotlinx/serialization/KSerializer {
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged;
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/ChannelDirectMessagesConfigurationChanged;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled;
public fun getCost ()Ljava/lang/Integer;
public fun getEnabled ()Z
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free;
public fun getCost ()Ljava/lang/Integer;
public fun getEnabled ()Z
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid : dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged {
public static final field Companion Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$Companion;
public fun <init> (I)V
public final fun component1 ()I
public final fun copy (I)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;
public fun equals (Ljava/lang/Object;)Z
public fun getCost ()Ljava/lang/Integer;
public fun getEnabled ()Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public synthetic class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;
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/ChannelDirectMessagesConfigurationChanged$Paid;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
}
public final class dev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/ChatId : dev/inmo/tgbotapi/types/IdChatIdentifier { public final class dev/inmo/tgbotapi/types/ChatId : dev/inmo/tgbotapi/types/IdChatIdentifier {
public static final field Companion Ldev/inmo/tgbotapi/types/ChatId$Companion; public static final field Companion Ldev/inmo/tgbotapi/types/ChatId$Companion;
public static final synthetic fun box-impl (J)Ldev/inmo/tgbotapi/types/ChatId; public static final synthetic fun box-impl (J)Ldev/inmo/tgbotapi/types/ChatId;

View File

@@ -0,0 +1,15 @@
package dev.inmo.tgbotapi.requests.bot
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.chat.ExtendedBot
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
import kotlinx.serialization.*
@Serializable
object GetMyStarBalance : SimpleRequest<StarAmount> {
override fun method(): String = "getMyStarBalance"
override val resultDeserializer: DeserializationStrategy<StarAmount>
get() = StarAmount.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -71,7 +71,7 @@ val invoicePayloadBytesLimit = 1 until 128
val pollOptionTextLength = 1 .. 100 val pollOptionTextLength = 1 .. 100
val pollQuestionTextLength = 1 .. 300 val pollQuestionTextLength = 1 .. 300
val pollOptionsLimit = 2 .. 10 val pollOptionsLimit = 2 .. 12
val livePeriodLimit = 60 .. LiveLocation.INDEFINITE_LIVE_PERIOD val livePeriodLimit = 60 .. LiveLocation.INDEFINITE_LIVE_PERIOD

View File

@@ -0,0 +1,71 @@
package dev.inmo.tgbotapi.types
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
@Serializable
sealed interface ChannelDirectMessagesConfigurationChanged : ChannelEvent {
val enabled: Boolean
val cost: Int?
@Serializable
object Disabled : ChannelDirectMessagesConfigurationChanged {
override val enabled: Boolean
get() = false
override val cost: Int?
get() = null
}
@Serializable
object Free : ChannelDirectMessagesConfigurationChanged {
override val enabled: Boolean
get() = true
override val cost: Int
get() = 0
}
@Serializable
data class Paid(
override val cost: Int
) : ChannelDirectMessagesConfigurationChanged {
override val enabled: Boolean
get() = true
}
companion object : KSerializer<ChannelDirectMessagesConfigurationChanged> {
@Serializable
private data class RawDirectMessagePriceChanged(
val are_direct_messages_enabled: Boolean = false,
val direct_message_star_count: Int? = null
)
override val descriptor: SerialDescriptor
get() = RawDirectMessagePriceChanged.serializer().descriptor
override fun serialize(
encoder: Encoder,
value: ChannelDirectMessagesConfigurationChanged
) {
RawDirectMessagePriceChanged.serializer().serialize(
encoder,
RawDirectMessagePriceChanged(
value.enabled,
value.cost
)
)
}
override fun deserialize(decoder: Decoder): ChannelDirectMessagesConfigurationChanged {
val raw = RawDirectMessagePriceChanged.serializer().deserialize(decoder)
return when {
raw.are_direct_messages_enabled == false -> Disabled
raw.direct_message_star_count == null || raw.direct_message_star_count == 0 -> Free
else -> Paid(
raw.direct_message_star_count
)
}
}
}
}

View File

@@ -171,6 +171,9 @@ internal data class RawMessage(
private val checklist_tasks_done: ChecklistTasksDone? = null, private val checklist_tasks_done: ChecklistTasksDone? = null,
private val checklist_tasks_added: ChecklistTasksAdded? = null, private val checklist_tasks_added: ChecklistTasksAdded? = null,
// Channel direct messages
private val direct_message_price_changed: ChannelDirectMessagesConfigurationChanged? = null,
// Gifts // Gifts
private val gift: GiftSentOrReceived.Regular? = null, private val gift: GiftSentOrReceived.Regular? = null,
private val unique_gift: GiftSentOrReceived.Unique? = null, private val unique_gift: GiftSentOrReceived.Unique? = null,
@@ -301,6 +304,7 @@ internal data class RawMessage(
unique_gift != null -> unique_gift unique_gift != null -> unique_gift
checklist_tasks_done != null -> checklist_tasks_done checklist_tasks_done != null -> checklist_tasks_done
checklist_tasks_added != null -> checklist_tasks_added checklist_tasks_added != null -> checklist_tasks_added
direct_message_price_changed != null -> direct_message_price_changed
else -> null else -> null
} }
} }

View File

@@ -1163,6 +1163,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun channelContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;
public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;
public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;
public static final fun channelDirectMessagesConfigurationChangedDisabledOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled;
public static final fun channelDirectMessagesConfigurationChangedDisabledOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Disabled;
public static final fun channelDirectMessagesConfigurationChangedFreeOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free;
public static final fun channelDirectMessagesConfigurationChangedFreeOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Free;
public static final fun channelDirectMessagesConfigurationChangedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged;
public static final fun channelDirectMessagesConfigurationChangedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged;
public static final fun channelDirectMessagesConfigurationChangedPaidOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;
public static final fun channelDirectMessagesConfigurationChangedPaidOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/ChannelDirectMessagesConfigurationChanged$Paid;
public static final fun channelEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; public static final fun channelEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage;
public static final fun channelEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; public static final fun channelEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage;
public static final fun channelEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent; public static final fun channelEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent;
@@ -1570,6 +1578,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifChannelChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelDirectMessagesConfigurationChanged (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelDirectMessagesConfigurationChangedDisabled (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelDirectMessagesConfigurationChangedFree (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelDirectMessagesConfigurationChangedPaid (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifChannelPostUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelPostUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;

View File

@@ -21,6 +21,7 @@ import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.BackgroundFill import dev.inmo.tgbotapi.types.BackgroundFill
import dev.inmo.tgbotapi.types.BackgroundType import dev.inmo.tgbotapi.types.BackgroundType
import dev.inmo.tgbotapi.types.BusinessChatId import dev.inmo.tgbotapi.types.BusinessChatId
import dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.ChatIdWithThreadId import dev.inmo.tgbotapi.types.ChatIdWithThreadId
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
@@ -3333,6 +3334,54 @@ public inline fun <T>
TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T): TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T):
T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block) T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block)
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedOrNull():
ChannelDirectMessagesConfigurationChanged? = this as?
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedOrThrow():
ChannelDirectMessagesConfigurationChanged = this as
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged
public inline fun <T>
ChatEvent.ifChannelDirectMessagesConfigurationChanged(block: (ChannelDirectMessagesConfigurationChanged) -> T):
T? = channelDirectMessagesConfigurationChangedOrNull() ?.let(block)
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedDisabledOrNull():
ChannelDirectMessagesConfigurationChanged.Disabled? = this as?
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Disabled
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedDisabledOrThrow():
ChannelDirectMessagesConfigurationChanged.Disabled = this as
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Disabled
public inline fun <T>
ChatEvent.ifChannelDirectMessagesConfigurationChangedDisabled(block: (ChannelDirectMessagesConfigurationChanged.Disabled) -> T):
T? = channelDirectMessagesConfigurationChangedDisabledOrNull() ?.let(block)
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedFreeOrNull():
ChannelDirectMessagesConfigurationChanged.Free? = this as?
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Free
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedFreeOrThrow():
ChannelDirectMessagesConfigurationChanged.Free = this as
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Free
public inline fun <T>
ChatEvent.ifChannelDirectMessagesConfigurationChangedFree(block: (ChannelDirectMessagesConfigurationChanged.Free) -> T):
T? = channelDirectMessagesConfigurationChangedFreeOrNull() ?.let(block)
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedPaidOrNull():
ChannelDirectMessagesConfigurationChanged.Paid? = this as?
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Paid
public inline fun ChatEvent.channelDirectMessagesConfigurationChangedPaidOrThrow():
ChannelDirectMessagesConfigurationChanged.Paid = this as
dev.inmo.tgbotapi.types.ChannelDirectMessagesConfigurationChanged.Paid
public inline fun <T>
ChatEvent.ifChannelDirectMessagesConfigurationChangedPaid(block: (ChannelDirectMessagesConfigurationChanged.Paid) -> T):
T? = channelDirectMessagesConfigurationChangedPaidOrNull() ?.let(block)
public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as? public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as?
dev.inmo.tgbotapi.types.PaidMessagePriceChanged dev.inmo.tgbotapi.types.PaidMessagePriceChanged

View File

@@ -144,6 +144,8 @@ external class WebApp {
fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally) fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally)
fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally) fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally)
fun hideKeyboard()
// Start of generated part // Start of generated part
@JsName("onEvent") @JsName("onEvent")