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 ba2bb621ad..b08f46bf05 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 @@ -1430,7 +1430,7 @@ suspend fun TelegramBot.reply( replyInThreadId, replyInBusinessConnectionId, disableNotification, - protectContent, + protectContent,, ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), replyMarkup ) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt index 89a151aca8..a5f0aee3e9 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt @@ -1499,7 +1499,7 @@ suspend fun TelegramBot.reply( replyInThreadId, replyInBusinessConnectionId, disableNotification, - protectContent, + protectContent,, ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), replyMarkup ) 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 6d002c5bb4..1d1a28f3f1 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 @@ -23,7 +23,7 @@ suspend inline fun TelegramBot.resend( chatId = chatId, messageThreadId = messageThreadId, disableNotification = disableNotification, - protectContent = protectContent, + protectContent = protectContent,, replyParameters = replyParameters, replyMarkup = replyMarkup ) 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 c72323558d..045029ed77 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 @@ -105,6 +105,7 @@ fun Poll.createRequest( businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, disableNotification: Boolean = false, protectContent: Boolean = false, + effectId: EffectId? = null, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ) = when (this) { @@ -120,6 +121,7 @@ fun Poll.createRequest( businessConnectionId, disableNotification, protectContent, + effectId = effectId, replyParameters, replyMarkup ) @@ -137,6 +139,7 @@ fun Poll.createRequest( businessConnectionId, disableNotification, protectContent, + effectId = effectId, replyParameters, replyMarkup ) @@ -152,6 +155,7 @@ fun Poll.createRequest( businessConnectionId, disableNotification, protectContent, + effectId = effectId, replyParameters, replyMarkup ) @@ -167,6 +171,7 @@ fun Poll.createRequest( businessConnectionId, disableNotification, protectContent, + effectId = effectId, replyParameters, replyMarkup ) 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 dd30759e94..0d0dc4be8a 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 @@ -153,6 +153,7 @@ sealed interface ResendableContent { businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, disableNotification: Boolean = false, protectContent: Boolean = false, + effectId: EffectId?, replyParameters: ReplyParameters? = null, replyMarkup: KeyboardMarkup? = null ): Request @@ -163,6 +164,7 @@ sealed interface ResendableContent { businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, disableNotification: Boolean = false, protectContent: Boolean = false, + effectId: EffectId?, replyToMessageId: MessageId?, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null @@ -172,6 +174,7 @@ sealed interface ResendableContent { businessConnectionId = businessConnectionId, disableNotification = disableNotification, protectContent = protectContent, + effectId = effectId, replyParameters = replyToMessageId ?.let { ReplyParameters( chatId, 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 02eb935111..5165a57643 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 @@ -28,6 +28,7 @@ data class AnimationContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendAnimation( @@ -44,6 +45,7 @@ data class AnimationContent( businessConnectionId = businessConnectionId, disableNotification = disableNotification, protectContent = protectContent, + effectId = effectId, replyParameters = replyParameters, replyMarkup = 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 c9c99f5c20..5ec6f93285 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 @@ -25,22 +25,24 @@ data class AudioContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendAudio( - chatId, - media.fileId, - media.thumbnail ?.fileId, - textSources, - media.duration, - media.performer, - media.title, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + audio = media.fileId, + thumbnail = media.thumbnail ?.fileId, + entities = textSources, + duration = media.duration, + performer = media.performer, + title = media.title, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) override fun toMediaGroupMemberTelegramMedia(): TelegramMediaAudio = asTelegramMedia() 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 a2d08beb64..3128c6eeb4 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 @@ -18,9 +18,18 @@ data class ContactContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendContact( - chatId, contact, messageThreadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup + chatId = chatId, + contact = contact, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = 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 b27f2b2496..fcf139c3c5 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 @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.dice.Dice @@ -22,16 +19,18 @@ data class DiceContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendDice( - chatId, - dice.animationType, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + animationType = dice.animationType, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = 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 9a165e8b6f..db94c0cb11 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 @@ -28,19 +28,21 @@ data class DocumentContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendDocument( - chatId, - media.fileId, - media.thumbnail ?.fileId, - textSources, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + document = media.fileId, + thumbnail = media.thumbnail ?.fileId, + entities = textSources, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) override fun toMediaGroupMemberTelegramMedia(): TelegramMediaDocument = asTelegramMedia() 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 71bbd8b5ee..e14f52b5fc 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 @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.games.Game @@ -22,16 +19,18 @@ data class GameContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendGame( - chatId, - game.title, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + gameShortName = game.title, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayContent.kt index 4ab17d2ace..a27890d0ae 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/GiveawayContent.kt @@ -22,6 +22,7 @@ data class GiveawayContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { 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 45080f4d71..7efe4cb363 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 @@ -19,6 +19,7 @@ data class GiveawayPublicResultsContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { 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 9439e77bab..07fe0eb29a 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 @@ -1,10 +1,7 @@ package dev.inmo.tgbotapi.types.message.content 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -21,6 +18,7 @@ data class InvoiceContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> { 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 f6a84f70db..bd80435486 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 @@ -4,10 +4,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.SendLiveLocation import dev.inmo.tgbotapi.requests.send.SendStaticLocation 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.location.* @@ -104,22 +101,24 @@ data class LiveLocationContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendLiveLocation( - chatId, - location.latitude, - location.longitude, - location.livePeriod, - location.horizontalAccuracy, - location.heading, - location.proximityAlertRadius, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + latitude = location.latitude, + longitude = location.longitude, + livePeriod = location.livePeriod, + horizontalAccuracy = location.horizontalAccuracy, + heading = location.heading, + proximityAlertRadius = location.proximityAlertRadius, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) as SendMessageRequest> } @@ -137,17 +136,19 @@ data class StaticLocationContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendStaticLocation( - chatId, - location.latitude, - location.longitude, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + latitude = location.latitude, + longitude = location.longitude, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = 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 3fe88866be..6d75745a59 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 @@ -37,15 +37,17 @@ data class MediaGroupContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request>> = SendMediaGroup( - chatId, - group.map { it.content.toMediaGroupMemberTelegramMedia() }, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, + chatId = chatId, + media = group.map { it.content.toMediaGroupMemberTelegramMedia() }, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = 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 f971f7fb4e..2a45078ffd 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 @@ -30,6 +30,7 @@ data class PhotoContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendPhoto( @@ -42,6 +43,7 @@ data class PhotoContent( businessConnectionId = businessConnectionId, disableNotification = disableNotification, protectContent = protectContent, + effectId = effectId, replyParameters = replyParameters, replyMarkup = 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 6606a17158..930b7a913d 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 @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -22,15 +19,17 @@ data class PollContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = poll.createRequest( - chatId, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) } 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 a9ef8924bb..9cd2217f39 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 @@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendSticker -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* 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.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.Sticker @@ -23,18 +20,19 @@ data class StickerContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendSticker( - chatId, - media.fileId, - messageThreadId, - businessConnectionId, - media.emoji, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + sticker = media.fileId, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) override fun asTelegramMedia(): TelegramMediaDocument = TelegramMediaDocument( 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 27e0bf918c..9a47fa305f 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 @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.ForwardMessage 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat @@ -25,6 +22,7 @@ data class StoryContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request { 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 bbd3236826..f742871b84 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 @@ -1,6 +1,5 @@ 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.SendTextMessage import dev.inmo.tgbotapi.types.* @@ -24,17 +23,19 @@ data class TextContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendTextMessage( - chatId, - textSources, - linkPreviewOptions, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + entities = textSources, + linkPreviewOptions = linkPreviewOptions, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = 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 cd07df6cd7..1df46d8aa6 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 @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request 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.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage @@ -22,9 +19,18 @@ data class VenueContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVenue( - chatId, venue, messageThreadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup + chatId = chatId, + venue = venue, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = 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 90b1062159..2898359086 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 @@ -27,6 +27,7 @@ data class VideoContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVideo( @@ -44,6 +45,7 @@ data class VideoContent( businessConnectionId = businessConnectionId, disableNotification = disableNotification, protectContent = protectContent, + effectId = effectId, replyParameters = replyParameters, replyMarkup = 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 8a6ddc1f48..701d9ad823 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 @@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.types.message.content import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.media.SendVideoNote -import dev.inmo.tgbotapi.types.ChatIdentifier +import dev.inmo.tgbotapi.types.* 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.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.VideoNoteFile @@ -23,20 +20,22 @@ data class VideoNoteContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVideoNote( - chatId, - media.fileId, - media.thumbnail ?.fileId, - media.duration, - media.width, - messageThreadId, - businessConnectionId, - disableNotification, - protectContent, - replyParameters, - replyMarkup + chatId = chatId, + videoNote = media.fileId, + thumbnail = media.thumbnail ?.fileId, + duration = media.duration, + size = media.width, + threadId = messageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + replyParameters = replyParameters, + replyMarkup = replyMarkup ) override fun asTelegramMedia(): TelegramMediaVideo = TelegramMediaVideo( 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 6a7f40fe27..6bc66b3311 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 @@ -5,7 +5,6 @@ import dev.inmo.tgbotapi.requests.send.media.SendVoice import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.media.TelegramMediaAudio import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.abstracts.WithOptionalQuoteInfo import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.files.VoiceFile @@ -25,6 +24,7 @@ data class VoiceContent( businessConnectionId: BusinessConnectionId?, disableNotification: Boolean, protectContent: Boolean, + effectId: EffectId?, replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> = SendVoice( @@ -36,6 +36,7 @@ data class VoiceContent( duration = media.duration, disableNotification = disableNotification, protectContent = protectContent, + effectId = effectId, replyParameters = replyParameters, replyMarkup = replyMarkup ) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt index 2b68a60cfe..02d3a74cd6 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt @@ -46,6 +46,7 @@ import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.Thumbed import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached @@ -228,6 +229,7 @@ import dev.inmo.tgbotapi.types.media.TelegramMediaVideo import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia import dev.inmo.tgbotapi.types.media.TitledTelegramMedia import dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia import dev.inmo.tgbotapi.types.message.ChannelEventMessage import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated import dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded @@ -295,6 +297,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.PossiblyOfflineMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyWithEffectMessage import dev.inmo.tgbotapi.types.message.abstracts.PotentiallyFromUserGroupContentMessage import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage @@ -336,6 +339,7 @@ import dev.inmo.tgbotapi.types.message.content.VideoContent import dev.inmo.tgbotapi.types.message.content.VideoNoteContent import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.VoiceContent +import dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource @@ -344,6 +348,7 @@ import dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource import dev.inmo.tgbotapi.types.message.textsources.CodeTextSource import dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource +import dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource import dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource @@ -1413,6 +1418,18 @@ public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQuer public inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): T? = urlInlineQueryResultOrNull() ?.let(block) +public inline fun InlineQueryResult.withCustomizableCaptionInlineQueryResultOrNull(): + WithCustomizableCaptionInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult + +public inline fun InlineQueryResult.withCustomizableCaptionInlineQueryResultOrThrow(): + WithCustomizableCaptionInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult + +public inline fun + InlineQueryResult.ifWithCustomizableCaptionInlineQueryResult(block: (WithCustomizableCaptionInlineQueryResult) -> T): + T? = withCustomizableCaptionInlineQueryResultOrNull() ?.let(block) + public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): WithInputMessageContentInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult @@ -3064,6 +3081,18 @@ public inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedi public inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? = titledTelegramMediaOrNull() ?.let(block) +public inline fun TelegramMedia.withCustomizableCaptionTelegramMediaOrNull(): + WithCustomizableCaptionTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia + +public inline fun TelegramMedia.withCustomizableCaptionTelegramMediaOrThrow(): + WithCustomizableCaptionTelegramMedia = this as + dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia + +public inline fun + TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T): + T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block) + public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as? dev.inmo.tgbotapi.types.chat.ChatBackground @@ -3842,6 +3871,15 @@ public inline fun Message.possiblyTopicMessageOrThrow(): PossiblyTopicMessage = public inline fun Message.ifPossiblyTopicMessage(block: (PossiblyTopicMessage) -> T): T? = possiblyTopicMessageOrNull() ?.let(block) +public inline fun Message.possiblyWithEffectMessageOrNull(): PossiblyWithEffectMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyWithEffectMessage + +public inline fun Message.possiblyWithEffectMessageOrThrow(): PossiblyWithEffectMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyWithEffectMessage + +public inline fun Message.ifPossiblyWithEffectMessage(block: (PossiblyWithEffectMessage) -> T): + T? = possiblyWithEffectMessageOrNull() ?.let(block) + public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage @@ -3936,6 +3974,18 @@ public inline fun ResendableContent.ifSpoilerableMediaContent(block: (SpoilerableMediaContent) -> T): T? = spoilerableMediaContentOrNull() ?.let(block) +public inline fun ResendableContent.withCustomizedCaptionMediaContentOrNull(): + WithCustomizedCaptionMediaContent? = this as? + dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent + +public inline fun ResendableContent.withCustomizedCaptionMediaContentOrThrow(): + WithCustomizedCaptionMediaContent = this as + dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent + +public inline fun + ResendableContent.ifWithCustomizedCaptionMediaContent(block: (WithCustomizedCaptionMediaContent) -> T): + T? = withCustomizedCaptionMediaContentOrNull() ?.let(block) + public inline fun ResendableContent.audioMediaGroupPartContentOrNull(): AudioMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent @@ -4269,6 +4319,16 @@ public inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as public inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? = eMailTextSourceOrNull() ?.let(block) +public inline fun TextSource.expandableBlockquoteTextSourceOrNull(): ExpandableBlockquoteTextSource? + = this as? dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource + +public inline fun TextSource.expandableBlockquoteTextSourceOrThrow(): ExpandableBlockquoteTextSource + = this as dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource + +public inline fun + TextSource.ifExpandableBlockquoteTextSource(block: (ExpandableBlockquoteTextSource) -> T): T? = + expandableBlockquoteTextSourceOrNull() ?.let(block) + public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource