From d68c70e8980486cee49086c9efe780beb53e775c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 16 Feb 2026 18:52:41 +0600 Subject: [PATCH] fix drafts flows signatures --- tgbotapi.api/api/tgbotapi.api.api | 8 ++++---- .../extensions/api/send/SendMessageDraft.kt | 15 +++------------ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 425d275756..39cb98b8ad 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -1785,10 +1785,10 @@ public final class dev/inmo/tgbotapi/extensions/api/send/SendMessageDraftKt { public static synthetic fun sendMessageDraft-PjdzSgQ$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/MessageThreadId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun sendMessageDraftFlow-lJCFx7I (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun sendMessageDraftFlow-lJCFx7I$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun sendMessageDraftFlowWithText (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun sendMessageDraftFlowWithText$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun sendMessageDraftFlowWithTextAndParseMode (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun sendMessageDraftFlowWithTextAndParseMode$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendMessageDraftFlowWithTexts-lJCFx7I (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendMessageDraftFlowWithTexts-lJCFx7I$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendMessageDraftFlowWithTextsAndParseMode-lJCFx7I (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendMessageDraftFlowWithTextsAndParseMode-lJCFx7I$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DraftId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/send/SendMessageKt { diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessageDraft.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessageDraft.kt index ed0cb85cfd..0de5b18461 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessageDraft.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessageDraft.kt @@ -9,20 +9,15 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.MarkdownV2 -import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage -import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.utils.DraftIdAllocator import dev.inmo.tgbotapi.utils.EntitiesBuilderBody import dev.inmo.tgbotapi.utils.buildEntities import dev.inmo.tgbotapi.utils.extensions.escapeMarkdownV2Common import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.map -import kotlinx.coroutines.flow.takeWhile -import kotlinx.coroutines.sync.Mutex import kotlin.js.JsName import kotlin.jvm.JvmName @@ -76,9 +71,7 @@ public suspend fun TelegramBot.sendMessageDraftFlow( ) } -@JvmName("sendMessageDraftFlowWithTextAndParseMode") -@JsName("sendMessageDraftFlowWithTextAndParseMode") -public suspend fun TelegramBot.sendMessageDraftFlow( +public suspend fun TelegramBot.sendMessageDraftFlowWithTextsAndParseMode( chatId: IdChatIdentifier, messagesFlow: Flow>, threadId: MessageThreadId? = chatId.threadId, @@ -92,16 +85,14 @@ public suspend fun TelegramBot.sendMessageDraftFlow( ) } -@JvmName("sendMessageDraftFlowWithText") -@JsName("sendMessageDraftFlowWithText") -public suspend fun TelegramBot.sendMessageDraftFlow( +public suspend fun TelegramBot.sendMessageDraftFlowWithTexts( chatId: IdChatIdentifier, messagesFlow: Flow, threadId: MessageThreadId? = chatId.threadId, draftId: DraftId? = null, ): Boolean { val draftId = draftId ?: GlobalDraftIdAllocator.allocate() - return sendMessageDraftFlow( + return sendMessageDraftFlowWithTextsAndParseMode( chatId = chatId, messagesFlow = messagesFlow.map { it.escapeMarkdownV2Common() to MarkdownV2