mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 23:29:33 +00:00
add a lot of things from update
This commit is contained in:
@@ -692,6 +692,18 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
||||
public static synthetic fun waitRegularGiftSentOrReceived$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 waitSuccessfulPaymentEvents (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 waitSuccessfulPaymentEvents$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 waitSuggestedPostApprovalFailed (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 waitSuggestedPostApprovalFailed$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 waitSuggestedPostApproved (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 waitSuggestedPostApproved$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 waitSuggestedPostDeclined (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 waitSuggestedPostDeclined$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 waitSuggestedPostInfo (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 waitSuggestedPostInfo$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 waitSuggestedPostPaid (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 waitSuggestedPostPaid$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 waitSuggestedPostRefunded (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 waitSuggestedPostRefunded$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 waitSupergroupChatCreatedEvents (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 waitSupergroupChatCreatedEvents$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 waitSupergroupEvents (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||
@@ -1408,6 +1420,18 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
||||
public static synthetic fun onRegularGiftSentOrReceived$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 onSuccessfulPayment (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 onSuccessfulPayment$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 onSuggestedPostApprovalFailed (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 onSuggestedPostApprovalFailed$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 onSuggestedPostApproved (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 onSuggestedPostApproved$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 onSuggestedPostDeclined (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 onSuggestedPostDeclined$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 onSuggestedPostInfo (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 onSuggestedPostInfo$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 onSuggestedPostPaid (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 onSuggestedPostPaid$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 onSuggestedPostRefunded (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 onSuggestedPostRefunded$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 onSupergroupChatCreated (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 onSupergroupChatCreated$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 onSupergroupEvent (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;
|
||||
|
@@ -22,6 +22,12 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||
@@ -282,3 +288,33 @@ fun BehaviourContext.waitChannelDirectMessagesConfigurationChanged(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<ChannelDirectMessagesConfigurationChanged>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostApprovalFailed(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostApprovalFailed>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostRefunded(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostRefunded>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostDeclined(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostDeclined>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostPaid(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostPaid>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostApproved(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostApproved>(initRequest, errorFactory)
|
||||
|
||||
fun BehaviourContext.waitSuggestedPostInfo(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitEvents<SuggestedPostInfo>(initRequest, errorFactory)
|
||||
|
@@ -28,12 +28,20 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||
import dev.inmo.tgbotapi.types.message.PrivateEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent
|
||||
import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent
|
||||
import dev.inmo.tgbotapi.types.payments.SuggestedPostPrice
|
||||
import dev.inmo.tgbotapi.types.request.ChatShared
|
||||
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||
import dev.inmo.tgbotapi.types.request.UsersShared
|
||||
@@ -1182,3 +1190,135 @@ fun <BC : BehaviourContext> BC.onChannelDirectMessagesConfigurationChanged(
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelEventMessage<ChannelDirectMessagesConfigurationChanged>>
|
||||
) = 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.onSuggestedPostInfo(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostInfo>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostInfo>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostInfo>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostInfo>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostInfo>>
|
||||
) = 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.onSuggestedPostApproved(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApproved>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApproved>>
|
||||
) = 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.onSuggestedPostApprovalFailed(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostApprovalFailed>>
|
||||
) = 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.onSuggestedPostDeclined(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostDeclined>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostDeclined>>
|
||||
) = 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.onSuggestedPostPaid(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostPaid>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostPaid>>
|
||||
) = 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.onSuggestedPostRefunded(
|
||||
initialFilter: SimpleFilter<ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
|
||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Update>? = MessageFilterByChat,
|
||||
markerFactory: MarkerFactory<in ChannelDirectMessagesEventMessage<SuggestedPostRefunded>, Any>? = ByChatMessageMarkerFactory,
|
||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>? = null,
|
||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, ChannelDirectMessagesEventMessage<SuggestedPostRefunded>>
|
||||
) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -291,6 +291,7 @@ const val canSendPaidMediaField = "can_send_paid_media"
|
||||
const val activeUsernamesField = "active_usernames"
|
||||
const val customTitleField = "custom_title"
|
||||
const val optionIdsField = "option_ids"
|
||||
const val parentChatField = "parent_chat"
|
||||
const val voterChatField = "voter_chat"
|
||||
const val ipAddressField = "ip_address"
|
||||
const val linkedChatIdField = "linked_chat_id"
|
||||
@@ -535,6 +536,7 @@ const val convertStarCountField = "convert_star_count"
|
||||
const val prepaidUpgradeStarCountField = "prepaid_upgrade_star_count"
|
||||
const val canBeUpgradedField = "can_be_upgraded"
|
||||
const val isPrivateField = "is_private"
|
||||
const val isDirectMessagesField = "is_direct_messages"
|
||||
const val nextTransferDateField = "next_transfer_date"
|
||||
const val transferStarCountField = "transfer_star_count"
|
||||
const val lastResaleStarCountField = "last_resale_star_count"
|
||||
|
@@ -53,6 +53,13 @@ sealed interface SupergroupChat : GroupChat, SuperPublicChat
|
||||
@Serializable(ChatSerializer::class)
|
||||
sealed interface ForumChat : SupergroupChat
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatSerializer::class)
|
||||
sealed interface ChannelDirectMessagesChat : ForumChat {
|
||||
override val isDirectMessages: Boolean
|
||||
get() = true
|
||||
}
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ChatSerializer::class)
|
||||
sealed interface PossiblyPremiumChat : Chat {
|
||||
@@ -69,4 +76,6 @@ sealed interface AbleToAddInAttachmentMenuChat : Chat {
|
||||
@ClassCastsIncluded(excludeRegex = ".*Impl")
|
||||
sealed interface Chat {
|
||||
val id: IdChatIdentifier
|
||||
val isDirectMessages: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
@@ -123,16 +123,20 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
|
||||
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
|
||||
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val isChannelDirectMessages = decodedJson[isDirectMessagesField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val original = decodedJson[originField]
|
||||
|
||||
return when (type) {
|
||||
ChatType.Sender -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
|
||||
ChatType.Private -> formatter.decodeFromJsonElement(PrivateChatImpl.serializer(), decodedJson)
|
||||
ChatType.Group -> formatter.decodeFromJsonElement(GroupChatImpl.serializer(), decodedJson)
|
||||
ChatType.Supergroup -> if (isForum) {
|
||||
formatter.decodeFromJsonElement(ForumChatImpl.serializer(), decodedJson)
|
||||
} else {
|
||||
formatter.decodeFromJsonElement(SupergroupChatImpl.serializer(), decodedJson)
|
||||
ChatType.Supergroup -> {
|
||||
@Suppress("SimplifyBooleanWithConstants")
|
||||
when {
|
||||
isForum == false -> formatter.decodeFromJsonElement(SupergroupChatImpl.serializer(), decodedJson)
|
||||
isChannelDirectMessages -> formatter.decodeFromJsonElement(ChannelDirectMessagesChatImpl.serializer(), decodedJson)
|
||||
else -> formatter.decodeFromJsonElement(ForumChatImpl.serializer(), decodedJson)
|
||||
}
|
||||
}
|
||||
ChatType.Channel -> formatter.decodeFromJsonElement(ChannelChatImpl.serializer(), decodedJson)
|
||||
is ChatType.Unknown -> UnknownChatType(
|
||||
@@ -156,6 +160,7 @@ object PreviewChatSerializer : KSerializer<PreviewChat> {
|
||||
is GroupChatImpl -> GroupChatImpl.serializer().serialize(encoder, value)
|
||||
is SupergroupChatImpl -> SupergroupChatImpl.serializer().serialize(encoder, value)
|
||||
is ForumChatImpl -> ForumChatImpl.serializer().serialize(encoder, value)
|
||||
is ChannelDirectMessagesChatImpl -> ChannelDirectMessagesChatImpl.serializer().serialize(encoder, value)
|
||||
is ChannelChatImpl -> ChannelChatImpl.serializer().serialize(encoder, value)
|
||||
is CommonBot -> CommonBot.serializer().serialize(encoder, value)
|
||||
is CommonUser -> CommonUser.serializer().serialize(encoder, value)
|
||||
@@ -174,16 +179,20 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
|
||||
|
||||
val type = decodedJson[typeField] ?.jsonPrimitive ?.content ?.asChatType
|
||||
val isForum = decodedJson[isForumField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val isChannelDirectMessages = decodedJson[isDirectMessagesField] ?.jsonPrimitive ?.booleanOrNull == true
|
||||
val original = decodedJson[originField]
|
||||
|
||||
return when (type) {
|
||||
ChatType.Sender -> formatter.decodeFromJsonElement(ExtendedPrivateChatImpl.serializer(), decodedJson)
|
||||
ChatType.Private -> formatter.decodeFromJsonElement(ExtendedPrivateChatImpl.serializer(), decodedJson)
|
||||
ChatType.Group -> formatter.decodeFromJsonElement(ExtendedGroupChatImpl.serializer(), decodedJson)
|
||||
ChatType.Supergroup -> if (isForum) {
|
||||
formatter.decodeFromJsonElement(ExtendedForumChatImpl.serializer(), decodedJson)
|
||||
} else {
|
||||
formatter.decodeFromJsonElement(ExtendedSupergroupChatImpl.serializer(), decodedJson)
|
||||
ChatType.Supergroup -> {
|
||||
@Suppress("SimplifyBooleanWithConstants")
|
||||
when {
|
||||
isForum == false -> formatter.decodeFromJsonElement(ExtendedSupergroupChatImpl.serializer(), decodedJson)
|
||||
isChannelDirectMessages -> formatter.decodeFromJsonElement(ExtendedChannelDirectMessagesChatImpl.serializer(), decodedJson)
|
||||
else -> formatter.decodeFromJsonElement(ExtendedForumChatImpl.serializer(), decodedJson)
|
||||
}
|
||||
}
|
||||
ChatType.Channel -> formatter.decodeFromJsonElement(ExtendedChannelChatImpl.serializer(), decodedJson)
|
||||
is ChatType.Unknown -> UnknownExtendedChat(
|
||||
@@ -207,6 +216,7 @@ sealed class ExtendedChatSerializer : KSerializer<ExtendedChat> {
|
||||
is ExtendedGroupChatImpl -> ExtendedGroupChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedSupergroupChatImpl -> ExtendedSupergroupChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedForumChatImpl -> ExtendedForumChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedChannelDirectMessagesChatImpl -> ExtendedChannelDirectMessagesChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedChannelChatImpl -> ExtendedChannelChatImpl.serializer().serialize(encoder, value)
|
||||
is ExtendedBot -> ExtendedBot.serializer().serialize(encoder, value)
|
||||
is UnknownExtendedChat -> JsonObject.serializer().serialize(encoder, value.rawJson)
|
||||
|
@@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import dev.inmo.tgbotapi.types.reactions.Reaction
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlinx.serialization.EncodeDefault
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
@@ -305,6 +306,83 @@ data class ExtendedForumChatImpl(
|
||||
override val acceptedGiftTypes: AcceptedGiftTypes = AcceptedGiftTypes(),
|
||||
) : ExtendedForumChat
|
||||
|
||||
@Serializable
|
||||
@RiskFeature("This class is a subject of changes. It is better to use ExtendedForumChat due")
|
||||
data class ExtendedChannelDirectMessagesChatImpl(
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(idField)
|
||||
override val id: IdChatIdentifier,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(parentChatField)
|
||||
override val channelChat: PreviewChannelChat,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(usernameField)
|
||||
override val username: Username? = null,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(activeUsernamesField)
|
||||
override val activeUsernames: List<Username> = emptyList(),
|
||||
@SerialName(photoField)
|
||||
override val chatPhoto: ChatPhoto? = null,
|
||||
@SerialName(permissionsField)
|
||||
override val permissions: ChatPermissions,
|
||||
@SerialName(descriptionField)
|
||||
override val description: String = "",
|
||||
@SerialName(inviteLinkField)
|
||||
override val inviteLink: String? = null,
|
||||
@SerialName(pinnedMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
override val pinnedMessage: Message? = null,
|
||||
@SerialName(stickerSetNameFullField)
|
||||
override val stickerSetName: StickerSetName? = null,
|
||||
@SerialName(slowModeDelayField)
|
||||
override val slowModeDelay: Long? = null,
|
||||
@SerialName(canSetStickerSetField)
|
||||
override val canSetStickerSet: Boolean = false,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(linkedChatIdField)
|
||||
override val linkedChannelChatId: IdChatIdentifier? = null,
|
||||
@SerialName(locationField)
|
||||
override val location: ChatLocation? = null,
|
||||
@SerialName(joinToSendMessagesField)
|
||||
override val requiresJoinForMessaging: Boolean = false,
|
||||
@SerialName(joinByRequestField)
|
||||
override val requireAdminApproveToJoin: Boolean = false,
|
||||
@SerialName(hasAggressiveAntiSpamEnabledField)
|
||||
override val isAggressiveAntiSpamEnabled: Boolean = false,
|
||||
@SerialName(hasHiddenMembersField)
|
||||
override val membersHidden: Boolean = false,
|
||||
@SerialName(availableReactionsField)
|
||||
override val availableReactions: List<Reaction>? = null,
|
||||
@SerialName(emojiStatusCustomEmojiIdField)
|
||||
override val statusEmojiId: CustomEmojiId? = null,
|
||||
@SerialName(emojiStatusExpirationDateField)
|
||||
override val statusEmojiExpiration: TelegramDate? = null,
|
||||
@SerialName(accentColorIdField)
|
||||
override val accentColorId: ColorId = ColorId(0),
|
||||
@SerialName(profileAccentColorIdField)
|
||||
override val profileAccentColorId: ColorId? = null,
|
||||
@SerialName(backgroundCustomEmojiIdField)
|
||||
override val backgroundCustomEmojiId: CustomEmojiId? = null,
|
||||
@SerialName(profileBackgroundCustomEmojiIdField)
|
||||
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
|
||||
@SerialName(hasVisibleHistoryField)
|
||||
override val newMembersSeeHistory: Boolean = false,
|
||||
@SerialName(unrestrictBoostsCountField)
|
||||
override val unrestrictBoostsCount: Int? = null,
|
||||
@SerialName(customEmojiStickerSetNameField)
|
||||
override val customEmojiStickerSetName: StickerSetName? = null,
|
||||
@SerialName(maxReactionCountField)
|
||||
override val maxReactionsCount: Int = 3,
|
||||
@SerialName(acceptedGiftTypesField)
|
||||
override val acceptedGiftTypes: AcceptedGiftTypes = AcceptedGiftTypes(),
|
||||
) : ExtendedChannelDirectMessagesChat {
|
||||
@SerialName(isDirectMessagesField)
|
||||
@EncodeDefault
|
||||
override val isDirectMessages: Boolean = true
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ExtendedBot(
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
|
@@ -114,6 +114,12 @@ sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, Ext
|
||||
@Serializable(ExtendedChatSerializer.Companion::class)
|
||||
sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface ExtendedChannelDirectMessagesChat : ExtendedForumChat, ChannelDirectMessagesChat {
|
||||
val channelChat: PreviewChannelChat
|
||||
}
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(ExtendedChatSerializer.Companion::class)
|
||||
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
|
||||
|
@@ -5,6 +5,7 @@ import dev.inmo.micro_utils.language_codes.IetfLangSerializer
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlinx.serialization.EncodeDefault
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -70,6 +71,23 @@ data class ForumChatImpl(
|
||||
override val username: Username? = null
|
||||
) : PreviewForumChat
|
||||
|
||||
@Serializable
|
||||
@RiskFeature("This class is a subject of changes. It is better to use ForumChat due")
|
||||
data class ChannelDirectMessagesChatImpl(
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(idField)
|
||||
override val id: IdChatIdentifier,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@SerialName(usernameField)
|
||||
override val username: Username? = null
|
||||
) : PreviewChannelDirectMessagesChat {
|
||||
@SerialName(isDirectMessagesField)
|
||||
@EncodeDefault
|
||||
override val isDirectMessages: Boolean = true
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@RiskFeature("This class is a subject of changes. It is better to use ChannelChat due")
|
||||
data class ChannelChatImpl(
|
||||
|
@@ -40,3 +40,7 @@ sealed interface PreviewSupergroupChat : PreviewGroupChat, PreviewSuperPublicCha
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PreviewForumChat : PreviewSupergroupChat, ForumChat
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PreviewChannelDirectMessagesChat : PreviewForumChat, ChannelDirectMessagesChat
|
||||
|
@@ -1,3 +1,3 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.abstracts
|
||||
|
||||
interface ChannelDirectMessagesEvent : SupergroupEvent
|
||||
interface ChannelDirectMessagesEvent : ForumEvent
|
||||
|
@@ -1,8 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import dev.inmo.tgbotapi.types.payments.SuggestedPostPrice
|
||||
import dev.inmo.tgbotapi.types.suggestedPostMessageField
|
||||
@@ -16,5 +15,5 @@ data class SuggestedPostApprovalFailed(
|
||||
val price: SuggestedPostPrice,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
val suggestedPostMessage: Message? = null,
|
||||
val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null,
|
||||
) : ChannelDirectMessagesEvent
|
@@ -1,9 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.TelegramDate
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import dev.inmo.tgbotapi.types.payments.SuggestedPostPrice
|
||||
import dev.inmo.tgbotapi.types.suggestedPostMessageField
|
||||
@@ -18,7 +17,7 @@ data class SuggestedPostApproved(
|
||||
val sendDate: TelegramDate,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
val suggestedPostMessage: Message? = null,
|
||||
val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null,
|
||||
@SerialName(priceField)
|
||||
val price: SuggestedPostPrice? = null,
|
||||
) : ChannelDirectMessagesEvent
|
@@ -1,10 +1,9 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.suggestedPostMessageField
|
||||
import dev.inmo.tgbotapi.types.commentField
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
@@ -13,7 +12,7 @@ import kotlinx.serialization.Serializable
|
||||
data class SuggestedPostDeclined(
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
val suggestedPostMessage: Message? = null,
|
||||
val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null,
|
||||
@SerialName(commentField)
|
||||
val comment: String? = null
|
||||
) : ChannelDirectMessagesEvent
|
@@ -1,12 +1,14 @@
|
||||
package dev.inmo.tgbotapi.types.message
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.payments.SuggestedPostPrice
|
||||
import dev.inmo.tgbotapi.types.stateField
|
||||
import dev.inmo.tgbotapi.types.priceField
|
||||
import dev.inmo.tgbotapi.types.sendDateField
|
||||
import dev.inmo.tgbotapi.types.stateField
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
@@ -21,7 +23,7 @@ data class SuggestedPostInfo(
|
||||
val price: SuggestedPostPrice? = null,
|
||||
@SerialName(sendDateField)
|
||||
val sendDate: Int? = null
|
||||
) {
|
||||
) : ChannelDirectMessagesEvent {
|
||||
@Serializable(State.Companion::class)
|
||||
sealed interface State {
|
||||
val name: String
|
||||
@@ -37,7 +39,7 @@ data class SuggestedPostInfo(
|
||||
|
||||
companion object : KSerializer<State> {
|
||||
override val descriptor: SerialDescriptor =
|
||||
PrimitiveSerialDescriptor("SuggestedPostInfo.State", kotlinx.serialization.descriptors.PrimitiveKind.STRING)
|
||||
PrimitiveSerialDescriptor("SuggestedPostInfo.State", PrimitiveKind.STRING)
|
||||
|
||||
override fun serialize(encoder: Encoder, value: State) {
|
||||
encoder.encodeString(value.name)
|
||||
@@ -53,4 +55,4 @@ data class SuggestedPostInfo(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,13 +1,11 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.payments.stars.StarAmount
|
||||
import dev.inmo.tgbotapi.types.suggestedPostMessageField
|
||||
import dev.inmo.tgbotapi.types.currencyField
|
||||
import dev.inmo.tgbotapi.types.amountField
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currencied
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
@@ -26,7 +24,7 @@ import kotlinx.serialization.encoding.Encoder
|
||||
sealed interface SuggestedPostPaid : Currencied, ChannelDirectMessagesEvent {
|
||||
val amount: Long?
|
||||
val starAmount: StarAmount?
|
||||
val suggestedPostMessage: Message?
|
||||
val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>?
|
||||
|
||||
@Serializable
|
||||
data class XTR(
|
||||
@@ -34,7 +32,7 @@ sealed interface SuggestedPostPaid : Currencied, ChannelDirectMessagesEvent {
|
||||
override val starAmount: StarAmount,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
override val suggestedPostMessage: Message? = null,
|
||||
override val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null,
|
||||
) : SuggestedPostPaid {
|
||||
override val amount: Long?
|
||||
get() = null
|
||||
@@ -47,7 +45,7 @@ sealed interface SuggestedPostPaid : Currencied, ChannelDirectMessagesEvent {
|
||||
override val amount: Long,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
override val suggestedPostMessage: Message? = null
|
||||
override val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null
|
||||
) : SuggestedPostPaid {
|
||||
override val starAmount: StarAmount?
|
||||
get() = null
|
||||
@@ -60,7 +58,7 @@ sealed interface SuggestedPostPaid : Currencied, ChannelDirectMessagesEvent {
|
||||
override val currency: Currency,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
override val suggestedPostMessage: Message? = null,
|
||||
override val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null,
|
||||
@SerialName(amountField)
|
||||
override val amount: Long? = null,
|
||||
@SerialName(starAmountField)
|
@@ -1,8 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents.suggested
|
||||
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import dev.inmo.tgbotapi.types.suggestedPostMessageField
|
||||
import dev.inmo.tgbotapi.types.reasonField
|
||||
@@ -15,5 +14,5 @@ data class SuggestedPostRefunded(
|
||||
val reason: String,
|
||||
@SerialName(suggestedPostMessageField)
|
||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||
val suggestedPostMessage: Message? = null
|
||||
val suggestedPostMessage: ChannelDirectMessagesContentMessage<*>? = null
|
||||
) : ChannelDirectMessagesEvent
|
@@ -0,0 +1,20 @@
|
||||
package dev.inmo.tgbotapi.types.message
|
||||
|
||||
import korlibs.time.DateTime
|
||||
import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage
|
||||
|
||||
data class CommonChannelDirectMessagesEventMessage<T : ChannelDirectMessagesEvent>(
|
||||
override val messageId: MessageId,
|
||||
override val from: User,
|
||||
override val chat: PreviewChannelDirectMessagesChat,
|
||||
override val chatEvent: T,
|
||||
override val date: DateTime
|
||||
) : ChannelDirectMessagesEventMessage<T>
|
@@ -276,6 +276,62 @@ data class FromChannelForumContentMessageImpl<T: MessageContent>(
|
||||
)
|
||||
}
|
||||
|
||||
data class FromChannelChannelDirectMessagesContentMessageImpl<T: MessageContent>(
|
||||
override val chat: PreviewChannelDirectMessagesChat,
|
||||
override val channel: PreviewChannelChat,
|
||||
override val messageId: MessageId,
|
||||
override val threadId: MessageThreadId,
|
||||
override val date: DateTime,
|
||||
override val forwardOrigin: MessageOrigin?,
|
||||
override val editDate: DateTime?,
|
||||
override val hasProtectedContent: Boolean,
|
||||
override val replyInfo: ReplyInfo?,
|
||||
override val replyMarkup: InlineKeyboardMarkup?,
|
||||
override val content: T,
|
||||
override val senderBot: CommonBot?,
|
||||
override val authorSignature: AuthorSignature?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val fromOffline: Boolean,
|
||||
@SerialName(paidMessageStarCountField)
|
||||
override val cost: Int? = null,
|
||||
) : FromChannelChannelDirectMessagesContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewChannelDirectMessagesChat,
|
||||
channel: PreviewChannelChat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId,
|
||||
date: DateTime,
|
||||
forwardInfo: ForwardInfo,
|
||||
editDate: DateTime?,
|
||||
hasProtectedContent: Boolean,
|
||||
replyTo: AccessibleMessage?,
|
||||
replyMarkup: InlineKeyboardMarkup?,
|
||||
content: T,
|
||||
senderBot: CommonBot?,
|
||||
authorSignature: AuthorSignature?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
fromOffline: Boolean,
|
||||
cost: Int? = null,
|
||||
) : this(
|
||||
chat = chat,
|
||||
channel = channel,
|
||||
messageId = messageId,
|
||||
threadId = threadId,
|
||||
date = date,
|
||||
forwardOrigin = forwardInfo.messageOrigin(),
|
||||
editDate = editDate,
|
||||
hasProtectedContent = hasProtectedContent,
|
||||
replyInfo = replyTo ?.let { ReplyInfo.Internal(it) },
|
||||
replyMarkup = replyMarkup,
|
||||
content = content,
|
||||
senderBot = senderBot,
|
||||
authorSignature = authorSignature,
|
||||
mediaGroupId = mediaGroupId,
|
||||
fromOffline = fromOffline,
|
||||
cost = cost,
|
||||
)
|
||||
}
|
||||
|
||||
data class AnonymousForumContentMessageImpl<T : MessageContent>(
|
||||
override val chat: PreviewForumChat,
|
||||
override val messageId: MessageId,
|
||||
@@ -384,3 +440,60 @@ data class CommonForumContentMessageImpl<T : MessageContent>(
|
||||
cost = cost,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
data class CommonChannelDirectMessagesContentMessageImpl<T : MessageContent>(
|
||||
override val chat: PreviewChannelDirectMessagesChat,
|
||||
override val messageId: MessageId,
|
||||
override val threadId: MessageThreadId,
|
||||
override val from: User,
|
||||
override val date: DateTime,
|
||||
override val forwardOrigin: MessageOrigin?,
|
||||
override val editDate: DateTime?,
|
||||
override val hasProtectedContent: Boolean,
|
||||
override val replyInfo: ReplyInfo?,
|
||||
override val replyMarkup: InlineKeyboardMarkup?,
|
||||
override val content: T,
|
||||
override val senderBot: CommonBot?,
|
||||
override val mediaGroupId: MediaGroupId?,
|
||||
override val senderBoostsCount: Int?,
|
||||
override val fromOffline: Boolean,
|
||||
@SerialName(paidMessageStarCountField)
|
||||
override val cost: Int? = null,
|
||||
) : CommonChannelDirectMessagesContentMessage<T> {
|
||||
constructor(
|
||||
chat: PreviewChannelDirectMessagesChat,
|
||||
messageId: MessageId,
|
||||
threadId: MessageThreadId,
|
||||
from: User,
|
||||
date: DateTime,
|
||||
forwardInfo: ForwardInfo,
|
||||
editDate: DateTime?,
|
||||
hasProtectedContent: Boolean,
|
||||
replyTo: AccessibleMessage?,
|
||||
replyMarkup: InlineKeyboardMarkup?,
|
||||
content: T,
|
||||
senderBot: CommonBot?,
|
||||
mediaGroupId: MediaGroupId?,
|
||||
senderBoostsCount: Int?,
|
||||
fromOffline: Boolean,
|
||||
cost: Int? = null,
|
||||
) : this(
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
threadId = threadId,
|
||||
from = from,
|
||||
date = date,
|
||||
forwardOrigin = forwardInfo.messageOrigin(),
|
||||
editDate = editDate,
|
||||
hasProtectedContent = hasProtectedContent,
|
||||
replyInfo = replyTo ?.let { ReplyInfo.Internal(it) },
|
||||
replyMarkup = replyMarkup,
|
||||
content = content,
|
||||
senderBot = senderBot,
|
||||
mediaGroupId = mediaGroupId,
|
||||
senderBoostsCount = senderBoostsCount,
|
||||
fromOffline = fromOffline,
|
||||
cost = cost,
|
||||
)
|
||||
}
|
||||
|
@@ -27,6 +27,12 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.*
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.message.content.*
|
||||
@@ -183,6 +189,13 @@ internal data class RawMessage(
|
||||
// Channel direct messages
|
||||
private val direct_message_price_changed: ChannelDirectMessagesConfigurationChanged? = null,
|
||||
|
||||
//
|
||||
private val suggested_post_approved: SuggestedPostApproved? = null,
|
||||
private val suggested_post_approval_failed: SuggestedPostApprovalFailed? = null,
|
||||
private val suggested_post_declined: SuggestedPostDeclined? = null,
|
||||
private val suggested_post_paid: SuggestedPostPaid? = null,
|
||||
private val suggested_post_refunded: SuggestedPostRefunded? = null,
|
||||
private val suggested_post_info: SuggestedPostInfo? = null,
|
||||
// Gifts
|
||||
private val gift: GiftSentOrReceived.Regular? = null,
|
||||
private val unique_gift: GiftSentOrReceived.Unique? = null,
|
||||
@@ -316,6 +329,12 @@ internal data class RawMessage(
|
||||
checklist_tasks_done != null -> checklist_tasks_done
|
||||
checklist_tasks_added != null -> checklist_tasks_added
|
||||
direct_message_price_changed != null -> direct_message_price_changed
|
||||
suggested_post_info != null -> suggested_post_info
|
||||
suggested_post_approved != null -> suggested_post_approved
|
||||
suggested_post_approval_failed != null -> suggested_post_approval_failed
|
||||
suggested_post_declined != null -> suggested_post_declined
|
||||
suggested_post_paid != null -> suggested_post_paid
|
||||
suggested_post_refunded != null -> suggested_post_refunded
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
@@ -345,6 +364,14 @@ internal data class RawMessage(
|
||||
chatEvent as? GroupEvent ?: throwWrongChatEvent(GroupChat::class, chatEvent),
|
||||
date.asDate
|
||||
)
|
||||
is PreviewChannelDirectMessagesChat -> CommonChannelDirectMessagesEventMessage(
|
||||
messageId,
|
||||
//TODO:: Check that all channel direct messages events coming with "from" field
|
||||
checkedFrom ?: from ?: error("Channel direct messages events are expected to contain 'from' field"),
|
||||
chat,
|
||||
chatEvent as? ChannelDirectMessagesEvent ?: throwWrongChatEvent(PreviewChannelDirectMessagesChat::class, chatEvent),
|
||||
date.asDate
|
||||
)
|
||||
is PreviewChannelChat -> ChannelEventMessage(
|
||||
messageId,
|
||||
chat,
|
||||
@@ -388,141 +415,268 @@ internal data class RawMessage(
|
||||
fromOffline = is_from_offline,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
is PreviewForumChat -> if (messageThreadId != null) {
|
||||
val chatId = ChatIdWithThreadId(
|
||||
chat.id.chatId,
|
||||
messageThreadId
|
||||
)
|
||||
val actualForumChat = when (chat) {
|
||||
is ForumChatImpl -> chat.copy(id = chatId)
|
||||
}
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> FromChannelForumContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
is PreviewGroupChat -> AnonymousForumContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
null -> CommonForumContentMessageImpl(
|
||||
chat = actualForumChat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
from = checkedFrom ?: 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> if (is_automatic_forward == true) {
|
||||
ConnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
is PreviewForumChat -> when(chat) {
|
||||
is PreviewChannelDirectMessagesChat -> {
|
||||
if (messageThreadId != null) {
|
||||
val chatId = ChatIdWithThreadId(
|
||||
chat.id.chatId,
|
||||
messageThreadId
|
||||
)
|
||||
val actualForumChat = when (chat) {
|
||||
is ChannelDirectMessagesChatImpl -> chat.copy(id = chatId)
|
||||
}
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> FromChannelChannelDirectMessagesContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
is PreviewGroupChat,
|
||||
null -> CommonChannelDirectMessagesContentMessageImpl(
|
||||
chat = actualForumChat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
from = checkedFrom ?: from ?: error("It is expected that in direct channel messages from non anonymous 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
UnconnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> if (is_automatic_forward == true) {
|
||||
ConnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
} else {
|
||||
UnconnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
is GroupChat -> AnonymousGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
null -> CommonGroupContentMessageImpl(
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
from = checkedFrom ?: 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
is ForumChatImpl -> {
|
||||
if (messageThreadId != null) {
|
||||
val chatId = ChatIdWithThreadId(
|
||||
chat.id.chatId,
|
||||
messageThreadId
|
||||
)
|
||||
val actualForumChat = when (chat) {
|
||||
is ForumChatImpl -> chat.copy(id = chatId)
|
||||
}
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> FromChannelForumContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
is PreviewGroupChat -> AnonymousForumContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
null -> CommonForumContentMessageImpl(
|
||||
chat = actualForumChat,
|
||||
messageId = messageId,
|
||||
threadId = messageThreadId,
|
||||
from = checkedFrom ?: 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
when (sender_chat) {
|
||||
is PreviewChannelChat -> if (is_automatic_forward == true) {
|
||||
ConnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
} else {
|
||||
UnconnectedFromChannelGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
is GroupChat -> AnonymousGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
null -> CommonGroupContentMessageImpl(
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
from = checkedFrom ?: 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
}
|
||||
is GroupChat -> AnonymousGroupContentMessageImpl(
|
||||
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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
null -> CommonGroupContentMessageImpl(
|
||||
chat = chat,
|
||||
messageId = messageId,
|
||||
from = checkedFrom ?: 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,
|
||||
cost = paid_star_count,
|
||||
)
|
||||
}
|
||||
}
|
||||
is PreviewGroupChat -> when (sender_chat) {
|
||||
|
@@ -0,0 +1,11 @@
|
||||
package dev.inmo.tgbotapi.types.message.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewGroupChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent
|
||||
|
||||
interface ChannelDirectMessagesEventMessage<T : ChannelDirectMessagesEvent> : GroupEventMessage<T> {
|
||||
override val chat: PreviewChannelDirectMessagesChat
|
||||
}
|
@@ -22,6 +22,9 @@ sealed interface ForumContentMessage<T : MessageContent> : GroupContentMessage<T
|
||||
get() = (replyTo as? ChatEventMessage<*>) ?.chatEvent as? ForumTopicCreated
|
||||
}
|
||||
|
||||
sealed interface ChannelDirectMessagesContentMessage<T : MessageContent> : ForumContentMessage<T>, PossiblyTopicMessage {
|
||||
override val chat: PreviewChannelDirectMessagesChat
|
||||
}
|
||||
|
||||
sealed interface FromChannelGroupContentMessage<T : MessageContent> : GroupContentMessage<T>, SignedMessage, WithSenderChatMessage {
|
||||
val channel: PreviewChannelChat
|
||||
@@ -41,9 +44,13 @@ interface CommonGroupContentMessage<T : MessageContent> : GroupContentMessage<T>
|
||||
|
||||
interface FromChannelForumContentMessage<T: MessageContent> : FromChannelGroupContentMessage<T>, ForumContentMessage<T>
|
||||
|
||||
interface FromChannelChannelDirectMessagesContentMessage<T: MessageContent> : FromChannelGroupContentMessage<T>, ChannelDirectMessagesContentMessage<T>
|
||||
|
||||
interface AnonymousForumContentMessage<T : MessageContent> : ForumContentMessage<T>, SignedMessage, WithSenderChatMessage {
|
||||
override val senderChat: PreviewGroupChat
|
||||
get() = chat
|
||||
}
|
||||
|
||||
interface CommonForumContentMessage<T : MessageContent> : ForumContentMessage<T>, PotentiallyFromUserGroupContentMessage<T>, FromUserMessage
|
||||
|
||||
interface CommonChannelDirectMessagesContentMessage<T : MessageContent> : ChannelDirectMessagesContentMessage<T>, PotentiallyFromUserGroupContentMessage<T>, FromUserMessage
|
||||
|
@@ -169,6 +169,24 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
|
||||
fromOffline = sourceMessage.fromOffline,
|
||||
cost = sourceMessage.cost,
|
||||
)
|
||||
is CommonChannelDirectMessagesContentMessage -> CommonChannelDirectMessagesContentMessageImpl(
|
||||
chat = sourceMessage.chat,
|
||||
messageId = sourceMessage.messageId,
|
||||
threadId = sourceMessage.threadId,
|
||||
from = sourceMessage.user,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
senderBoostsCount = sourceMessage.senderBoostsCount,
|
||||
fromOffline = sourceMessage.fromOffline,
|
||||
cost = sourceMessage.cost,
|
||||
)
|
||||
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
|
||||
chat = sourceMessage.chat,
|
||||
channel = sourceMessage.channel,
|
||||
@@ -187,5 +205,24 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
|
||||
fromOffline = sourceMessage.fromOffline,
|
||||
cost = sourceMessage.cost,
|
||||
)
|
||||
|
||||
is FromChannelChannelDirectMessagesContentMessage -> FromChannelChannelDirectMessagesContentMessageImpl(
|
||||
chat = sourceMessage.chat,
|
||||
channel = sourceMessage.channel,
|
||||
messageId = sourceMessage.messageId,
|
||||
threadId = sourceMessage.threadId,
|
||||
date = sourceMessage.date,
|
||||
forwardOrigin = sourceMessage.forwardOrigin,
|
||||
editDate = sourceMessage.editDate,
|
||||
hasProtectedContent = sourceMessage.hasProtectedContent,
|
||||
replyInfo = sourceMessage.replyInfo,
|
||||
replyMarkup = sourceMessage.replyMarkup,
|
||||
content = content,
|
||||
senderBot = sourceMessage.senderBot,
|
||||
authorSignature = sourceMessage.authorSignature,
|
||||
mediaGroupId = sourceMessage.mediaGroupId,
|
||||
fromOffline = sourceMessage.fromOffline,
|
||||
cost = sourceMessage.cost,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -1163,6 +1163,8 @@ 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 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 channelDirectMessagesChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ChannelDirectMessagesChat;
|
||||
public static final fun channelDirectMessagesChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ChannelDirectMessagesChat;
|
||||
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;
|
||||
@@ -1171,6 +1173,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
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 channelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesContentMessage;
|
||||
public static final fun channelDirectMessagesContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesContentMessage;
|
||||
public static final fun channelDirectMessagesEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesEventMessage;
|
||||
public static final fun channelDirectMessagesEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesEventMessage;
|
||||
public static final fun channelDirectMessagesEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesEventMessage;
|
||||
public static final fun channelDirectMessagesEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelDirectMessagesEventMessage;
|
||||
public static final fun channelDirectMessagesEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelDirectMessagesEvent;
|
||||
public static final fun channelDirectMessagesEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelDirectMessagesEvent;
|
||||
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 channelEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChannelEvent;
|
||||
@@ -1241,6 +1251,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun codeTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/CodeTextSource;
|
||||
public static final fun commonBotOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonBot;
|
||||
public static final fun commonBotOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonBot;
|
||||
public static final fun commonChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonChannelDirectMessagesContentMessage;
|
||||
public static final fun commonChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonChannelDirectMessagesContentMessage;
|
||||
public static final fun commonChannelDirectMessagesContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonChannelDirectMessagesContentMessage;
|
||||
public static final fun commonChannelDirectMessagesContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonChannelDirectMessagesContentMessage;
|
||||
public static final fun commonChannelDirectMessagesEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonChannelDirectMessagesEventMessage;
|
||||
public static final fun commonChannelDirectMessagesEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonChannelDirectMessagesEventMessage;
|
||||
public static final fun commonChannelDirectMessagesEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonChannelDirectMessagesEventMessage;
|
||||
public static final fun commonChannelDirectMessagesEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonChannelDirectMessagesEventMessage;
|
||||
public static final fun commonChatMemberUpdatedUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/CommonChatMemberUpdatedUpdate;
|
||||
public static final fun commonChatMemberUpdatedUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/CommonChatMemberUpdatedUpdate;
|
||||
public static final fun commonEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent;
|
||||
@@ -1381,6 +1399,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun extendedBusinessChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChat;
|
||||
public static final fun extendedChannelChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat;
|
||||
public static final fun extendedChannelChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat;
|
||||
public static final fun extendedChannelDirectMessagesChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat;
|
||||
public static final fun extendedChannelDirectMessagesChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat;
|
||||
public static final fun extendedChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChat;
|
||||
public static final fun extendedChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChat;
|
||||
public static final fun extendedChatWithUsernameOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername;
|
||||
@@ -1441,6 +1461,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun fragmentOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$Fragment;
|
||||
public static final fun freeformGradientOrNull (Ldev/inmo/tgbotapi/types/BackgroundFill;)Ldev/inmo/tgbotapi/types/BackgroundFill$FreeformGradient;
|
||||
public static final fun freeformGradientOrThrow (Ldev/inmo/tgbotapi/types/BackgroundFill;)Ldev/inmo/tgbotapi/types/BackgroundFill$FreeformGradient;
|
||||
public static final fun fromChannelChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelChannelDirectMessagesContentMessage;
|
||||
public static final fun fromChannelChannelDirectMessagesContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelChannelDirectMessagesContentMessage;
|
||||
public static final fun fromChannelForumContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelForumContentMessage;
|
||||
public static final fun fromChannelForumContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelForumContentMessage;
|
||||
public static final fun fromChannelGroupContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelGroupContentMessage;
|
||||
@@ -1578,10 +1600,15 @@ 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 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 ifChannelDirectMessagesChat (Ldev/inmo/tgbotapi/types/chat/Chat;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 ifChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifChannelDirectMessagesEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifChannelDirectMessagesEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifChannelDirectMessagesEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;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 ifChannelPostUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1618,6 +1645,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifCodeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommon (Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonBot (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonChannelDirectMessagesEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonChannelDirectMessagesEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonChatMemberUpdatedUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifCommonForumContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1687,6 +1718,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifExtendedBot (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedBusinessChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedChannelChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedChannelDirectMessagesChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedChatWithUsername (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifExtendedForumChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1718,6 +1750,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifFragment (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFreeformGradient (Ldev/inmo/tgbotapi/types/BackgroundFill;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFromChannel (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFromChannelChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFromChannelForumContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFromChannelGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifFromSupergroup (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1916,6 +1949,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifPreviewBot (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewBusinessChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewChannelChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewChannelDirectMessagesChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewForumChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifPreviewGroupChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -1983,6 +2017,15 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun ifSubscriptionMemberChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSucceeded (Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuccessfulPaymentEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostApprovalFailed (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostApproved (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostDeclined (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostInfo (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostPaid (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostPaidOther (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostPaidTON (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostPaidXTR (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuggestedPostRefunded (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSuperPublicChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSupergroupChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
public static final fun ifSupergroupChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||
@@ -2406,6 +2449,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun previewBusinessChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewBusinessChat;
|
||||
public static final fun previewChannelChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;
|
||||
public static final fun previewChannelChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;
|
||||
public static final fun previewChannelDirectMessagesChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelDirectMessagesChat;
|
||||
public static final fun previewChannelDirectMessagesChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelDirectMessagesChat;
|
||||
public static final fun previewChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChat;
|
||||
public static final fun previewChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewChat;
|
||||
public static final fun previewForumChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewForumChat;
|
||||
@@ -2540,6 +2585,24 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
|
||||
public static final fun succeededOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState;)Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState$Succeeded;
|
||||
public static final fun successfulPaymentEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/payments/SuccessfulPaymentEvent;
|
||||
public static final fun successfulPaymentEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/payments/SuccessfulPaymentEvent;
|
||||
public static final fun suggestedPostApprovalFailedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostApprovalFailed;
|
||||
public static final fun suggestedPostApprovalFailedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostApprovalFailed;
|
||||
public static final fun suggestedPostApprovedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostApproved;
|
||||
public static final fun suggestedPostApprovedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostApproved;
|
||||
public static final fun suggestedPostDeclinedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostDeclined;
|
||||
public static final fun suggestedPostDeclinedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostDeclined;
|
||||
public static final fun suggestedPostInfoOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostInfo;
|
||||
public static final fun suggestedPostInfoOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostInfo;
|
||||
public static final fun suggestedPostPaidOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid;
|
||||
public static final fun suggestedPostPaidOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid;
|
||||
public static final fun suggestedPostPaidOtherOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$Other;
|
||||
public static final fun suggestedPostPaidOtherOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$Other;
|
||||
public static final fun suggestedPostPaidTONOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$TON;
|
||||
public static final fun suggestedPostPaidTONOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$TON;
|
||||
public static final fun suggestedPostPaidXTROrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$XTR;
|
||||
public static final fun suggestedPostPaidXTROrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostPaid$XTR;
|
||||
public static final fun suggestedPostRefundedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostRefunded;
|
||||
public static final fun suggestedPostRefundedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/suggested/SuggestedPostRefunded;
|
||||
public static final fun superPublicChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/SuperPublicChat;
|
||||
public static final fun superPublicChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/SuperPublicChat;
|
||||
public static final fun supergroupChatCreatedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/SupergroupChatCreated;
|
||||
|
@@ -123,6 +123,7 @@ 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.ChannelDirectMessagesChat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.ChatBackground
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
@@ -132,6 +133,7 @@ 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.ExtendedChannelDirectMessagesChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedForumChat
|
||||
@@ -146,6 +148,7 @@ 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.PreviewChannelDirectMessagesChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewForumChat
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewGroupChat
|
||||
@@ -264,6 +267,7 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.ProximityAlertTriggered
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.SupergroupChatCreated
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.UserLoggedIn
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent
|
||||
@@ -280,10 +284,17 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatParticipantsInvited
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatScheduled
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatStarted
|
||||
import dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.CommonGroupEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.ForwardInfo
|
||||
@@ -294,13 +305,17 @@ import dev.inmo.tgbotapi.types.message.abstracts.AnonymousForumContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonForumContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ForumContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.FromChannelChannelDirectMessagesContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.FromChannelForumContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage
|
||||
@@ -698,6 +713,12 @@ public inline fun OptionallyWithUser.leftChatMemberEventOrThrow(): LeftChatMembe
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = leftChatMemberEventOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent> = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage<GroupEvent>? = this as? dev.inmo.tgbotapi.types.message.CommonGroupEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent>
|
||||
|
||||
public inline fun OptionallyWithUser.commonGroupEventMessageOrThrow(): CommonGroupEventMessage<GroupEvent> = this as dev.inmo.tgbotapi.types.message.CommonGroupEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent>
|
||||
@@ -734,6 +755,12 @@ public inline fun OptionallyWithUser.channelContentMessageOrThrow(): ChannelCont
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifChannelContentMessage(block: (ChannelContentMessage<MessageContent>) -> T): T? = channelContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent> = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage
|
||||
|
||||
public inline fun OptionallyWithUser.optionallyFromUserMessageOrThrow(): OptionallyFromUserMessage = this as dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage
|
||||
@@ -764,6 +791,12 @@ public inline fun OptionallyWithUser.commonForumContentMessageOrThrow(): CommonF
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifCommonForumContentMessage(block: (CommonForumContentMessage<MessageContent>) -> T): T? = commonForumContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.commonChannelDirectMessagesContentMessageOrNull(): CommonChannelDirectMessagesContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun OptionallyWithUser.commonChannelDirectMessagesContentMessageOrThrow(): CommonChannelDirectMessagesContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.CommonChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun <T> OptionallyWithUser.ifCommonChannelDirectMessagesContentMessage(block: (CommonChannelDirectMessagesContentMessage<MessageContent>) -> T): T? = commonChannelDirectMessagesContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun OptionallyWithUser.privateContentMessageOrNull(): PrivateContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun OptionallyWithUser.privateContentMessageOrThrow(): PrivateContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
@@ -1640,6 +1673,12 @@ public inline fun Chat.forumChatOrThrow(): ForumChat = this as dev.inmo.tgbotapi
|
||||
|
||||
public inline fun <T> Chat.ifForumChat(block: (ForumChat) -> T): T? = forumChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.channelDirectMessagesChatOrNull(): ChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.ChannelDirectMessagesChat
|
||||
|
||||
public inline fun Chat.channelDirectMessagesChatOrThrow(): ChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.ChannelDirectMessagesChat
|
||||
|
||||
public inline fun <T> Chat.ifChannelDirectMessagesChat(block: (ChannelDirectMessagesChat) -> T): T? = channelDirectMessagesChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat
|
||||
|
||||
public inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat
|
||||
@@ -1712,6 +1751,12 @@ public inline fun Chat.extendedForumChatOrThrow(): ExtendedForumChat = this as d
|
||||
|
||||
public inline fun <T> Chat.ifExtendedForumChat(block: (ExtendedForumChat) -> T): T? = extendedForumChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.extendedChannelDirectMessagesChatOrNull(): ExtendedChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat
|
||||
|
||||
public inline fun Chat.extendedChannelDirectMessagesChatOrThrow(): ExtendedChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat
|
||||
|
||||
public inline fun <T> Chat.ifExtendedChannelDirectMessagesChat(block: (ExtendedChannelDirectMessagesChat) -> T): T? = extendedChannelDirectMessagesChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.extendedChatWithUsernameOrNull(): ExtendedChatWithUsername? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername
|
||||
|
||||
public inline fun Chat.extendedChatWithUsernameOrThrow(): ExtendedChatWithUsername = this as dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername
|
||||
@@ -1820,6 +1865,12 @@ public inline fun Chat.previewForumChatOrThrow(): PreviewForumChat = this as dev
|
||||
|
||||
public inline fun <T> Chat.ifPreviewForumChat(block: (PreviewForumChat) -> T): T? = previewForumChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.previewChannelDirectMessagesChatOrNull(): PreviewChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat
|
||||
|
||||
public inline fun Chat.previewChannelDirectMessagesChatOrThrow(): PreviewChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat
|
||||
|
||||
public inline fun <T> Chat.ifPreviewChannelDirectMessagesChat(block: (PreviewChannelDirectMessagesChat) -> T): T? = previewChannelDirectMessagesChatOrNull() ?.let(block)
|
||||
|
||||
public inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? dev.inmo.tgbotapi.types.chat.UnknownChatType
|
||||
|
||||
public inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as dev.inmo.tgbotapi.types.chat.UnknownChatType
|
||||
@@ -2444,6 +2495,12 @@ public inline fun ChatEvent.webAppDataOrThrow(): WebAppData = this as dev.inmo.t
|
||||
|
||||
public inline fun <T> ChatEvent.ifWebAppData(block: (WebAppData) -> T): T? = webAppDataOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.channelDirectMessagesEventOrNull(): ChannelDirectMessagesEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
|
||||
public inline fun ChatEvent.channelDirectMessagesEventOrThrow(): ChannelDirectMessagesEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent
|
||||
|
||||
public inline fun <T> ChatEvent.ifChannelDirectMessagesEvent(block: (ChannelDirectMessagesEvent) -> T): T? = channelDirectMessagesEventOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
|
||||
|
||||
public inline fun ChatEvent.channelEventOrThrow(): ChannelEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
|
||||
@@ -2558,6 +2615,60 @@ public inline fun ChatEvent.writeAccessAllowedFromAttachmentMenuOrThrow(): Write
|
||||
|
||||
public inline fun <T> ChatEvent.ifWriteAccessAllowedFromAttachmentMenu(block: (WriteAccessAllowed.FromAttachmentMenu) -> T): T? = writeAccessAllowedFromAttachmentMenuOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostApprovalFailedOrNull(): SuggestedPostApprovalFailed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
|
||||
public inline fun ChatEvent.suggestedPostApprovalFailedOrThrow(): SuggestedPostApprovalFailed = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostApprovalFailed(block: (SuggestedPostApprovalFailed) -> T): T? = suggestedPostApprovalFailedOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostApprovedOrNull(): SuggestedPostApproved? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
|
||||
public inline fun ChatEvent.suggestedPostApprovedOrThrow(): SuggestedPostApproved = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostApproved(block: (SuggestedPostApproved) -> T): T? = suggestedPostApprovedOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostDeclinedOrNull(): SuggestedPostDeclined? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
|
||||
public inline fun ChatEvent.suggestedPostDeclinedOrThrow(): SuggestedPostDeclined = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostDeclined(block: (SuggestedPostDeclined) -> T): T? = suggestedPostDeclinedOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostInfoOrNull(): SuggestedPostInfo? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
|
||||
public inline fun ChatEvent.suggestedPostInfoOrThrow(): SuggestedPostInfo = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostInfo(block: (SuggestedPostInfo) -> T): T? = suggestedPostInfoOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidOrNull(): SuggestedPostPaid? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidOrThrow(): SuggestedPostPaid = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostPaid(block: (SuggestedPostPaid) -> T): T? = suggestedPostPaidOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidXTROrNull(): SuggestedPostPaid.XTR? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.XTR
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidXTROrThrow(): SuggestedPostPaid.XTR = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.XTR
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostPaidXTR(block: (SuggestedPostPaid.XTR) -> T): T? = suggestedPostPaidXTROrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidTONOrNull(): SuggestedPostPaid.TON? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.TON
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidTONOrThrow(): SuggestedPostPaid.TON = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.TON
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostPaidTON(block: (SuggestedPostPaid.TON) -> T): T? = suggestedPostPaidTONOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidOtherOrNull(): SuggestedPostPaid.Other? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.Other
|
||||
|
||||
public inline fun ChatEvent.suggestedPostPaidOtherOrThrow(): SuggestedPostPaid.Other = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.Other
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostPaidOther(block: (SuggestedPostPaid.Other) -> T): T? = suggestedPostPaidOtherOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.suggestedPostRefundedOrNull(): SuggestedPostRefunded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
|
||||
public inline fun ChatEvent.suggestedPostRefundedOrThrow(): SuggestedPostRefunded = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded
|
||||
|
||||
public inline fun <T> ChatEvent.ifSuggestedPostRefunded(block: (SuggestedPostRefunded) -> T): T? = suggestedPostRefundedOrNull() ?.let(block)
|
||||
|
||||
public inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded
|
||||
|
||||
public inline fun ChatEvent.videoChatEndedOrThrow(): VideoChatEnded = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded
|
||||
@@ -2654,6 +2765,12 @@ public inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage<Chan
|
||||
|
||||
public inline fun <T> Message.ifChannelEventMessage(block: (ChannelEventMessage<ChannelEvent>) -> T): T? = channelEventMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun Message.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent> = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun <T> Message.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage<GroupEvent>? = this as? dev.inmo.tgbotapi.types.message.CommonGroupEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent>
|
||||
|
||||
public inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage<GroupEvent> = this as dev.inmo.tgbotapi.types.message.CommonGroupEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent>
|
||||
@@ -2690,6 +2807,12 @@ public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage<
|
||||
|
||||
public inline fun <T> Message.ifChannelContentMessage(block: (ChannelContentMessage<MessageContent>) -> T): T? = channelContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun Message.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent> = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent>
|
||||
|
||||
public inline fun <T> Message.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage<ChannelDirectMessagesEvent>) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.chatEventMessageOrNull(): ChatEventMessage<ChatEvent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent>
|
||||
|
||||
public inline fun Message.chatEventMessageOrThrow(): ChatEventMessage<ChatEvent> = this as dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage<dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent>
|
||||
@@ -2744,6 +2867,12 @@ public inline fun Message.forumContentMessageOrThrow(): ForumContentMessage<Mess
|
||||
|
||||
public inline fun <T> Message.ifForumContentMessage(block: (ForumContentMessage<MessageContent>) -> T): T? = forumContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.channelDirectMessagesContentMessageOrNull(): ChannelDirectMessagesContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun Message.channelDirectMessagesContentMessageOrThrow(): ChannelDirectMessagesContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun <T> Message.ifChannelDirectMessagesContentMessage(block: (ChannelDirectMessagesContentMessage<MessageContent>) -> T): T? = channelDirectMessagesContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.fromChannelGroupContentMessageOrNull(): FromChannelGroupContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun Message.fromChannelGroupContentMessageOrThrow(): FromChannelGroupContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
@@ -2780,6 +2909,12 @@ public inline fun Message.fromChannelForumContentMessageOrThrow(): FromChannelFo
|
||||
|
||||
public inline fun <T> Message.ifFromChannelForumContentMessage(block: (FromChannelForumContentMessage<MessageContent>) -> T): T? = fromChannelForumContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.fromChannelChannelDirectMessagesContentMessageOrNull(): FromChannelChannelDirectMessagesContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromChannelChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun Message.fromChannelChannelDirectMessagesContentMessageOrThrow(): FromChannelChannelDirectMessagesContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.FromChannelChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun <T> Message.ifFromChannelChannelDirectMessagesContentMessage(block: (FromChannelChannelDirectMessagesContentMessage<MessageContent>) -> T): T? = fromChannelChannelDirectMessagesContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.anonymousForumContentMessageOrNull(): AnonymousForumContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.AnonymousForumContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun Message.anonymousForumContentMessageOrThrow(): AnonymousForumContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.AnonymousForumContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
@@ -2792,6 +2927,12 @@ public inline fun Message.commonForumContentMessageOrThrow(): CommonForumContent
|
||||
|
||||
public inline fun <T> Message.ifCommonForumContentMessage(block: (CommonForumContentMessage<MessageContent>) -> T): T? = commonForumContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.commonChannelDirectMessagesContentMessageOrNull(): CommonChannelDirectMessagesContentMessage<MessageContent>? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun Message.commonChannelDirectMessagesContentMessageOrThrow(): CommonChannelDirectMessagesContentMessage<MessageContent> = this as dev.inmo.tgbotapi.types.message.abstracts.CommonChannelDirectMessagesContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
|
||||
|
||||
public inline fun <T> Message.ifCommonChannelDirectMessagesContentMessage(block: (CommonChannelDirectMessagesContentMessage<MessageContent>) -> T): T? = commonChannelDirectMessagesContentMessageOrNull() ?.let(block)
|
||||
|
||||
public inline fun Message.accessibleMessageOrNull(): AccessibleMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
||||
public inline fun Message.accessibleMessageOrThrow(): AccessibleMessage = this as dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
|
||||
|
Reference in New Issue
Block a user