1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-03 17:32:23 +00:00

fix drafts flows signatures

This commit is contained in:
2026-02-16 18:52:41 +06:00
parent 14402f9283
commit d68c70e898
2 changed files with 7 additions and 16 deletions

View File

@@ -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 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 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 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 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 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 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 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 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 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 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 { public final class dev/inmo/tgbotapi/extensions/api/send/SendMessageKt {

View File

@@ -9,20 +9,15 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.MarkdownV2 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.types.message.textsources.TextSource
import dev.inmo.tgbotapi.utils.DraftIdAllocator import dev.inmo.tgbotapi.utils.DraftIdAllocator
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
import dev.inmo.tgbotapi.utils.buildEntities import dev.inmo.tgbotapi.utils.buildEntities
import dev.inmo.tgbotapi.utils.extensions.escapeMarkdownV2Common import dev.inmo.tgbotapi.utils.extensions.escapeMarkdownV2Common
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.takeWhile
import kotlinx.coroutines.sync.Mutex
import kotlin.js.JsName import kotlin.js.JsName
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
@@ -76,9 +71,7 @@ public suspend fun TelegramBot.sendMessageDraftFlow(
) )
} }
@JvmName("sendMessageDraftFlowWithTextAndParseMode") public suspend fun TelegramBot.sendMessageDraftFlowWithTextsAndParseMode(
@JsName("sendMessageDraftFlowWithTextAndParseMode")
public suspend fun TelegramBot.sendMessageDraftFlow(
chatId: IdChatIdentifier, chatId: IdChatIdentifier,
messagesFlow: Flow<Pair<String, ParseMode?>>, messagesFlow: Flow<Pair<String, ParseMode?>>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
@@ -92,16 +85,14 @@ public suspend fun TelegramBot.sendMessageDraftFlow(
) )
} }
@JvmName("sendMessageDraftFlowWithText") public suspend fun TelegramBot.sendMessageDraftFlowWithTexts(
@JsName("sendMessageDraftFlowWithText")
public suspend fun TelegramBot.sendMessageDraftFlow(
chatId: IdChatIdentifier, chatId: IdChatIdentifier,
messagesFlow: Flow<String>, messagesFlow: Flow<String>,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
draftId: DraftId? = null, draftId: DraftId? = null,
): Boolean { ): Boolean {
val draftId = draftId ?: GlobalDraftIdAllocator.allocate() val draftId = draftId ?: GlobalDraftIdAllocator.allocate()
return sendMessageDraftFlow( return sendMessageDraftFlowWithTextsAndParseMode(
chatId = chatId, chatId = chatId,
messagesFlow = messagesFlow.map { messagesFlow = messagesFlow.map {
it.escapeMarkdownV2Common() to MarkdownV2 it.escapeMarkdownV2Common() to MarkdownV2