From a692ed65f3cc4fd67d7e07eb19eb73fecff2971a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 7 Jan 2024 22:42:46 +0600 Subject: [PATCH] almost add reply parameters --- .../extensions/api/LiveFlowLocation.kt | 18 +- .../extensions/api/LiveLocationProvider.kt | 30 +- .../extensions/api/send/CopyMessage.kt | 115 ++--- .../tgbotapi/extensions/api/send/Replies.kt | 142 +++--- .../extensions/api/send/ResendMessage.kt | 29 +- .../extensions/api/send/SendContact.kt | 20 +- .../tgbotapi/extensions/api/send/SendDice.kt | 15 +- .../extensions/api/send/SendLiveLocation.kt | 44 +- .../extensions/api/send/SendMessage.kt | 81 ++- .../extensions/api/send/SendStaticLocation.kt | 49 +- .../tgbotapi/extensions/api/send/SendVenue.kt | 36 +- .../tgbotapi/extensions/api/send/Sends.kt | 461 +++++++----------- .../extensions/api/send/games/SendGame.kt | 25 +- .../api/send/media/SendAnimation.kt | 47 +- .../extensions/api/send/media/SendAudio.kt | 47 +- .../extensions/api/send/media/SendDocument.kt | 47 +- .../api/send/media/SendMediaGroup.kt | 85 ++-- .../extensions/api/send/media/SendPhoto.kt | 67 +-- .../extensions/api/send/media/SendSticker.kt | 25 +- .../extensions/api/send/media/SendVideo.kt | 47 +- .../api/send/media/SendVideoNote.kt | 26 +- .../extensions/api/send/media/SendVoice.kt | 47 +- .../api/send/payments/SendInvoice.kt | 10 +- .../extensions/api/send/polls/SendPoll.kt | 65 +-- .../abstracts/types/ReplyMessageId.kt | 8 - .../abstracts/types/WithReplyParameters.kt | 19 + .../tgbotapi/requests/send/CopyMessage.kt | 30 +- .../tgbotapi/requests/send/SendContact.kt | 18 +- .../inmo/tgbotapi/requests/send/SendDice.kt | 10 +- .../tgbotapi/requests/send/SendLocation.kt | 23 +- .../tgbotapi/requests/send/SendMessage.kt | 18 +- .../inmo/tgbotapi/requests/send/SendVenue.kt | 18 +- .../send/abstracts/SendMessageRequest.kt | 2 +- .../tgbotapi/requests/send/games/SendGame.kt | 6 +- .../requests/send/media/SendAnimation.kt | 18 +- .../tgbotapi/requests/send/media/SendAudio.kt | 18 +- .../requests/send/media/SendDocument.kt | 18 +- .../requests/send/media/SendMediaGroup.kt | 26 +- .../tgbotapi/requests/send/media/SendPhoto.kt | 18 +- .../requests/send/media/SendSticker.kt | 18 +- .../tgbotapi/requests/send/media/SendVideo.kt | 18 +- .../requests/send/media/SendVideoNote.kt | 12 +- .../tgbotapi/requests/send/media/SendVoice.kt | 18 +- .../requests/send/payments/SendInvoice.kt | 8 +- .../tgbotapi/requests/send/polls/SendPoll.kt | 57 +-- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../inmo/tgbotapi/types/ReplyParameters.kt | 34 +- .../types/message/content/Abstracts.kt | 31 +- .../types/message/content/AnimationContent.kt | 11 +- .../types/message/content/AudioContent.kt | 11 +- .../types/message/content/ContactContent.kt | 5 +- .../types/message/content/DiceContent.kt | 7 +- .../types/message/content/DocumentContent.kt | 11 +- .../types/message/content/GameContent.kt | 7 +- .../content/GiveawayPublicResultsContent.kt | 3 +- .../types/message/content/InvoiceContent.kt | 4 +- .../types/message/content/LocationContent.kt | 13 +- .../message/content/MediaGroupContent.kt | 6 +- .../types/message/content/PhotoContent.kt | 11 +- .../types/message/content/PollContent.kt | 7 +- .../content/ScheduledGiveawayContent.kt | 3 +- .../types/message/content/StickerContent.kt | 7 +- .../types/message/content/StoryContent.kt | 4 +- .../types/message/content/TextContent.kt | 6 +- .../types/message/content/VenueContent.kt | 6 +- .../types/message/content/VideoContent.kt | 11 +- .../types/message/content/VideoNoteContent.kt | 7 +- .../types/message/content/VoiceContent.kt | 6 +- 68 files changed, 852 insertions(+), 1319 deletions(-) delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMessageId.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyParameters.kt diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt index 58bae30e88..46381c4430 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt @@ -44,8 +44,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, sentMessageFlow: FlowCollector>? = null ) { var currentLiveLocationMessage: ContentMessage? = null @@ -71,8 +70,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, it.replyMarkup ).also { sentMessageFlow ?.emit(it) @@ -106,8 +104,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, sentMessageFlow: FlowCollector>? = null ) { handleLiveLocation( @@ -126,8 +123,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, sentMessageFlow ) } @@ -145,8 +141,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, sentMessageFlow: FlowCollector>? = null ) { handleLiveLocation( @@ -161,8 +156,7 @@ suspend fun TelegramBot.handleLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, sentMessageFlow ) } diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt index de3551c5a2..4f76a7923f 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveLocationProvider.kt @@ -96,8 +96,7 @@ suspend fun TelegramBot.startLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): LiveLocationProvider { val liveTimeAsDouble = liveTimeMillis.toDouble() @@ -113,8 +112,7 @@ suspend fun TelegramBot.startLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -143,8 +141,7 @@ suspend fun TelegramBot.startLiveLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): LiveLocationProvider = startLiveLocation( scope, @@ -158,8 +155,7 @@ suspend fun TelegramBot.startLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -178,8 +174,7 @@ suspend fun TelegramBot.startLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): LiveLocationProvider = startLiveLocation( scope, @@ -193,8 +188,7 @@ suspend fun TelegramBot.startLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -213,8 +207,7 @@ suspend fun TelegramBot.startLiveLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): LiveLocationProvider = startLiveLocation( scope, @@ -228,8 +221,7 @@ suspend fun TelegramBot.startLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -263,8 +255,7 @@ suspend inline fun TelegramBot.replyWithLiveLocation( threadId, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -296,7 +287,6 @@ suspend inline fun TelegramBot.replyWithLiveLocation( threadId, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt index fe539e90ab..2524e2b145 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt @@ -2,15 +2,12 @@ package dev.inmo.tgbotapi.extensions.api.send import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.CopyMessage -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -25,8 +22,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( CopyMessage( @@ -38,8 +34,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -57,10 +52,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChat.id, messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -75,10 +69,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChatId, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -93,10 +86,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChat.id, messageId, toChat.id, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -111,8 +103,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( CopyMessage( @@ -123,8 +114,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -141,10 +131,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChat.id, messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -158,10 +147,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChatId, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -175,10 +163,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(fromChat.id, messageId, toChat.id, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -192,10 +179,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(message.chat, message.messageId, toChatId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -209,10 +195,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(message.chat, message.messageId, toChat, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -225,10 +210,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(message.chat, message.messageId, toChatId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -241,10 +225,9 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage(message.chat, message.messageId, toChat, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -259,8 +242,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( CopyMessage( @@ -272,8 +254,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -291,8 +272,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChatId, @@ -303,8 +283,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -321,8 +300,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChat.id, @@ -333,8 +311,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -351,8 +328,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChat.id, @@ -363,8 +339,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -381,8 +356,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( CopyMessage( @@ -393,8 +367,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -411,8 +384,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChatId, @@ -422,8 +394,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -439,8 +410,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChat.id, @@ -450,8 +420,7 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -467,8 +436,7 @@ suspend inline fun TelegramBot.copyMessage( threadId: MessageThreadId? = toChat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage( toChat.id, @@ -478,7 +446,6 @@ suspend inline fun TelegramBot.copyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index 09b3cd0ea3..7484c3bd20 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -59,8 +59,7 @@ suspend inline fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -81,8 +80,7 @@ suspend inline fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -100,7 +98,7 @@ suspend inline fun TelegramBot.replyWithDice( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(to.chat, animationType, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendDice(to.chat, animationType, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -188,8 +186,7 @@ suspend inline fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -212,8 +209,7 @@ suspend inline fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -281,8 +277,7 @@ suspend inline fun TelegramBot.reply( threadId = to.threadIdOrNull, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = to.messageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup = replyMarkup ) @@ -312,8 +307,7 @@ suspend inline fun TelegramBot.reply( threadId = to.threadIdOrNull, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = to.messageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup = replyMarkup ) @@ -330,8 +324,7 @@ suspend inline fun TelegramBot.reply( threadId = to.threadIdOrNull, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = to.messageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup = replyMarkup ) @@ -346,7 +339,7 @@ suspend inline fun TelegramBot.replyWithGame( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendGame( - to.chat, gameShortName, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup + to.chat, gameShortName, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) suspend inline fun TelegramBot.replyWithGame( @@ -357,7 +350,7 @@ suspend inline fun TelegramBot.replyWithGame( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendGame( - to.chat, game.title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup + to.chat, game.title, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) suspend inline fun TelegramBot.reply( @@ -399,8 +392,7 @@ suspend inline fun TelegramBot.replyWithAnimation( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -417,7 +409,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(to.chat, animation, text, parseMode, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(to.chat, animation, text, parseMode, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.replyWithAnimation( to: AccessibleMessage, @@ -444,8 +436,7 @@ suspend inline fun TelegramBot.replyWithAnimation( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -461,7 +452,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(to.chat, animation, entities, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(to.chat, animation, entities, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Audio @@ -479,7 +470,7 @@ suspend inline fun TelegramBot.replyWithAudio( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -491,7 +482,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(to.chat, audio, text, parseMode, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(to.chat, audio, text, parseMode, title, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.replyWithAudio( to: AccessibleMessage, @@ -505,7 +496,7 @@ suspend inline fun TelegramBot.replyWithAudio( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -516,7 +507,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(to.chat, audio, entities, title, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(to.chat, audio, entities, title, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Documents @@ -532,7 +523,7 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(to.chat, document, thumb, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(to.chat, document, thumb, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup, disableContentTypeDetection) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -544,7 +535,7 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(to.chat, document, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(to.chat, document, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup, disableContentTypeDetection) suspend inline fun TelegramBot.replyWithDocument( to: AccessibleMessage, @@ -556,7 +547,7 @@ suspend inline fun TelegramBot.replyWithDocument( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(to.chat, document, thumb, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(to.chat, document, thumb, entities, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup, disableContentTypeDetection) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -567,7 +558,7 @@ suspend inline fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(to.chat, document, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(to.chat, document, entities, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup, disableContentTypeDetection) // Media Group @@ -618,7 +609,7 @@ suspend inline fun TelegramBot.replyWithPhoto( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, fileId, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, fileId, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -630,7 +621,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, photo, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, photo, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -642,7 +633,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, photoSize, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, photoSize, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.replyWithPhoto( @@ -654,7 +645,7 @@ suspend inline fun TelegramBot.replyWithPhoto( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, fileId, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, fileId, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -665,7 +656,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, photo, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, photo, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -676,7 +667,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(to.chat, photoSize, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(to.chat, photoSize, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Sticker @@ -689,7 +680,7 @@ suspend inline fun TelegramBot.replyWithSticker( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(to.chat, sticker, to.threadIdOrNull, emoji, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(to.chat, sticker, to.threadIdOrNull, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -699,7 +690,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(to.chat, sticker, to.threadIdOrNull, emoji, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(to.chat, sticker, to.threadIdOrNull, emoji, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Videos @@ -718,7 +709,7 @@ suspend inline fun TelegramBot.replyWithVideo( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(to.chat, video, thumb, text, parseMode, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(to.chat, video, thumb, text, parseMode, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -730,7 +721,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(to.chat, video, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(to.chat, video, text, parseMode, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.replyWithVideo( to: AccessibleMessage, @@ -745,7 +736,7 @@ suspend inline fun TelegramBot.replyWithVideo( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(to.chat, video, thumb, entities, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(to.chat, video, thumb, entities, spoilered, duration, width, height, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -756,7 +747,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(to.chat, video, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(to.chat, video, entities, spoilered, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // VideoNotes @@ -771,7 +762,7 @@ suspend inline fun TelegramBot.replyWithVideoNote( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(to.chat, videoNote, thumb, duration, size, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(to.chat, videoNote, thumb, duration, size, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -780,7 +771,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(to.chat, videoNote, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(to.chat, videoNote, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Voice @@ -795,7 +786,7 @@ suspend inline fun TelegramBot.replyWithVoice( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(to.chat, voice, text, parseMode, duration, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(to.chat, voice, text, parseMode, duration, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -806,7 +797,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(to.chat, voice, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(to.chat, voice, text, parseMode, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.replyWithVoice( @@ -818,7 +809,7 @@ suspend inline fun TelegramBot.replyWithVoice( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(to.chat, voice, entities, duration, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(to.chat, voice, entities, duration, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -828,7 +819,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(to.chat, voice, entities, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(to.chat, voice, entities, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Invoice @@ -860,7 +851,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) // Polls @@ -877,7 +868,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(to.chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -892,7 +883,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(to.chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -908,7 +899,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -925,7 +916,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -940,7 +931,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(to.chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( to: AccessibleMessage, @@ -956,7 +947,7 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(to.chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, to.threadIdOrNull, disableNotification, protectContent, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup) suspend inline fun TelegramBot.reply( @@ -1023,8 +1014,7 @@ suspend inline fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to.metaInfo, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) @@ -1064,44 +1054,42 @@ suspend fun TelegramBot.reply( to.threadIdOrNull, disableNotification, protectContent, - to.messageId, - allowSendingWithoutReply, + ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) ) /** - * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * Will use [handleLiveLocation] with replying to [to] each time new message will be sent by live location update * * @see handleLiveLocation */ suspend fun TelegramBot.reply( - message: AccessibleMessage, + to: AccessibleMessage, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null ) = handleLiveLocation( - message.chat.id, + to.chat.id, locationsFlow, liveTimeMillis, - message.threadIdOrNull, + to.threadIdOrNull, disableNotification, protectContent, - message.messageId, - allowSendingWithoutReply + ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ) /** - * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * Will use [handleLiveLocation] with replying to [to] each time new message will be sent by live location update * * @see handleLiveLocation */ @JvmName("replyLiveLocationWithLocation") @JsName("replyLiveLocationWithLocation") suspend fun TelegramBot.reply( - message: AccessibleMessage, + to: AccessibleMessage, locationsFlow: Flow, liveTimeMillis: Long = defaultLivePeriodDelayMillis, disableNotification: Boolean = false, @@ -1109,26 +1097,25 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null ) { handleLiveLocation( - message.chat.id, + to.chat.id, locationsFlow, liveTimeMillis, - message.threadIdOrNull, + to.threadIdOrNull, disableNotification, protectContent, - message.messageId, - allowSendingWithoutReply + ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ) } /** - * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * Will use [handleLiveLocation] with replying to [to] each time new message will be sent by live location update * * @see handleLiveLocation */ @JvmName("replyLiveLocationWithLatLong") @JsName("replyLiveLocationWithLatLong") suspend fun TelegramBot.reply( - message: AccessibleMessage, + to: AccessibleMessage, locationsFlow: Flow>, liveTimeMillis: Long = defaultLivePeriodDelayMillis, disableNotification: Boolean = false, @@ -1136,14 +1123,13 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply: Boolean? = null ) { handleLiveLocation( - message.chat.id, + to.chat.id, locationsFlow, liveTimeMillis, - message.threadIdOrNull, + to.threadIdOrNull, disableNotification, protectContent, - message.messageId, - allowSendingWithoutReply + ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true) ) } diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt index 8a68ce82f7..6d002c5bb4 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/ResendMessage.kt @@ -1,14 +1,11 @@ package dev.inmo.tgbotapi.extensions.api.send import dev.inmo.tgbotapi.bot.TelegramBot -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.threadId /** * This method will send [content] to the [chatId] as is @@ -19,8 +16,7 @@ suspend inline fun TelegramBot.resend( messageThreadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( content.createResend( @@ -28,8 +24,7 @@ suspend inline fun TelegramBot.resend( messageThreadId = messageThreadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) ) as ContentMessage @@ -43,8 +38,7 @@ suspend inline fun TelegramBot.resend( messageThreadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = resend( chatId = chat.id, @@ -52,8 +46,7 @@ suspend inline fun TelegramBot.resend( messageThreadId = messageThreadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -68,8 +61,7 @@ suspend inline fun TelegramBot.resend( messageThreadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = resend( chatId = chatId, @@ -77,8 +69,7 @@ suspend inline fun TelegramBot.resend( messageThreadId = messageThreadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -93,8 +84,7 @@ suspend inline fun TelegramBot.resend( messageThreadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = resend( chatId = chat.id, @@ -102,7 +92,6 @@ suspend inline fun TelegramBot.resend( messageThreadId = messageThreadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt index adaf50afa8..a2c9904118 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendContact.kt @@ -18,12 +18,11 @@ suspend fun TelegramBot.sendContact( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendContact( - chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) @@ -37,12 +36,11 @@ suspend fun TelegramBot.sendContact( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendContact( - chatId, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) @@ -58,11 +56,10 @@ suspend fun TelegramBot.sendContact( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendContact( - chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -75,9 +72,8 @@ suspend fun TelegramBot.sendContact( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendContact( - chat.id, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt index e7094f1400..776d900f27 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt @@ -2,13 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.send import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.SendDice -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.dice.DiceAnimationType -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -20,11 +17,10 @@ suspend fun TelegramBot.sendDice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( - SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + SendDice(chatId, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) /** @@ -37,7 +33,6 @@ suspend fun TelegramBot.sendDice( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendDice(chat.id, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt index 674b61d276..e33ccf8f66 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt @@ -22,8 +22,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendLiveLocation( @@ -37,8 +36,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -57,8 +55,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chatId, @@ -71,8 +68,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -91,8 +87,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chat.id, @@ -105,8 +100,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -124,8 +118,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chat.id, @@ -138,8 +131,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -158,10 +150,9 @@ suspend fun TelegramBot.sendLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -177,10 +168,9 @@ suspend fun TelegramBot.sendLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -197,10 +187,9 @@ suspend fun TelegramBot.sendLiveLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -216,7 +205,6 @@ suspend fun TelegramBot.sendLiveLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt index 2c7ee237fc..36e366a727 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendMessage.kt @@ -23,8 +23,7 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendTextMessage( @@ -35,8 +34,7 @@ suspend fun TelegramBot.sendMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -53,11 +51,10 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendMessage( - chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -72,10 +69,9 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -90,10 +86,9 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chat.id, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -106,11 +101,10 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( - SendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + SendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) /** @@ -124,11 +118,10 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -142,11 +135,10 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -159,11 +151,10 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendMessage( - chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -177,11 +168,10 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -195,11 +185,10 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -212,10 +201,9 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] @@ -228,11 +216,10 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -246,11 +233,10 @@ suspend fun TelegramBot.sendMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -264,10 +250,9 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat.id, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] @@ -280,11 +265,10 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -298,8 +282,7 @@ suspend fun TelegramBot.sendTextMessage( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt index d201c7cb42..11d7c50503 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt @@ -2,13 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.send import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.SendStaticLocation -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.location.Location -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -21,8 +18,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendStaticLocation( @@ -32,8 +28,7 @@ suspend fun TelegramBot.sendLocation( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - allowSendingWithoutReply = allowSendingWithoutReply, - replyToMessageId = replyToMessageId, + replyParameters = replyParameters, replyMarkup = replyMarkup ) ) @@ -48,8 +43,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chatId, @@ -58,8 +52,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - allowSendingWithoutReply, - replyToMessageId, + replyParameters, replyMarkup ) @@ -74,8 +67,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chat.id, @@ -84,8 +76,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - allowSendingWithoutReply, - replyToMessageId, + replyParameters, replyMarkup ) @@ -99,8 +90,7 @@ suspend fun TelegramBot.sendLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLocation( chat.id, @@ -109,8 +99,7 @@ suspend fun TelegramBot.sendLocation( threadId, disableNotification, protectContent, - allowSendingWithoutReply, - replyToMessageId, + replyParameters, replyMarkup ) @@ -125,10 +114,9 @@ suspend fun TelegramBot.sendStaticLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -140,10 +128,9 @@ suspend fun TelegramBot.sendStaticLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -156,10 +143,9 @@ suspend fun TelegramBot.sendStaticLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -171,7 +157,6 @@ suspend fun TelegramBot.sendStaticLocation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt index 1025ac993f..a33ce202a9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt @@ -25,8 +25,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVenue( @@ -42,8 +41,7 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) ) @@ -65,8 +63,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVenue( chatId = chat.id, @@ -81,8 +78,7 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -102,8 +98,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVenue( chatId = chatId, @@ -118,8 +113,7 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -139,8 +133,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVenue( chatId = chat.id, @@ -155,8 +148,7 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -170,8 +162,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVenue( @@ -180,8 +171,7 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) ) @@ -196,8 +186,7 @@ suspend fun TelegramBot.sendVenue( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVenue( chatId = chat.id, @@ -205,7 +194,6 @@ suspend fun TelegramBot.sendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt index 283367d9e3..f71cf0f761 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Sends.kt @@ -63,10 +63,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chatId, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chatId, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request @@ -85,10 +84,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request @@ -106,10 +104,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chatId, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chatId, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAnimation] request @@ -127,10 +124,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAudio] request @@ -146,10 +142,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chatId, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAudio] request @@ -165,10 +160,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAudio] request @@ -183,10 +177,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio, entities, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chatId, audio, entities, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendAudio] request @@ -201,10 +194,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat, audio, entities, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat, audio, entities, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendContact] request @@ -219,10 +211,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendContact(chatId, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendContact] request @@ -235,10 +226,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chatId, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendContact(chatId, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendContact] request @@ -253,10 +243,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chat, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendContact(chat, phoneNumber, firstName, lastName, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendContact] request @@ -269,10 +258,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendContact(chat, contact, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendContact(chat, contact, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendDice] request @@ -285,10 +273,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chatId, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendDice(chatId, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendDice] request @@ -301,10 +288,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendDice(chat, animationType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendDice(chat, animationType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendDocument] request @@ -319,11 +305,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chatId, document, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chatId, document, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request @@ -338,11 +323,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat, document, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat, document, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request @@ -356,11 +340,10 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chatId, document, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chatId, document, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendDocument] request @@ -374,11 +357,10 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat, document, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat, document, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * Will execute [sendGame] request @@ -391,10 +373,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame(chatId, game, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendGame(chatId, game, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendGame] request @@ -407,10 +388,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendGame(chat, game, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendGame(chat, game, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendInvoice] request @@ -439,10 +419,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendInvoice] request @@ -470,10 +449,9 @@ suspend fun TelegramBot.send( priceDependOnShipAddress: Boolean = false, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendInvoice(user, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request @@ -487,10 +465,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendStaticLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request @@ -503,10 +480,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chatId, location, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendStaticLocation(chatId, location, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request @@ -520,10 +496,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chat, latitude, longitude, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendStaticLocation(chat, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendStaticLocation] request @@ -536,10 +511,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendStaticLocation(chat, location, threadId, disableNotification, protectContent, allowSendingWithoutReply, replyToMessageId, replyMarkup) +) = sendStaticLocation(chat, location, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request @@ -554,10 +528,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chatId, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request @@ -572,10 +545,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat, text, parseMode, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendTextMessage] request @@ -589,10 +561,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chatId, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] @@ -605,11 +576,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -623,11 +593,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = send(chatId, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -642,10 +611,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendTextMessage(chat, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendTextMessage(chat, entities, linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] @@ -658,11 +626,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -676,11 +643,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, builderBody: EntitiesBuilderBody -) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = send(chat, buildEntities(separator, builderBody), linkPreviewOptions, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -696,10 +662,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -715,10 +680,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -734,10 +698,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -753,10 +716,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -771,10 +733,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -789,10 +750,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photo, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -807,10 +767,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendPhoto] request @@ -825,10 +784,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request @@ -846,10 +804,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request @@ -868,10 +825,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(chatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request @@ -889,10 +845,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendRegularPoll] request @@ -911,10 +866,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -934,10 +888,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -957,10 +910,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -981,11 +933,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -1007,10 +958,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -1029,10 +979,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -1051,10 +1000,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -1074,10 +1022,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendQuizPoll] request @@ -1097,10 +1044,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendSticker] request @@ -1114,10 +1060,9 @@ suspend fun TelegramBot.send( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendSticker] request @@ -1131,10 +1076,9 @@ suspend fun TelegramBot.send( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(chat, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -1153,8 +1097,7 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLiveLocation( chatId = chatId, @@ -1167,8 +1110,7 @@ suspend fun TelegramBot.send( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -1187,11 +1129,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLiveLocation( - chatId, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -1210,11 +1151,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLiveLocation( - chat, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -1232,11 +1172,10 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendLiveLocation( - chat, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -1257,10 +1196,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chatId, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVenue] request @@ -1280,10 +1218,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chat, latitude, longitude, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVenue] request @@ -1302,10 +1239,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chatId, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVenue] request @@ -1324,10 +1260,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chat, location, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVenue] request @@ -1340,10 +1275,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chatId, venue, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chatId, venue, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVenue] request @@ -1356,10 +1290,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVenue(chat, venue, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVenue(chat, venue, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideo] request @@ -1375,10 +1308,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chatId, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideo] request @@ -1394,10 +1326,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideo] request @@ -1412,10 +1343,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chatId, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideo] request @@ -1430,10 +1360,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat, video, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideoNote] request @@ -1446,10 +1375,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chatId, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(chatId, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVideoNote] request @@ -1462,10 +1390,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(chat, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVoice] request @@ -1480,10 +1407,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chatId, voice, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chatId, voice, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVoice] request @@ -1498,10 +1424,9 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat, voice, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat, voice, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVoice] request @@ -1515,10 +1440,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chatId, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chatId, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * Will execute [sendVoice] request @@ -1532,10 +1456,9 @@ suspend inline fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @see SendMediaGroup @@ -1548,9 +1471,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendMediaGroup @@ -1563,9 +1485,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendMediaGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendMediaGroup @@ -1578,9 +1499,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendMediaGroup @@ -1593,9 +1513,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendMediaGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendMediaGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendPlaylist @@ -1607,9 +1526,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendPlaylist(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendPlaylist(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendPlaylist @@ -1621,9 +1539,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendPlaylist(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendPlaylist(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendPlaylist @@ -1635,9 +1552,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendPlaylist(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendPlaylist(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendPlaylist @@ -1649,9 +1565,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendPlaylist(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendPlaylist(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendDocumentsGroup @@ -1663,9 +1578,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendDocumentsGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendDocumentsGroup @@ -1677,9 +1591,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendDocumentsGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendDocumentsGroup @@ -1691,9 +1604,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendDocumentsGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendDocumentsGroup @@ -1705,9 +1617,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendDocumentsGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendDocumentsGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendVisualMediaGroup @@ -1719,9 +1630,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendVisualMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendVisualMediaGroup @@ -1733,9 +1643,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendVisualMediaGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendVisualMediaGroup @@ -1747,9 +1656,8 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendVisualMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters) /** * @see SendVisualMediaGroup @@ -1761,6 +1669,5 @@ suspend fun TelegramBot.send( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null -) = sendVisualMediaGroup(chat, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) + replyParameters: ReplyParameters? = null +) = sendVisualMediaGroup(chat, media, threadId, disableNotification, protectContent, replyParameters) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt index 10e26f0527..71f0f495ba 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt @@ -2,13 +2,10 @@ package dev.inmo.tgbotapi.extensions.api.send.games import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.games.SendGame -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.games.Game -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -20,12 +17,11 @@ suspend fun TelegramBot.sendGame( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendGame( - chatId, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) @@ -39,11 +35,10 @@ suspend fun TelegramBot.sendGame( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendGame( - chat.id, gameShortName, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, gameShortName, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -56,11 +51,10 @@ suspend fun TelegramBot.sendGame( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendGame( - chatId, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -73,9 +67,8 @@ suspend fun TelegramBot.sendGame( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendGame( - chat.id, game.title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, game.title, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt index 22817f4192..fbb0a719fd 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendAnimation -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.AnimationFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -30,8 +27,7 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendAnimation( @@ -47,8 +43,7 @@ suspend fun TelegramBot.sendAnimation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -69,11 +64,10 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendAnimation( - chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -93,10 +87,9 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -114,10 +107,9 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -136,8 +128,7 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendAnimation( @@ -152,8 +143,7 @@ suspend fun TelegramBot.sendAnimation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -173,11 +163,10 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendAnimation( - chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -196,10 +185,9 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -216,7 +204,6 @@ suspend fun TelegramBot.sendAnimation( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt index 355a26fa85..1266c22f98 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendAudio -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.AudioFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -29,8 +26,7 @@ suspend fun TelegramBot.sendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendAudio( @@ -45,8 +41,7 @@ suspend fun TelegramBot.sendAudio( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -67,10 +62,9 @@ suspend fun TelegramBot.sendAudio( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -85,10 +79,9 @@ suspend fun TelegramBot.sendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -103,10 +96,9 @@ suspend fun TelegramBot.sendAudio( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat.id, audio, text, parseMode, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -124,8 +116,7 @@ suspend inline fun TelegramBot.sendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendAudio( @@ -139,8 +130,7 @@ suspend inline fun TelegramBot.sendAudio( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -160,10 +150,9 @@ suspend inline fun TelegramBot.sendAudio( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -177,10 +166,9 @@ suspend inline fun TelegramBot.sendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -194,7 +182,6 @@ suspend inline fun TelegramBot.sendAudio( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendAudio(chat.id, audio, entities, title, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt index 787e5fc7f6..8fda288589 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendDocument -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.DocumentFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -26,8 +23,7 @@ suspend fun TelegramBot.sendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ) = execute( @@ -40,8 +36,7 @@ suspend fun TelegramBot.sendDocument( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup, disableContentTypeDetection ) @@ -60,11 +55,10 @@ suspend fun TelegramBot.sendDocument( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat.id, document, thumb, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -78,12 +72,11 @@ suspend fun TelegramBot.sendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ) = sendDocument( - chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection + chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection ) /** @@ -98,11 +91,10 @@ suspend fun TelegramBot.sendDocument( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat.id, document, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -116,8 +108,7 @@ suspend inline fun TelegramBot.sendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ) = execute( @@ -129,8 +120,7 @@ suspend inline fun TelegramBot.sendDocument( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup, disableContentTypeDetection ) @@ -148,11 +138,10 @@ suspend inline fun TelegramBot.sendDocument( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat.id, document, thumb, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -165,12 +154,11 @@ suspend inline fun TelegramBot.sendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ) = sendDocument( - chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection + chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection ) /** @@ -184,8 +172,7 @@ suspend inline fun TelegramBot.sendDocument( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null -) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) +) = sendDocument(chat.id, document, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup, disableContentTypeDetection) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt index 5b24700c0c..69edd1a91d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt @@ -2,16 +2,13 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.media.* -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.* -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.AudioContent import dev.inmo.tgbotapi.types.message.content.DocumentContent -import dev.inmo.tgbotapi.types.threadId import dev.inmo.tgbotapi.utils.RiskFeature import kotlin.jvm.JvmName @@ -25,11 +22,10 @@ suspend fun TelegramBot.sendMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = execute( SendMediaGroup( - chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media, threadId, disableNotification, protectContent, replyParameters ) ) @@ -43,10 +39,9 @@ suspend fun TelegramBot.sendMediaGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendMediaGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -60,10 +55,9 @@ suspend fun TelegramBot.sendMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendMediaGroup( - chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters ) /** @@ -77,10 +71,9 @@ suspend fun TelegramBot.sendMediaGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendMediaGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -92,11 +85,10 @@ suspend fun TelegramBot.sendPlaylist( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = execute( SendPlaylist( - chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media, threadId, disableNotification, protectContent, replyParameters ) ) @@ -109,10 +101,9 @@ suspend fun TelegramBot.sendPlaylist( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendPlaylist( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -125,10 +116,9 @@ suspend fun TelegramBot.sendPlaylist( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendPlaylist( - chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters ) /** @@ -141,10 +131,9 @@ suspend fun TelegramBot.sendPlaylist( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendPlaylist( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -156,11 +145,10 @@ suspend fun TelegramBot.sendDocumentsGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = execute( SendDocumentsGroup( - chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media, threadId, disableNotification, protectContent, replyParameters ) ) @@ -173,10 +161,9 @@ suspend fun TelegramBot.sendDocumentsGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendDocumentsGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -189,10 +176,9 @@ suspend fun TelegramBot.sendDocumentsGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendDocumentsGroup( - chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters ) /** @@ -205,10 +191,9 @@ suspend fun TelegramBot.sendDocumentsGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendDocumentsGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -220,11 +205,10 @@ suspend fun TelegramBot.sendVisualMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = execute( SendVisualMediaGroup( - chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media, threadId, disableNotification, protectContent, replyParameters ) ) @@ -237,10 +221,9 @@ suspend fun TelegramBot.sendVisualMediaGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendVisualMediaGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) /** @@ -253,10 +236,9 @@ suspend fun TelegramBot.sendVisualMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendVisualMediaGroup( - chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, disableNotification, protectContent, replyParameters ) /** @@ -269,8 +251,7 @@ suspend fun TelegramBot.sendVisualMediaGroup( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null + replyParameters: ReplyParameters? = null ) = sendVisualMediaGroup( - chat.id, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply + chat.id, media, threadId, disableNotification, protectContent, replyParameters ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt index 3626bb8f66..4141311d02 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendPhoto -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.* -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -26,8 +23,7 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendPhoto( @@ -39,8 +35,7 @@ suspend fun TelegramBot.sendPhoto( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -58,10 +53,9 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -76,10 +70,9 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -94,10 +87,9 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, photo, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -112,10 +104,9 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photoSize.fileId, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -130,10 +121,9 @@ suspend fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, photoSize, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -148,8 +138,7 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendPhoto( @@ -160,8 +149,7 @@ suspend inline fun TelegramBot.sendPhoto( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -178,10 +166,9 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -195,10 +182,9 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photo.biggest() ?.fileId ?: error("Photo content must not be empty"), entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -212,10 +198,9 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, photo, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -229,10 +214,9 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chatId, photoSize.fileId, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -246,7 +230,6 @@ suspend inline fun TelegramBot.sendPhoto( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendPhoto(chat.id, photoSize, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt index 26ee351e09..493fdd9b36 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt @@ -3,13 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendSticker -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.Sticker -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -22,11 +19,10 @@ suspend fun TelegramBot.sendSticker( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( - SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + SendSticker(chatId, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) ) /** @@ -40,10 +36,9 @@ suspend fun TelegramBot.sendSticker( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(chat.id, sticker, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -56,10 +51,9 @@ suspend fun TelegramBot.sendSticker( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(chatId, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -72,7 +66,6 @@ suspend fun TelegramBot.sendSticker( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendSticker(chat, sticker.fileId, threadId, emoji, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt index c9ad764b91..2f3a55ee08 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendVideo -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VideoFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -30,8 +27,7 @@ suspend fun TelegramBot.sendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVideo( @@ -48,8 +44,7 @@ suspend fun TelegramBot.sendVideo( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -67,10 +62,9 @@ suspend fun TelegramBot.sendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -89,10 +83,9 @@ suspend fun TelegramBot.sendVideo( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat.id, video, thumb, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -108,10 +101,9 @@ suspend fun TelegramBot.sendVideo( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat.id, video, text, parseMode, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -129,8 +121,7 @@ suspend inline fun TelegramBot.sendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVideo( @@ -146,8 +137,7 @@ suspend inline fun TelegramBot.sendVideo( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -164,10 +154,9 @@ suspend inline fun TelegramBot.sendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -185,10 +174,9 @@ suspend inline fun TelegramBot.sendVideo( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat.id, video, thumb, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -203,7 +191,6 @@ suspend inline fun TelegramBot.sendVideo( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideo(chat.id, video, entities, spoilered, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt index d4c0cc11a6..51228a9949 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt @@ -3,13 +3,10 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendVideoNote -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VideoNoteFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -24,8 +21,7 @@ suspend fun TelegramBot.sendVideoNote( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVideoNote( @@ -37,8 +33,7 @@ suspend fun TelegramBot.sendVideoNote( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -53,11 +48,10 @@ suspend fun TelegramBot.sendVideoNote( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVideoNote( - chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -73,10 +67,9 @@ suspend fun TelegramBot.sendVideoNote( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(chat.id, videoNote, thumb, duration, size, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -88,7 +81,6 @@ suspend fun TelegramBot.sendVideoNote( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVideoNote(chat.id, videoNote, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt index 3be4a2435f..44bc626484 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendVoice -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.files.VoiceFile -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -26,8 +23,7 @@ suspend fun TelegramBot.sendVoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVoice( @@ -39,8 +35,7 @@ suspend fun TelegramBot.sendVoice( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -58,10 +53,9 @@ suspend fun TelegramBot.sendVoice( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -75,11 +69,10 @@ suspend fun TelegramBot.sendVoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVoice( - chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, voice.fileId, text, parseMode, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -94,10 +87,9 @@ suspend fun TelegramBot.sendVoice( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat.id, voice, text, parseMode, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** @@ -112,8 +104,7 @@ suspend inline fun TelegramBot.sendVoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendVoice( @@ -124,8 +115,7 @@ suspend inline fun TelegramBot.sendVoice( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) ) @@ -142,10 +132,9 @@ suspend inline fun TelegramBot.sendVoice( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, entities, duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat.id, voice, entities, duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -158,11 +147,10 @@ suspend inline fun TelegramBot.sendVoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendVoice( - chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, voice.fileId, entities, voice.duration, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -175,7 +163,6 @@ suspend inline fun TelegramBot.sendVoice( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendVoice(chat.id, voice, entities, threadId, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt index 6fa583d15a..eb1f7ff458 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt @@ -34,11 +34,10 @@ suspend fun TelegramBot.sendInvoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null ) = execute( - SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + SendInvoice(chatId, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, replyParameters, replyMarkup) ) /** @@ -66,7 +65,6 @@ suspend fun TelegramBot.sendInvoice( priceDependOnShipAddress: Boolean = false, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: InlineKeyboardMarkup? = null -) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, null, disableNotification, protectContent, replyParameters, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt index e297e56394..b008e76d00 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt @@ -3,15 +3,12 @@ package dev.inmo.tgbotapi.extensions.api.send.polls import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.polls.SendQuizPoll import dev.inmo.tgbotapi.requests.send.polls.SendRegularPoll -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.polls.* -import dev.inmo.tgbotapi.types.threadId /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -28,12 +25,11 @@ suspend fun TelegramBot.sendRegularPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendRegularPoll( - chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) /** @@ -52,10 +48,9 @@ suspend fun TelegramBot.sendRegularPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = sendRegularPoll(chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup) /** * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or @@ -72,11 +67,10 @@ suspend fun TelegramBot.sendRegularPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendRegularPoll( - chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -95,11 +89,10 @@ suspend fun TelegramBot.sendRegularPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendRegularPoll( - chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) @@ -120,12 +113,11 @@ suspend fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendQuizPoll( - chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) @@ -146,11 +138,10 @@ suspend fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -171,11 +162,10 @@ suspend fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -196,11 +186,10 @@ suspend fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) @@ -220,12 +209,11 @@ suspend inline fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = execute( SendQuizPoll( - chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) ) @@ -245,11 +233,10 @@ suspend inline fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -269,11 +256,10 @@ suspend inline fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) /** @@ -293,9 +279,8 @@ suspend inline fun TelegramBot.sendQuizPoll( threadId: MessageThreadId? = chat.id.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = sendQuizPoll( - chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, disableNotification, protectContent, replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMessageId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMessageId.kt deleted file mode 100644 index 6a076122e1..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMessageId.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dev.inmo.tgbotapi.abstracts.types - -import dev.inmo.tgbotapi.types.MessageId - -interface ReplyMessageId { - val replyToMessageId: MessageId? - val allowSendingWithoutReply: Boolean? -} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyParameters.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyParameters.kt new file mode 100644 index 0000000000..a51b6e54db --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyParameters.kt @@ -0,0 +1,19 @@ +package dev.inmo.tgbotapi.abstracts.types + +import dev.inmo.tgbotapi.types.MessageId +import dev.inmo.tgbotapi.types.ReplyParameters + +@Deprecated("Renamed", ReplaceWith("WithReplyParameters", "dev.inmo.tgbotapi.abstracts.types.WithReplyParameters")) +interface ReplyMessageId { + val replyToMessageId: MessageId? + val allowSendingWithoutReply: Boolean? +} + +interface WithReplyParameters : ReplyMessageId { + val replyParameters: ReplyParameters? + + override val replyToMessageId: MessageId? + get() = replyParameters ?.messageId + override val allowSendingWithoutReply: Boolean? + get() = replyParameters ?.allowSendingWithoutReply +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt index 710d152811..c1a97db0d5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt @@ -30,8 +30,7 @@ fun CopyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = CopyMessage( toChatId, @@ -43,8 +42,7 @@ fun CopyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -56,8 +54,7 @@ fun CopyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = CopyMessage( toChatId, @@ -69,8 +66,7 @@ fun CopyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -83,8 +79,7 @@ fun CopyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = CopyMessage( toChatId, @@ -96,8 +91,7 @@ fun CopyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -109,8 +103,7 @@ fun CopyMessage( threadId: MessageThreadId? = toChatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = CopyMessage( toChatId, @@ -122,8 +115,7 @@ fun CopyMessage( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -147,10 +139,8 @@ data class CopyMessage internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ): SimpleRequest, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendContact.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendContact.kt index 2d10e109df..f3ab14ef43 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendContact.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendContact.kt @@ -28,10 +28,8 @@ data class SendContact( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, @@ -43,8 +41,7 @@ data class SendContact( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): this( chatId, @@ -54,8 +51,7 @@ data class SendContact( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -71,8 +67,7 @@ fun Contact.toRequest( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): SendContact = SendContact( chatId, @@ -80,7 +75,6 @@ fun Contact.toRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendDice.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendDice.kt index 5225d3a5fe..629f29a445 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendDice.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendDice.kt @@ -1,7 +1,7 @@ package dev.inmo.tgbotapi.requests.send import dev.inmo.tgbotapi.abstracts.types.DisableNotification -import dev.inmo.tgbotapi.abstracts.types.ReplyMessageId +import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup @@ -26,13 +26,11 @@ data class SendDice( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null -) : ReplyingMarkupSendMessageRequest>, ReplyMessageId, DisableNotification { +) : ReplyingMarkupSendMessageRequest>, WithReplyParameters, DisableNotification { override val requestSerializer: SerializationStrategy<*> get() = serializer() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendLocation.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendLocation.kt index 43d3cafa00..4aa76820fe 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendLocation.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendLocation.kt @@ -21,8 +21,7 @@ fun SendLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendLocation( chatId, @@ -35,8 +34,7 @@ fun SendLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -47,10 +45,9 @@ fun SendStaticLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null -) = SendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) +) = SendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup) fun SendLiveLocation( chatId: ChatIdentifier, @@ -63,8 +60,7 @@ fun SendLiveLocation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendLocation( chatId, @@ -77,8 +73,7 @@ fun SendLiveLocation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -104,10 +99,8 @@ data class SendLocation internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendMessage.kt index 8cbc0e1d24..23711b9c3d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendMessage.kt @@ -28,8 +28,7 @@ fun SendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendTextMessage( chatId, @@ -40,8 +39,7 @@ fun SendTextMessage( linkPreviewOptions, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -52,8 +50,7 @@ fun SendTextMessage( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendTextMessage( chatId, @@ -64,8 +61,7 @@ fun SendTextMessage( linkPreviewOptions, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -87,10 +83,8 @@ data class SendTextMessage internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendVenue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendVenue.kt index 2a4d0af6ca..4812627536 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendVenue.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendVenue.kt @@ -38,10 +38,8 @@ data class SendVenue( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, @@ -55,8 +53,7 @@ data class SendVenue( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): this( chatId = chatId, @@ -71,8 +68,7 @@ data class SendVenue( threadId = threadId, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -88,8 +84,7 @@ fun Venue.toRequest( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): SendVenue = SendVenue( chatId, @@ -97,7 +92,6 @@ fun Venue.toRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/SendMessageRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/SendMessageRequest.kt index b3dbca83a2..e52810b8d4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/SendMessageRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/SendMessageRequest.kt @@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.requests.send.abstracts import dev.inmo.tgbotapi.abstracts.types.* interface SendMessageRequest : SendChatMessageRequest, - ReplyMessageId, + WithReplyParameters, DisableNotification, ProtectContent, OptionallyMessageThreadRequest diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt index 43769a00a3..e00b08885d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt @@ -24,10 +24,8 @@ data class SendGame ( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt index d1a51fed56..1a4d4816a1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAnimation.kt @@ -33,8 +33,7 @@ fun SendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val animationAsFile = animation as? MultipartFile @@ -54,8 +53,7 @@ fun SendAnimation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -81,8 +79,7 @@ fun SendAnimation( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val animationAsFile = animation as? MultipartFile @@ -102,8 +99,7 @@ fun SendAnimation( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -148,10 +144,8 @@ data class SendAnimationData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt index b2399f9fed..2c85f6199a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendAudio.kt @@ -33,8 +33,7 @@ fun SendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val audioAsFile = audio as? MultipartFile @@ -53,8 +52,7 @@ fun SendAudio( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -79,8 +77,7 @@ fun SendAudio( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val audioAsFile = audio as? MultipartFile @@ -99,8 +96,7 @@ fun SendAudio( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -143,10 +139,8 @@ data class SendAudioData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt index 98bc374dac..b9b33cbbb4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendDocument.kt @@ -38,8 +38,7 @@ fun SendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ): Request> { @@ -56,8 +55,7 @@ fun SendDocument( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup, disableContentTypeDetection ) @@ -89,8 +87,7 @@ fun SendDocument( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ): Request> { @@ -107,8 +104,7 @@ fun SendDocument( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup, disableContentTypeDetection ) @@ -155,10 +151,8 @@ data class SendDocumentData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null, @SerialName(disableContentTypeDetectionField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendMediaGroup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendMediaGroup.kt index ff2ace3d9e..0304856ba7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendMediaGroup.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendMediaGroup.kt @@ -22,10 +22,7 @@ import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.json.JsonArray -import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.buildJsonArray -import kotlinx.serialization.json.jsonPrimitive const val rawSendingMediaGroupsWarning = "Media groups contains restrictions related to combinations of media" + " types. Currently it is possible to combine photo + video OR audio OR documents" @@ -37,7 +34,7 @@ fun SendMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, allowSendingWithoutReply: Boolean? = null ): Request>> { if (media.size !in mediaCountInMediaGroup) { @@ -61,8 +58,7 @@ fun SendMediaGroup( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply + replyParameters ) return (if (files.isEmpty()) { @@ -87,9 +83,9 @@ inline fun SendPlaylist( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, allowSendingWithoutReply: Boolean? = null -) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) +) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) /** * Use this method to be sure that you are correctly sending documents media group @@ -103,9 +99,9 @@ inline fun SendDocumentsGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, allowSendingWithoutReply: Boolean? = null -) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) +) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) /** * Use this method to be sure that you are correctly sending visual media group @@ -120,9 +116,9 @@ inline fun SendVisualMediaGroup( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, + replyParameters: ReplyParameters? = null, allowSendingWithoutReply: Boolean? = null -) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply) +) = SendMediaGroup(chatId, media, threadId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) private object MessagesListSerializer: KSerializer>> { private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass>()) @@ -150,10 +146,8 @@ data class SendMediaGroupData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, ) : DataRequest>>, SendMessageRequest>> { @SerialName(mediaField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt index d030d66cba..4c16cf55c8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendPhoto.kt @@ -28,8 +28,7 @@ fun SendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val data = SendPhotoData( @@ -42,8 +41,7 @@ fun SendPhoto( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) return if (photo is MultipartFile) { @@ -64,8 +62,7 @@ fun SendPhoto( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val data = SendPhotoData( @@ -78,8 +75,7 @@ fun SendPhoto( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -116,10 +112,8 @@ data class SendPhotoData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendSticker.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendSticker.kt index 46897671d6..bba52d5470 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendSticker.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendSticker.kt @@ -9,13 +9,7 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import dev.inmo.tgbotapi.types.message.content.StickerContent -import dev.inmo.tgbotapi.utils.mapOfNotNull -import dev.inmo.tgbotapi.utils.toJsonWithoutNulls import kotlinx.serialization.* -import kotlinx.serialization.json.JsonObject -import kotlinx.serialization.json.JsonPrimitive -import kotlinx.serialization.json.buildJsonObject -import kotlinx.serialization.json.put fun SendSticker( chatId: ChatIdentifier, @@ -24,8 +18,7 @@ fun SendSticker( emoji: String? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> = SendStickerByFileId( chatId, @@ -33,8 +26,7 @@ fun SendSticker( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ).let { when (sticker) { @@ -61,10 +53,8 @@ data class SendStickerByFileId internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, ReplyingMarkupSendMessageRequest> { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt index 815e784969..80b17f8e70 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideo.kt @@ -34,8 +34,7 @@ fun SendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val videoAsFile = video as? MultipartFile @@ -56,8 +55,7 @@ fun SendVideo( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -84,8 +82,7 @@ fun SendVideo( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val videoAsFile = video as? MultipartFile @@ -106,8 +103,7 @@ fun SendVideo( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -154,10 +150,8 @@ data class SendVideoData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideoNote.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideoNote.kt index 0c840feed0..9eb8cab82c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideoNote.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVideoNote.kt @@ -21,8 +21,7 @@ fun SendVideoNote( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val videoNoteAsFile = videoNote as? MultipartFile @@ -37,8 +36,7 @@ fun SendVideoNote( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -73,10 +71,8 @@ data class SendVideoNoteData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt index 1bad25a36a..1193f6dfb6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/media/SendVoice.kt @@ -29,8 +29,7 @@ fun SendVoice( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val voiceAsFile = voice as? MultipartFile @@ -45,8 +44,7 @@ fun SendVoice( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -68,8 +66,7 @@ fun SendVoice( duration: Long? = null, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request> { val voiceAsFile = voice as? MultipartFile @@ -84,8 +81,7 @@ fun SendVoice( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -122,10 +118,8 @@ data class SendVoiceData internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : DataRequest>, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt index 010ef191b8..c2ead144a7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt @@ -64,16 +64,14 @@ data class SendInvoice( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: InlineKeyboardMarkup? = null ) : CommonSendInvoiceData, ChatRequest, DisableNotification, - ReplyMessageId, + WithReplyParameters, WithReplyMarkup, SendMessageRequest> { override fun method(): String = "sendInvoice" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt index 1d63f7a816..5d88eaa918 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/polls/SendPoll.kt @@ -53,8 +53,7 @@ fun SendPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendRegularPoll( chatId, @@ -64,9 +63,8 @@ fun SendPoll( isClosed, threadId = threadId, protectContent = protectContent, - allowSendingWithoutReply = allowSendingWithoutReply, disableNotification = disableNotification, - replyToMessageId = replyToMessageId, + replyParameters = replyParameters, replyMarkup = replyMarkup ) @@ -79,8 +77,7 @@ fun Poll.createRequest( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = when (this) { is RegularPoll -> SendRegularPoll( @@ -94,8 +91,7 @@ fun Poll.createRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) is QuizPoll -> correctOptionId ?.let { correctOptionId -> @@ -111,8 +107,7 @@ fun Poll.createRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } ?: SendRegularPoll( @@ -126,8 +121,7 @@ fun Poll.createRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) is UnknownPollType -> SendRegularPoll( @@ -141,8 +135,7 @@ fun Poll.createRequest( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } @@ -209,10 +202,8 @@ data class SendRegularPoll( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendPoll() { @@ -237,8 +228,7 @@ fun SendRegularPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendRegularPoll( chatId, @@ -252,8 +242,7 @@ fun SendRegularPoll( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -270,8 +259,7 @@ fun SendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendQuizPoll( chatId, @@ -287,8 +275,7 @@ fun SendQuizPoll( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -304,8 +291,7 @@ fun SendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendQuizPoll( chatId, @@ -321,8 +307,7 @@ fun SendQuizPoll( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -340,8 +325,7 @@ internal fun SendQuizPoll( threadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = SendQuizPoll( chatId, @@ -358,8 +342,7 @@ internal fun SendQuizPoll( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) @@ -393,10 +376,8 @@ data class SendQuizPoll internal constructor( override val disableNotification: Boolean = false, @SerialName(protectContentField) override val protectContent: Boolean = false, - @SerialName(replyToMessageIdField) - override val replyToMessageId: MessageId? = null, - @SerialName(allowSendingWithoutReplyField) - override val allowSendingWithoutReply: Boolean? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendPoll(), TextedOutput { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 03529ac168..44b0f6df67 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -219,6 +219,7 @@ const val disableNotificationField = "disable_notification" const val protectContentField = "protect_content" const val removeCaptionField = "remove_caption" const val replyToMessageIdField = "reply_to_message_id" +const val replyParametersField = "reply_parameters" const val allowSendingWithoutReplyField = "allow_sending_without_reply" const val quoteField = "quote" const val quoteParseModeField = "quote_parse_mode" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyParameters.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyParameters.kt index fe20f54db0..db6432cf69 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyParameters.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyParameters.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.types import dev.inmo.tgbotapi.abstracts.TextedInput -import dev.inmo.tgbotapi.abstracts.TextedWithTextSources import dev.inmo.tgbotapi.abstracts.WithMessageId import dev.inmo.tgbotapi.types.message.ParseMode import dev.inmo.tgbotapi.types.message.RawMessageEntity @@ -64,6 +63,17 @@ data class ReplyParameters internal constructor( allowSendingWithoutReply, quotePosition ) + constructor( + message: Message, + entities: TextSourcesList, + allowSendingWithoutReply: Boolean = false, + quotePosition: Int? = null + ) : this( + message.metaInfo, + entities, + allowSendingWithoutReply, + quotePosition + ) constructor( chatIdentifier: ChatIdentifier, messageId: MessageId, @@ -94,6 +104,19 @@ data class ReplyParameters internal constructor( allowSendingWithoutReply, quotePosition ) + constructor( + message: Message, + quote: String, + quoteParseMode: ParseMode, + allowSendingWithoutReply: Boolean = false, + quotePosition: Int? = null + ) : this( + message.metaInfo, + quote, + quoteParseMode, + allowSendingWithoutReply, + quotePosition + ) constructor( chatIdentifier: ChatIdentifier, messageId: MessageId, @@ -118,4 +141,13 @@ data class ReplyParameters internal constructor( allowSendingWithoutReply, quotePosition ) + constructor( + message: Message, + allowSendingWithoutReply: Boolean = false, + quotePosition: Int? = null + ) : this( + message.metaInfo, + allowSendingWithoutReply, + quotePosition + ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt index 4f25de4ed1..4bf9d78a42 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt @@ -4,14 +4,11 @@ import dev.inmo.tgbotapi.abstracts.SpoilerableData import dev.inmo.tgbotapi.abstracts.TextedInput import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import dev.inmo.tgbotapi.requests.abstracts.Request -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.media.TelegramMedia import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.threadId import dev.inmo.tgbotapi.utils.RiskFeature import kotlinx.serialization.Serializable import kotlinx.serialization.modules.* @@ -152,8 +149,30 @@ sealed interface ResendableContent { messageThreadId: MessageThreadId? = chatId.threadId, disableNotification: Boolean = false, protectContent: Boolean = false, - replyToMessageId: MessageId? = null, - allowSendingWithoutReply: Boolean? = null, + replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request + + fun createResend( + chatId: ChatIdentifier, + messageThreadId: MessageThreadId? = chatId.threadId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageId?, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null + ): Request = createResend( + chatId = chatId, + messageThreadId = messageThreadId, + disableNotification = disableNotification, + protectContent = protectContent, + replyParameters = replyToMessageId ?.let { + ReplyParameters( + chatId, + replyToMessageId, + allowSendingWithoutReply = allowSendingWithoutReply == true + ) + }, + replyMarkup = replyMarkup + ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AnimationContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AnimationContent.kt index 5b77469bee..6e67ad7b62 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AnimationContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AnimationContent.kt @@ -2,12 +2,9 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendAnimation -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaAnimation import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId -import dev.inmo.tgbotapi.types.TextQuote import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.AnimationFile import dev.inmo.tgbotapi.types.files.DocumentFile @@ -28,8 +25,7 @@ data class AnimationContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendAnimation( chatId, @@ -43,8 +39,7 @@ data class AnimationContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AudioContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AudioContent.kt index 5051492406..e6c43e6ec7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AudioContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/AudioContent.kt @@ -2,13 +2,10 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendAudio -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaAudio import dev.inmo.tgbotapi.types.media.toTelegramMediaAudio import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId -import dev.inmo.tgbotapi.types.TextQuote import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.AudioFile import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -26,8 +23,7 @@ data class AudioContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendAudio( chatId, @@ -40,8 +36,7 @@ data class AudioContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ContactContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ContactContent.kt index 694b4ff5d5..3c91b28946 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ContactContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ContactContent.kt @@ -16,10 +16,9 @@ data class ContactContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendContact( - chatId, contact, messageThreadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, contact, messageThreadId, disableNotification, protectContent, replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DiceContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DiceContent.kt index fc319a695d..8b32a07c24 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DiceContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DiceContent.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.send.SendDice import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.dice.Dice import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -19,8 +20,7 @@ data class DiceContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendDice( chatId, @@ -28,8 +28,7 @@ data class DiceContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DocumentContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DocumentContent.kt index 7030286acb..ad43787c75 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DocumentContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/DocumentContent.kt @@ -3,13 +3,10 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.abstracts.TextedInput import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendDocument -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaDocument import dev.inmo.tgbotapi.types.media.toTelegramMediaDocument import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId -import dev.inmo.tgbotapi.types.TextQuote import dev.inmo.tgbotapi.types.abstracts.WithOptionalQuoteInfo import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.DocumentFile @@ -29,8 +26,7 @@ data class DocumentContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendDocument( chatId, @@ -40,8 +36,7 @@ data class DocumentContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GameContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GameContent.kt index e3b72c96a8..44a248cc32 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GameContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GameContent.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.send.games.SendGame import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -19,8 +20,7 @@ data class GameContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendGame( chatId, @@ -28,8 +28,7 @@ data class GameContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayPublicResultsContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayPublicResultsContent.kt index 29e9e0b348..ddaf9ebd9e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayPublicResultsContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayPublicResultsContent.kt @@ -17,8 +17,7 @@ data class GiveawayPublicResultsContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { return ForwardMessage( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/InvoiceContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/InvoiceContent.kt index aba78dbf89..dfe7a4e347 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/InvoiceContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/InvoiceContent.kt @@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.payments.Invoice @@ -18,8 +19,7 @@ data class InvoiceContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> { error("Unfortunately, currently InvoiceOfPayment can not be resend due to requirement of additional parameters," + diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/LocationContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/LocationContent.kt index c90ebd31c4..00e5206545 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/LocationContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/LocationContent.kt @@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -101,8 +102,7 @@ data class LiveLocationContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendLiveLocation( chatId, @@ -115,8 +115,7 @@ data class LiveLocationContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) as SendMessageRequest> } @@ -134,8 +133,7 @@ data class StaticLocationContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendStaticLocation( chatId, @@ -144,8 +142,7 @@ data class StaticLocationContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) as SendMessageRequest> } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/MediaGroupContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/MediaGroupContent.kt index d0c0f729b7..9452611ead 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/MediaGroupContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/MediaGroupContent.kt @@ -35,8 +35,7 @@ data class MediaGroupContent( threadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request>> = SendMediaGroup( chatId, @@ -44,7 +43,6 @@ data class MediaGroupContent( threadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply + replyParameters, ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PhotoContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PhotoContent.kt index bbcc0453fd..c63148c80b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PhotoContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PhotoContent.kt @@ -2,13 +2,10 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendPhoto -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaPhoto import dev.inmo.tgbotapi.types.media.toTelegramMediaPhoto import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId -import dev.inmo.tgbotapi.types.TextQuote import dev.inmo.tgbotapi.types.abstracts.WithOptionalQuoteInfo import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.* @@ -30,8 +27,7 @@ data class PhotoContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendPhoto( chatId, @@ -41,8 +37,7 @@ data class PhotoContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PollContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PollContent.kt index 7d81ddaa60..6b17f1a1f7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PollContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/PollContent.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.send.polls.createRequest import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.polls.Poll @@ -19,16 +20,14 @@ data class PollContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = poll.createRequest( chatId, messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ScheduledGiveawayContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ScheduledGiveawayContent.kt index f3b4125a44..17ce374abb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ScheduledGiveawayContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/ScheduledGiveawayContent.kt @@ -24,8 +24,7 @@ data class ScheduledGiveawayContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { return ForwardMessage( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StickerContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StickerContent.kt index 6caeaa91ce..bae183a40a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StickerContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StickerContent.kt @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.media.TelegramMediaDocument import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -20,8 +21,7 @@ data class StickerContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendSticker( chatId, @@ -30,8 +30,7 @@ data class StickerContent( media.emoji, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt index 187a155a10..13659c8796 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/StoryContent.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage @@ -22,8 +23,7 @@ data class StoryContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { return ForwardMessage( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt index 26c4fd2f14..9e1b62aaba 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt @@ -22,8 +22,7 @@ data class TextContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendTextMessage( chatId, @@ -32,8 +31,7 @@ data class TextContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VenueContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VenueContent.kt index 12fa337486..d61f49cc47 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VenueContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VenueContent.kt @@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.send.SendVenue import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.venue.Venue @@ -19,10 +20,9 @@ data class VenueContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVenue( - chatId, venue, messageThreadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup + chatId, venue, messageThreadId, disableNotification, protectContent, replyParameters, replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoContent.kt index 96ebc2b2d3..bb00fd3ef5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoContent.kt @@ -2,12 +2,9 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendVideo -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaVideo import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageId -import dev.inmo.tgbotapi.types.MessageThreadId -import dev.inmo.tgbotapi.types.TextQuote import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.VideoFile import dev.inmo.tgbotapi.types.files.toTelegramMediaVideo @@ -27,8 +24,7 @@ data class VideoContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVideo( chatId, @@ -43,8 +39,7 @@ data class VideoContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoNoteContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoNoteContent.kt index 8e47237fd0..3fdbc27282 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoNoteContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VideoNoteContent.kt @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.media.TelegramMediaVideo import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.ReplyParameters import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.VideoNoteFile import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -20,8 +21,7 @@ data class VideoNoteContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVideoNote( chatId, @@ -32,8 +32,7 @@ data class VideoNoteContent( messageThreadId, disableNotification, protectContent, - replyToMessageId, - allowSendingWithoutReply, + replyParameters, replyMarkup ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VoiceContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VoiceContent.kt index b2cc4fe154..84fd8d70e1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VoiceContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/VoiceContent.kt @@ -23,8 +23,7 @@ data class VoiceContent( messageThreadId: MessageThreadId?, disableNotification: Boolean, protectContent: Boolean, - replyToMessageId: MessageId?, - allowSendingWithoutReply: Boolean?, + replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVoice( chatId = chatId, @@ -34,8 +33,7 @@ data class VoiceContent( duration = media.duration, disableNotification = disableNotification, protectContent = protectContent, - replyToMessageId = replyToMessageId, - allowSendingWithoutReply = allowSendingWithoutReply, + replyParameters = replyParameters, replyMarkup = replyMarkup )