1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-01-01 10:59:20 +00:00

Compare commits

...

6 Commits

61 changed files with 1484 additions and 899 deletions

View File

@@ -1,6 +1,9 @@
# TelegramBotAPI changelog # TelegramBotAPI changelog
## 13.1.0 ## 14.0.0
* `Core`:
* `TelegramPaymentChargeId` has been added as value class and replaced raw strings in `SuccessfulPayment` type of `telegramPaymentChargeId`
## 13.0.0 ## 13.0.0

View File

@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true kotlin.incremental.js=true
library_group=dev.inmo library_group=dev.inmo
library_version=13.1.0 library_version=14.0.0

View File

@@ -1430,7 +1430,7 @@ suspend fun TelegramBot.reply(
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId, replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,,
ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true), ReplyParameters(to, allowSendingWithoutReply = allowSendingWithoutReply == true),
replyMarkup replyMarkup
) )

View File

@@ -1499,7 +1499,7 @@ suspend fun TelegramBot.reply(
replyInThreadId, replyInThreadId,
replyInBusinessConnectionId, replyInBusinessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,,
ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply), ReplyParameters(toChatId, toMessageId, allowSendingWithoutReply = allowSendingWithoutReply),
replyMarkup replyMarkup
) )

View File

@@ -23,7 +23,7 @@ suspend inline fun <T : MessageContent> TelegramBot.resend(
chatId = chatId, chatId = chatId,
messageThreadId = messageThreadId, messageThreadId = messageThreadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.send.payments
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.payments.RefundStarPayment
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.payments.SuccessfulPayment
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
suspend fun TelegramBot.refundStarPayment(
userId: UserId,
telegramPaymentChargeId: TelegramPaymentChargeId
) = execute(RefundStarPayment(userId, telegramPaymentChargeId))
suspend fun TelegramBot.refundStarPayment(
userId: UserId,
successfulPayment: SuccessfulPayment
) = refundStarPayment(userId, successfulPayment.telegramPaymentChargeId)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.abstracts.types
import dev.inmo.tgbotapi.types.EffectId
interface OptionallyWithEffectId {
val effectId: EffectId?
}

View File

@@ -32,6 +32,8 @@ data class SendContact(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -46,6 +48,7 @@ data class SendContact(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -57,6 +60,7 @@ data class SendContact(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -74,15 +78,17 @@ fun Contact.toRequest(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendContact = SendContact( ): SendContact = SendContact(
chatId, chatId = chatId,
this, contact = this,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )

View File

@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.abstracts.types.DisableNotification
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters import dev.inmo.tgbotapi.abstracts.types.WithReplyParameters
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
@@ -30,11 +31,13 @@ data class SendDice(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null override val replyMarkup: KeyboardMarkup? = null
) : ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification, ) : SendContentMessageRequest<ContentMessage<DiceContent>>, ReplyingMarkupSendMessageRequest<ContentMessage<DiceContent>>, WithReplyParameters, DisableNotification,
OptionallyBusinessConnectionRequest { OptionallyBusinessConnectionRequest {
override val requestSerializer: SerializationStrategy<*> override val requestSerializer: SerializationStrategy<*>
get() = serializer() get() = serializer()

View File

@@ -23,6 +23,7 @@ fun SendLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation( ) = SendLocation(
@@ -37,6 +38,7 @@ fun SendLocation(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -49,9 +51,21 @@ fun SendStaticLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup) ) = SendLocation(
chatId = chatId,
latitude = latitude,
longitude = longitude,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
fun SendLiveLocation( fun SendLiveLocation(
chatId: ChatIdentifier, chatId: ChatIdentifier,
@@ -65,22 +79,24 @@ fun SendLiveLocation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendLocation( ) = SendLocation(
chatId, chatId = chatId,
latitude, latitude = latitude,
longitude, longitude = longitude,
livePeriod, livePeriod = livePeriod,
horizontalAccuracy, horizontalAccuracy = horizontalAccuracy,
heading, heading = heading,
proximityAlertRadius, proximityAlertRadius = proximityAlertRadius,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
@Serializable @Serializable
@@ -107,6 +123,8 @@ data class SendLocation internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -30,6 +30,7 @@ fun SendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -42,6 +43,7 @@ fun SendTextMessage(
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -54,6 +56,7 @@ fun SendTextMessage(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendTextMessage( ) = SendTextMessage(
@@ -66,6 +69,7 @@ fun SendTextMessage(
linkPreviewOptions, linkPreviewOptions,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -90,6 +94,8 @@ data class SendTextMessage internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -41,6 +41,8 @@ data class SendVenue(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -57,6 +59,7 @@ data class SendVenue(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): this( ): this(
@@ -70,8 +73,10 @@ data class SendVenue(
googlePlaceId = venue.googlePlaceId, googlePlaceId = venue.googlePlaceId,
googlePlaceType = venue.googlePlaceType, googlePlaceType = venue.googlePlaceType,
threadId = threadId, threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -89,6 +94,7 @@ fun Venue.toRequest(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): SendVenue = SendVenue( ): SendVenue = SendVenue(
@@ -98,6 +104,7 @@ fun Venue.toRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
import dev.inmo.tgbotapi.requests.abstracts.Request
interface OptionallyWithEffectRequest<T : Any> : OptionallyWithEffectId, Request<T>

View File

@@ -2,4 +2,4 @@ package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest import dev.inmo.tgbotapi.abstracts.types.OptionallyBusinessConnectionRequest
interface SendContentMessageRequest<T: Any> : SendMessageRequest<T>, OptionallyBusinessConnectionRequest interface SendContentMessageRequest<T: Any> : SendMessageRequest<T>, OptionallyBusinessConnectionRequest, OptionallyWithEffectRequest<T>

View File

@@ -28,6 +28,8 @@ data class SendGame (
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -36,6 +36,7 @@ fun SendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AnimationContent>> { ): Request<ContentMessage<AnimationContent>> {
@@ -58,6 +59,7 @@ fun SendAnimation(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -86,6 +88,7 @@ fun SendAnimation(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AnimationContent>> { ): Request<ContentMessage<AnimationContent>> {
@@ -108,6 +111,7 @@ fun SendAnimation(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -157,6 +161,8 @@ data class SendAnimationData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -35,6 +35,7 @@ fun SendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AudioContent>> { ): Request<ContentMessage<AudioContent>> {
@@ -42,21 +43,22 @@ fun SendAudio(
val thumbAsFile = thumbnail as? MultipartFile val thumbAsFile = thumbnail as? MultipartFile
val data = SendAudioData( val data = SendAudioData(
chatId, chatId = chatId,
audio, audio = audio,
thumbnail ?.fileId, thumbnail = thumbnail ?.fileId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
duration, duration = duration,
performer, performer = performer,
title, title = title,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
return if (audioAsFile == null && thumbAsFile == null) { return if (audioAsFile == null && thumbAsFile == null) {
@@ -81,6 +83,7 @@ fun SendAudio(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<AudioContent>> { ): Request<ContentMessage<AudioContent>> {
@@ -88,21 +91,22 @@ fun SendAudio(
val thumbAsFile = thumbnail as? MultipartFile val thumbAsFile = thumbnail as? MultipartFile
val data = SendAudioData( val data = SendAudioData(
chatId, chatId = chatId,
audio, audio = audio,
thumbnail ?.fileId, thumbnail = thumbnail ?.fileId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
duration, duration = duration,
performer, performer = performer,
title, title = title,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
return if (audioAsFile == null && thumbAsFile == null) { return if (audioAsFile == null && thumbAsFile == null) {
@@ -146,6 +150,8 @@ data class SendAudioData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -40,6 +40,7 @@ fun SendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -48,19 +49,20 @@ fun SendDocument(
val thumbAsFile = thumbnail as? MultipartFile val thumbAsFile = thumbnail as? MultipartFile
val data = SendDocumentData( val data = SendDocumentData(
chatId, chatId = chatId,
document, document = document,
thumbnail ?.fileId, thumbnail = thumbnail ?.fileId,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup, replyParameters = replyParameters,
disableContentTypeDetection replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection
) )
return if (documentAsFile == null && thumbAsFile == null) { return if (documentAsFile == null && thumbAsFile == null) {
@@ -91,6 +93,7 @@ fun SendDocument(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
disableContentTypeDetection: Boolean? = null disableContentTypeDetection: Boolean? = null
@@ -99,19 +102,20 @@ fun SendDocument(
val thumbAsFile = thumbnail as? MultipartFile val thumbAsFile = thumbnail as? MultipartFile
val data = SendDocumentData( val data = SendDocumentData(
chatId, chatId = chatId,
document, document = document,
thumbnail ?.fileId, thumbnail = thumbnail ?.fileId,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup, replyParameters = replyParameters,
disableContentTypeDetection replyMarkup = replyMarkup,
disableContentTypeDetection = disableContentTypeDetection
) )
return if (documentAsFile == null && thumbAsFile == null) { return if (documentAsFile == null && thumbAsFile == null) {
@@ -158,6 +162,8 @@ data class SendDocumentData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -37,8 +37,8 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null replyParameters: ReplyParameters? = null
): Request<ContentMessage<MediaGroupContent<T>>> { ): Request<ContentMessage<MediaGroupContent<T>>> {
if (media.size !in mediaCountInMediaGroup) { if (media.size !in mediaCountInMediaGroup) {
throwRangeError("Count of members in media group", mediaCountInMediaGroup, media.size) throwRangeError("Count of members in media group", mediaCountInMediaGroup, media.size)
@@ -56,13 +56,14 @@ fun <T : MediaGroupPartContent> SendMediaGroup(
} }
val data = SendMediaGroupData( val data = SendMediaGroupData(
chatId, chatId = chatId,
media, media = media,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters effectId = effectId,
replyParameters = replyParameters
) )
return (if (files.isEmpty()) { return (if (files.isEmpty()) {
@@ -88,9 +89,18 @@ inline fun SendPlaylist(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null replyParameters: ReplyParameters? = null
) = SendMediaGroup<AudioContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) ) = SendMediaGroup<AudioContent>(
chatId = chatId,
media = media,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters
)
/** /**
* Use this method to be sure that you are correctly sending documents media group * Use this method to be sure that you are correctly sending documents media group
@@ -105,9 +115,18 @@ inline fun SendDocumentsGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
replyParameters: ReplyParameters? = null, effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null replyParameters: ReplyParameters? = null
) = SendMediaGroup<DocumentContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) ) = SendMediaGroup<DocumentContent>(
chatId = chatId,
media = media,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters
)
/** /**
* Use this method to be sure that you are correctly sending visual media group * Use this method to be sure that you are correctly sending visual media group
@@ -123,9 +142,18 @@ inline fun SendVisualMediaGroup(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
allowSendingWithoutReply: Boolean? = null ) = SendMediaGroup<VisualMediaGroupPartContent>(
) = SendMediaGroup<VisualMediaGroupPartContent>(chatId, media, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, allowSendingWithoutReply) chatId = chatId,
media = media,
threadId = threadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters
)
private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> { private object MessagesListSerializer: KSerializer<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>> {
private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>()) private val serializer = ListSerializer(TelegramBotAPIMessageDeserializeOnlySerializerClass<PossiblySentViaBotCommonMessage<MediaGroupPartContent>>())
@@ -155,6 +183,8 @@ data class SendMediaGroupData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>, ) : DataRequest<PossiblySentViaBotCommonMessage<MediaGroupContent<MediaGroupPartContent>>>,

View File

@@ -31,6 +31,7 @@ fun SendPhoto(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PhotoContent>> { ): Request<ContentMessage<PhotoContent>> {
@@ -46,6 +47,7 @@ fun SendPhoto(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -69,6 +71,7 @@ fun SendPhoto(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<PhotoContent>> { ): Request<ContentMessage<PhotoContent>> {
@@ -84,6 +87,7 @@ fun SendPhoto(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -125,6 +129,8 @@ data class SendPhotoData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -18,20 +18,21 @@ fun SendSticker(
sticker: InputFile, sticker: InputFile,
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
emoji: String? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<StickerContent>> = SendStickerByFileId( ): Request<ContentMessage<StickerContent>> = SendStickerByFileId(
chatId, chatId = chatId,
sticker, sticker = sticker,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
).let { ).let {
when (sticker) { when (sticker) {
is MultipartFile -> CommonMultipartFileRequest( is MultipartFile -> CommonMultipartFileRequest(
@@ -59,6 +60,8 @@ data class SendStickerByFileId internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -37,6 +37,7 @@ fun SendVideo(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoContent>> { ): Request<ContentMessage<VideoContent>> {
@@ -60,6 +61,7 @@ fun SendVideo(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -89,6 +91,7 @@ fun SendVideo(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoContent>> { ): Request<ContentMessage<VideoContent>> {
@@ -112,6 +115,7 @@ fun SendVideo(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -163,6 +167,8 @@ data class SendVideoData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -23,6 +23,7 @@ fun SendVideoNote(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VideoNoteContent>> { ): Request<ContentMessage<VideoNoteContent>> {
@@ -30,17 +31,18 @@ fun SendVideoNote(
val thumbAsFile = thumbnail as? MultipartFile val thumbAsFile = thumbnail as? MultipartFile
val data = SendVideoNoteData( val data = SendVideoNoteData(
chatId, chatId = chatId,
videoNote, videoNote = videoNote,
thumbnail ?.fileId, thumbnail = thumbnail ?.fileId,
duration, duration = duration,
size, width = size,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
return if (videoNoteAsFile == null && thumbAsFile == null) { return if (videoNoteAsFile == null && thumbAsFile == null) {
@@ -76,6 +78,8 @@ data class SendVideoNoteData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -31,24 +31,26 @@ fun SendVoice(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VoiceContent>> { ): Request<ContentMessage<VoiceContent>> {
val voiceAsFile = voice as? MultipartFile val voiceAsFile = voice as? MultipartFile
val data = SendVoiceData( val data = SendVoiceData(
chatId, chatId = chatId,
voice, voice = voice,
text, text = text,
parseMode, parseMode = parseMode,
null, rawEntities = null,
duration, duration = duration,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
return if (voiceAsFile == null) { return if (voiceAsFile == null) {
@@ -70,24 +72,26 @@ fun SendVoice(
duration: Long? = null, duration: Long? = null,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<VoiceContent>> { ): Request<ContentMessage<VoiceContent>> {
val voiceAsFile = voice as? MultipartFile val voiceAsFile = voice as? MultipartFile
val data = SendVoiceData( val data = SendVoiceData(
chatId, chatId = chatId,
voice, voice = voice,
entities.makeString(), text = entities.makeString(),
null, parseMode = null,
entities.toRawMessageEntities(), rawEntities = entities.toRawMessageEntities(),
duration, duration = duration,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
return if (voiceAsFile == null) { return if (voiceAsFile == null) {
@@ -125,6 +129,8 @@ data class SendVoiceData internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)

View File

@@ -0,0 +1,21 @@
package dev.inmo.tgbotapi.requests.send.payments
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.payments.abstracts.TelegramPaymentChargeId
import kotlinx.serialization.*
import kotlinx.serialization.builtins.serializer
@Serializable
data class RefundStarPayment(
@SerialName(userIdField)
val userId: UserId,
@SerialName(telegramPaymentChargeIdField)
val telegramPaymentChargeId: TelegramPaymentChargeId
) : SimpleRequest<Boolean> {
override fun method(): String = "refundStarPayment"
override val resultDeserializer: DeserializationStrategy<Boolean>
get() = Boolean.serializer()
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}

View File

@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.send.payments
import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
import dev.inmo.tgbotapi.abstracts.types.* import dev.inmo.tgbotapi.abstracts.types.*
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyWithEffectRequest
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
@@ -66,6 +67,8 @@ data class SendInvoice(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -75,7 +78,8 @@ data class SendInvoice(
DisableNotification, DisableNotification,
WithReplyParameters, WithReplyParameters,
WithReplyMarkup, WithReplyMarkup,
SendMessageRequest<ContentMessage<InvoiceContent>> { SendMessageRequest<ContentMessage<InvoiceContent>>,
OptionallyWithEffectRequest<ContentMessage<InvoiceContent>> {
override fun method(): String = "sendInvoice" override fun method(): String = "sendInvoice"
override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceContent>> override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
get() = invoiceMessageSerializer get() = invoiceMessageSerializer
@@ -115,6 +119,7 @@ data class SendInvoice(
threadId: MessageThreadId? = chatId.threadId, threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) : this( ) : this(
@@ -138,6 +143,7 @@ data class SendInvoice(
threadId = threadId, threadId = threadId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -105,6 +105,7 @@ fun Poll.createRequest(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = when (this) { ) = when (this) {
@@ -120,6 +121,7 @@ fun Poll.createRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId = effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -137,6 +139,7 @@ fun Poll.createRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId = effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -152,6 +155,7 @@ fun Poll.createRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId = effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )
@@ -167,6 +171,7 @@ fun Poll.createRequest(
businessConnectionId, businessConnectionId,
disableNotification, disableNotification,
protectContent, protectContent,
effectId = effectId,
replyParameters, replyParameters,
replyMarkup replyMarkup
) )

View File

@@ -54,6 +54,8 @@ class SendQuizPoll internal constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -84,6 +86,7 @@ class SendQuizPoll internal constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -104,6 +107,7 @@ class SendQuizPoll internal constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -123,6 +127,7 @@ class SendQuizPoll internal constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -143,6 +148,7 @@ class SendQuizPoll internal constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -162,6 +168,7 @@ class SendQuizPoll internal constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -182,6 +189,7 @@ class SendQuizPoll internal constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -200,6 +208,7 @@ class SendQuizPoll internal constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -220,6 +229,7 @@ class SendQuizPoll internal constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -254,6 +264,7 @@ fun SendQuizPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -272,6 +283,7 @@ fun SendQuizPoll(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -290,6 +302,7 @@ fun SendQuizPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -307,6 +320,7 @@ fun SendQuizPoll(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -325,6 +339,7 @@ fun SendQuizPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -342,6 +357,7 @@ fun SendQuizPoll(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -359,6 +375,7 @@ fun SendQuizPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendQuizPoll( ) = SendQuizPoll(
@@ -375,6 +392,7 @@ fun SendQuizPoll(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -49,6 +49,8 @@ class SendRegularPoll private constructor(
override val disableNotification: Boolean = false, override val disableNotification: Boolean = false,
@SerialName(protectContentField) @SerialName(protectContentField)
override val protectContent: Boolean = false, override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField) @SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null, override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField) @SerialName(replyMarkupField)
@@ -70,6 +72,7 @@ class SendRegularPoll private constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -87,6 +90,7 @@ class SendRegularPoll private constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -105,6 +109,7 @@ class SendRegularPoll private constructor(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) : this( ) : this(
@@ -122,6 +127,7 @@ class SendRegularPoll private constructor(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )
@@ -149,24 +155,26 @@ fun SendRegularPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
chatId, chatId = chatId,
question, question = question,
options, options = options,
questionParseMode, questionParseMode = questionParseMode,
isAnonymous, isAnonymous = isAnonymous,
isClosed, isClosed = isClosed,
allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
fun SendRegularPoll( fun SendRegularPoll(
@@ -181,23 +189,25 @@ fun SendRegularPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
) = SendRegularPoll( ) = SendRegularPoll(
chatId, chatId = chatId,
questionTextSources, questionEntities = questionTextSources,
options, options = options,
isAnonymous, isAnonymous = isAnonymous,
isClosed, isClosed = isClosed,
allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
(closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod, openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openPeriod,
(closeInfo as? ExactScheduledCloseInfo) ?.closeDate, closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDate,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
fun SendRegularPoll( fun SendRegularPoll(
@@ -211,21 +221,23 @@ fun SendRegularPoll(
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null, replyMarkup: KeyboardMarkup? = null,
builder: EntitiesBuilderBody builder: EntitiesBuilderBody
) = SendRegularPoll( ) = SendRegularPoll(
chatId, chatId = chatId,
EntitiesBuilder().apply(builder).build(), questionTextSources = EntitiesBuilder().apply(builder).build(),
options, options = options,
closeInfo, closeInfo = closeInfo,
isAnonymous, isAnonymous = isAnonymous,
isClosed, isClosed = isClosed,
allowMultipleAnswers, allowMultipleAnswers = allowMultipleAnswers,
threadId, threadId = threadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )

View File

@@ -123,6 +123,7 @@ const val disableWebPagePreviewField = "disable_web_page_preview"
const val linkPreviewOptionsField = "link_preview_options" const val linkPreviewOptionsField = "link_preview_options"
const val disableNotificationField = "disable_notification" const val disableNotificationField = "disable_notification"
const val protectContentField = "protect_content" const val protectContentField = "protect_content"
const val messageEffectIdField = "message_effect_id"
const val removeCaptionField = "remove_caption" const val removeCaptionField = "remove_caption"
const val replyToMessageIdField = "reply_to_message_id" const val replyToMessageIdField = "reply_to_message_id"
const val replyParametersField = "reply_parameters" const val replyParametersField = "reply_parameters"

View File

@@ -24,6 +24,7 @@ data class PrivateContentMessageImpl<T: MessageContent>(
override val senderBot: CommonBot?, override val senderBot: CommonBot?,
override val mediaGroupId: MediaGroupId?, override val mediaGroupId: MediaGroupId?,
override val fromOffline: Boolean, override val fromOffline: Boolean,
override val effectId: EffectId?
) : PrivateContentMessage<T> { ) : PrivateContentMessage<T> {
constructor( constructor(
messageId: MessageId, messageId: MessageId,
@@ -39,7 +40,8 @@ data class PrivateContentMessageImpl<T: MessageContent>(
senderBot: CommonBot?, senderBot: CommonBot?,
mediaGroupId: MediaGroupId?, mediaGroupId: MediaGroupId?,
fromOffline: Boolean, fromOffline: Boolean,
effectId: EffectId,
) : this( ) : this(
messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, mediaGroupId, fromOffline messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, mediaGroupId, fromOffline, effectId
) )
} }

View File

@@ -553,7 +553,8 @@ internal data class RawMessage(
replyMarkup = reply_markup, replyMarkup = reply_markup,
senderBot = via_bot, senderBot = via_bot,
mediaGroupId = media_group_id, mediaGroupId = media_group_id,
fromOffline = is_from_offline fromOffline = is_from_offline,
effectId = effect_id
) )
} else { } else {
BusinessContentMessageImpl( BusinessContentMessageImpl(

View File

@@ -0,0 +1,5 @@
package dev.inmo.tgbotapi.types.message.abstracts
import dev.inmo.tgbotapi.abstracts.types.OptionallyWithEffectId
interface PossiblyWithEffectMessage : Message, OptionallyWithEffectId

View File

@@ -3,6 +3,6 @@ package dev.inmo.tgbotapi.types.message.abstracts
import dev.inmo.tgbotapi.types.chat.PreviewPrivateChat import dev.inmo.tgbotapi.types.chat.PreviewPrivateChat
import dev.inmo.tgbotapi.types.message.content.MessageContent import dev.inmo.tgbotapi.types.message.content.MessageContent
interface PrivateContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage, PossiblyOfflineMessage { interface PrivateContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage, PossiblyOfflineMessage, PossiblyWithEffectMessage {
override val chat: PreviewPrivateChat override val chat: PreviewPrivateChat
} }

View File

@@ -153,6 +153,7 @@ sealed interface ResendableContent {
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId?,
replyParameters: ReplyParameters? = null, replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
): Request<out AccessibleMessage> ): Request<out AccessibleMessage>
@@ -163,6 +164,7 @@ sealed interface ResendableContent {
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false, disableNotification: Boolean = false,
protectContent: Boolean = false, protectContent: Boolean = false,
effectId: EffectId?,
replyToMessageId: MessageId?, replyToMessageId: MessageId?,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null replyMarkup: KeyboardMarkup? = null
@@ -172,6 +174,7 @@ sealed interface ResendableContent {
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyToMessageId ?.let { replyParameters = replyToMessageId ?.let {
ReplyParameters( ReplyParameters(
chatId, chatId,

View File

@@ -28,6 +28,7 @@ data class AnimationContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<AnimationContent>> = SendAnimation( ): Request<ContentMessage<AnimationContent>> = SendAnimation(
@@ -44,6 +45,7 @@ data class AnimationContent(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -25,22 +25,24 @@ data class AudioContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<AudioContent>> = SendAudio( ): Request<ContentMessage<AudioContent>> = SendAudio(
chatId, chatId = chatId,
media.fileId, audio = media.fileId,
media.thumbnail ?.fileId, thumbnail = media.thumbnail ?.fileId,
textSources, entities = textSources,
media.duration, duration = media.duration,
media.performer, performer = media.performer,
media.title, title = media.title,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaAudio = asTelegramMedia() override fun toMediaGroupMemberTelegramMedia(): TelegramMediaAudio = asTelegramMedia()

View File

@@ -18,9 +18,18 @@ data class ContactContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<ContactContent>> = SendContact( ): Request<ContentMessage<ContactContent>> = 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
) )
} }

View File

@@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.SendDice import dev.inmo.tgbotapi.requests.send.SendDice
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.dice.Dice import dev.inmo.tgbotapi.types.dice.Dice
@@ -22,16 +19,18 @@ data class DiceContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<DiceContent>> = SendDice( ): Request<ContentMessage<DiceContent>> = SendDice(
chatId, chatId = chatId,
dice.animationType, animationType = dice.animationType,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
} }

View File

@@ -28,19 +28,21 @@ data class DocumentContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<DocumentContent>> = SendDocument( ): Request<ContentMessage<DocumentContent>> = SendDocument(
chatId, chatId = chatId,
media.fileId, document = media.fileId,
media.thumbnail ?.fileId, thumbnail = media.thumbnail ?.fileId,
textSources, entities = textSources,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaDocument = asTelegramMedia() override fun toMediaGroupMemberTelegramMedia(): TelegramMediaDocument = asTelegramMedia()

View File

@@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.games.SendGame import dev.inmo.tgbotapi.requests.send.games.SendGame
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.games.Game import dev.inmo.tgbotapi.types.games.Game
@@ -22,16 +19,18 @@ data class GameContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<GameContent>> = SendGame( ): Request<ContentMessage<GameContent>> = SendGame(
chatId, chatId = chatId,
game.title, gameShortName = game.title,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
} }

View File

@@ -22,6 +22,7 @@ data class GiveawayContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<out AccessibleMessage> { ): Request<out AccessibleMessage> {

View File

@@ -19,6 +19,7 @@ data class GiveawayPublicResultsContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<out AccessibleMessage> { ): Request<out AccessibleMessage> {

View File

@@ -1,10 +1,7 @@
package dev.inmo.tgbotapi.types.message.content package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -21,6 +18,7 @@ data class InvoiceContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<InvoiceContent>> { ): Request<ContentMessage<InvoiceContent>> {

View File

@@ -4,10 +4,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.SendLiveLocation import dev.inmo.tgbotapi.requests.send.SendLiveLocation
import dev.inmo.tgbotapi.requests.send.SendStaticLocation import dev.inmo.tgbotapi.requests.send.SendStaticLocation
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.location.*
@@ -104,22 +101,24 @@ data class LiveLocationContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<LiveLocationContent>> = SendLiveLocation( ): Request<ContentMessage<LiveLocationContent>> = SendLiveLocation(
chatId, chatId = chatId,
location.latitude, latitude = location.latitude,
location.longitude, longitude = location.longitude,
location.livePeriod, livePeriod = location.livePeriod,
location.horizontalAccuracy, horizontalAccuracy = location.horizontalAccuracy,
location.heading, heading = location.heading,
location.proximityAlertRadius, proximityAlertRadius = location.proximityAlertRadius,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) as SendMessageRequest<ContentMessage<LiveLocationContent>> ) as SendMessageRequest<ContentMessage<LiveLocationContent>>
} }
@@ -137,17 +136,19 @@ data class StaticLocationContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<StaticLocationContent>> = SendStaticLocation( ): Request<ContentMessage<StaticLocationContent>> = SendStaticLocation(
chatId, chatId = chatId,
location.latitude, latitude = location.latitude,
location.longitude, longitude = location.longitude,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) as SendMessageRequest<ContentMessage<StaticLocationContent>> ) as SendMessageRequest<ContentMessage<StaticLocationContent>>
} }

View File

@@ -37,15 +37,17 @@ data class MediaGroupContent<T : MediaGroupPartContent>(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<MediaGroupContent<MediaGroupPartContent>>> = SendMediaGroup<MediaGroupPartContent>( ): Request<ContentMessage<MediaGroupContent<MediaGroupPartContent>>> = SendMediaGroup<MediaGroupPartContent>(
chatId, chatId = chatId,
group.map { it.content.toMediaGroupMemberTelegramMedia() }, media = group.map { it.content.toMediaGroupMemberTelegramMedia() },
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyParameters = replyParameters,
) )
} }

View File

@@ -30,6 +30,7 @@ data class PhotoContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<PhotoContent>> = SendPhoto( ): Request<ContentMessage<PhotoContent>> = SendPhoto(
@@ -42,6 +43,7 @@ data class PhotoContent(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.polls.createRequest import dev.inmo.tgbotapi.requests.send.polls.createRequest
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -22,15 +19,17 @@ data class PollContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<PollContent>> = poll.createRequest( ): Request<ContentMessage<PollContent>> = poll.createRequest(
chatId, chatId = chatId,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
} }

View File

@@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.media.SendSticker 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.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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.files.Sticker
@@ -23,18 +20,19 @@ data class StickerContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<StickerContent>> = SendSticker( ): Request<ContentMessage<StickerContent>> = SendSticker(
chatId, chatId = chatId,
media.fileId, sticker = media.fileId,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
media.emoji, disableNotification = disableNotification,
disableNotification, protectContent = protectContent,
protectContent, effectId = effectId,
replyParameters, replyParameters = replyParameters,
replyMarkup replyMarkup = replyMarkup
) )
override fun asTelegramMedia(): TelegramMediaDocument = TelegramMediaDocument( override fun asTelegramMedia(): TelegramMediaDocument = TelegramMediaDocument(

View File

@@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.ForwardMessage import dev.inmo.tgbotapi.requests.ForwardMessage
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
@@ -25,6 +22,7 @@ data class StoryContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<PossiblyForwardedMessage> { ): Request<PossiblyForwardedMessage> {

View File

@@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.types.message.content 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.abstracts.Request
import dev.inmo.tgbotapi.requests.send.SendTextMessage import dev.inmo.tgbotapi.requests.send.SendTextMessage
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
@@ -24,17 +23,19 @@ data class TextContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<TextContent>> = SendTextMessage( ): Request<ContentMessage<TextContent>> = SendTextMessage(
chatId, chatId = chatId,
textSources, entities = textSources,
linkPreviewOptions, linkPreviewOptions = linkPreviewOptions,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
} }

View File

@@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.SendVenue import dev.inmo.tgbotapi.requests.send.SendVenue
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.*
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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
@@ -22,9 +19,18 @@ data class VenueContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<VenueContent>> = SendVenue( ): Request<ContentMessage<VenueContent>> = 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
) )
} }

View File

@@ -27,6 +27,7 @@ data class VideoContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<VideoContent>> = SendVideo( ): Request<ContentMessage<VideoContent>> = SendVideo(
@@ -44,6 +45,7 @@ data class VideoContent(
businessConnectionId = businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.media.SendVideoNote 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.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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.files.VideoNoteFile import dev.inmo.tgbotapi.types.files.VideoNoteFile
@@ -23,20 +20,22 @@ data class VideoNoteContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<VideoNoteContent>> = SendVideoNote( ): Request<ContentMessage<VideoNoteContent>> = SendVideoNote(
chatId, chatId = chatId,
media.fileId, videoNote = media.fileId,
media.thumbnail ?.fileId, thumbnail = media.thumbnail ?.fileId,
media.duration, duration = media.duration,
media.width, size = media.width,
messageThreadId, threadId = messageThreadId,
businessConnectionId, businessConnectionId = businessConnectionId,
disableNotification, disableNotification = disableNotification,
protectContent, protectContent = protectContent,
replyParameters, effectId = effectId,
replyMarkup replyParameters = replyParameters,
replyMarkup = replyMarkup
) )
override fun asTelegramMedia(): TelegramMediaVideo = TelegramMediaVideo( override fun asTelegramMedia(): TelegramMediaVideo = TelegramMediaVideo(

View File

@@ -5,7 +5,6 @@ import dev.inmo.tgbotapi.requests.send.media.SendVoice
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.media.TelegramMediaAudio import dev.inmo.tgbotapi.types.media.TelegramMediaAudio
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList 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.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.files.VoiceFile import dev.inmo.tgbotapi.types.files.VoiceFile
@@ -25,6 +24,7 @@ data class VoiceContent(
businessConnectionId: BusinessConnectionId?, businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean, disableNotification: Boolean,
protectContent: Boolean, protectContent: Boolean,
effectId: EffectId?,
replyParameters: ReplyParameters?, replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup? replyMarkup: KeyboardMarkup?
): Request<ContentMessage<VoiceContent>> = SendVoice( ): Request<ContentMessage<VoiceContent>> = SendVoice(
@@ -36,6 +36,7 @@ data class VoiceContent(
duration = media.duration, duration = media.duration,
disableNotification = disableNotification, disableNotification = disableNotification,
protectContent = protectContent, protectContent = protectContent,
effectId = effectId,
replyParameters = replyParameters, replyParameters = replyParameters,
replyMarkup = replyMarkup replyMarkup = replyMarkup
) )

View File

@@ -14,7 +14,7 @@ data class SuccessfulPayment(
@SerialName(invoicePayloadField) @SerialName(invoicePayloadField)
val invoicePayload: String, val invoicePayload: String,
@SerialName(telegramPaymentChargeIdField) @SerialName(telegramPaymentChargeIdField)
val telegramPaymentChargeId: String, val telegramPaymentChargeId: TelegramPaymentChargeId,
@SerialName(providerPaymentChargeIdField) @SerialName(providerPaymentChargeIdField)
val providerPaymentChargeId: String, val providerPaymentChargeId: String,
@SerialName(shippingOptionIdField) @SerialName(shippingOptionIdField)

View File

@@ -0,0 +1,10 @@
package dev.inmo.tgbotapi.types.payments.abstracts
import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline
@Serializable
@JvmInline
value class TelegramPaymentChargeId(
val string: String
)

View File

@@ -16,164 +16,165 @@ fun <T : MediaGroupPartContent> List<PossiblySentViaBotCommonMessage<T>>.asMedia
) )
return when (sourceMessage) { return when (sourceMessage) {
is ChannelContentMessage -> ChannelContentMessageImpl( is ChannelContentMessage -> ChannelContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.chat, chat = sourceMessage.chat,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is BusinessContentMessage -> BusinessContentMessageImpl( is BusinessContentMessage -> BusinessContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.businessConnectionId, businessConnectionId = sourceMessage.businessConnectionId,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBusinessBot, senderBusinessBot = sourceMessage.senderBusinessBot,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is PrivateContentMessage -> PrivateContentMessageImpl( is PrivateContentMessage -> PrivateContentMessageImpl(
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.chat, chat = sourceMessage.chat,
content, content = content,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline,
effectId = sourceMessage.effectId
) )
is AnonymousGroupContentMessage -> AnonymousGroupContentMessageImpl( is AnonymousGroupContentMessage -> AnonymousGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is CommonGroupContentMessage -> CommonGroupContentMessageImpl( is CommonGroupContentMessage -> CommonGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBoostsCount, senderBoostsCount = sourceMessage.senderBoostsCount,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl( is ConnectedFromChannelGroupContentMessage -> ConnectedFromChannelGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is UnconnectedFromChannelGroupContentMessage -> UnconnectedFromChannelGroupContentMessageImpl( is UnconnectedFromChannelGroupContentMessage -> UnconnectedFromChannelGroupContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is AnonymousForumContentMessage -> AnonymousForumContentMessageImpl( is AnonymousForumContentMessage -> AnonymousForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is CommonForumContentMessage -> CommonForumContentMessageImpl( is CommonForumContentMessage -> CommonForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.user, from = sourceMessage.user,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.senderBoostsCount, senderBoostsCount = sourceMessage.senderBoostsCount,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl( is FromChannelForumContentMessage -> FromChannelForumContentMessageImpl(
sourceMessage.chat, chat = sourceMessage.chat,
sourceMessage.channel, channel = sourceMessage.channel,
sourceMessage.messageId, messageId = sourceMessage.messageId,
sourceMessage.threadId, threadId = sourceMessage.threadId,
sourceMessage.date, date = sourceMessage.date,
sourceMessage.forwardOrigin, forwardOrigin = sourceMessage.forwardOrigin,
sourceMessage.editDate, editDate = sourceMessage.editDate,
sourceMessage.hasProtectedContent, hasProtectedContent = sourceMessage.hasProtectedContent,
sourceMessage.replyInfo, replyInfo = sourceMessage.replyInfo,
sourceMessage.replyMarkup, replyMarkup = sourceMessage.replyMarkup,
content, content = content,
sourceMessage.senderBot, senderBot = sourceMessage.senderBot,
sourceMessage.authorSignature, authorSignature = sourceMessage.authorSignature,
sourceMessage.mediaGroupId, mediaGroupId = sourceMessage.mediaGroupId,
sourceMessage.fromOffline fromOffline = sourceMessage.fromOffline
) )
} }
} }

View File

@@ -59,8 +59,8 @@ internal val testTextEntities = listOf(
), ),
RawMessageEntity( RawMessageEntity(
"expandable_blockquote", "expandable_blockquote",
120, 197,
204 86
) )
) )
@@ -75,6 +75,8 @@ fun TextSourcesList.testTextSources() {
assertTrue (get(7) is MentionTextSource) assertTrue (get(7) is MentionTextSource)
assertTrue (get(8) is RegularTextSource) assertTrue (get(8) is RegularTextSource)
assertTrue (get(9) is BlockquoteTextSource) assertTrue (get(9) is BlockquoteTextSource)
assertTrue (get(10) is RegularTextSource)
assertTrue (get(11) is ExpandableBlockquoteTextSource)
val boldSource = get(1) as BoldTextSource val boldSource = get(1) as BoldTextSource
assertTrue (boldSource.subsources.first() is ItalicTextSource) assertTrue (boldSource.subsources.first() is ItalicTextSource)
@@ -85,5 +87,8 @@ fun TextSourcesList.testTextSources() {
val blockquoteSource = get(9) as BlockquoteTextSource val blockquoteSource = get(9) as BlockquoteTextSource
assertTrue (blockquoteSource.subsources.first() is RegularTextSource) assertTrue (blockquoteSource.subsources.first() is RegularTextSource)
val expandableBlockquoteSource = get(11) as ExpandableBlockquoteTextSource
assertTrue (expandableBlockquoteSource.subsources.first() is RegularTextSource)
assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString())) assertEquals(this, toRawMessageEntities().asTextSources(makeSourceString()))
} }

View File

@@ -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.ThumbedWithMimeTypeInlineQueryResult
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult 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.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.WithInputMessageContentInlineQueryResult
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached 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.ThumbedTelegramMedia
import dev.inmo.tgbotapi.types.media.TitledTelegramMedia import dev.inmo.tgbotapi.types.media.TitledTelegramMedia
import dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia 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.ChannelEventMessage
import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated
import dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded 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.PossiblyPaymentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage 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.PotentiallyFromUserGroupContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage 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.VideoNoteContent
import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent
import dev.inmo.tgbotapi.types.message.content.VoiceContent 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.payments.SuccessfulPaymentEvent
import dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource import dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource
import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource 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.CodeTextSource
import dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource import dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource
import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource 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.HashTagTextSource
import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource
import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource
@@ -1413,6 +1418,18 @@ public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQuer
public inline fun <T> InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): public inline fun <T> InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T):
T? = urlInlineQueryResultOrNull() ?.let(block) 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 <T>
InlineQueryResult.ifWithCustomizableCaptionInlineQueryResult(block: (WithCustomizableCaptionInlineQueryResult) -> T):
T? = withCustomizableCaptionInlineQueryResultOrNull() ?.let(block)
public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull():
WithInputMessageContentInlineQueryResult? = this as? WithInputMessageContentInlineQueryResult? = this as?
dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult
@@ -3064,6 +3081,18 @@ public inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedi
public inline fun <T> TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? = public inline fun <T> TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? =
titledTelegramMediaOrNull() ?.let(block) 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 <T>
TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T):
T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block)
public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as? public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as?
dev.inmo.tgbotapi.types.chat.ChatBackground dev.inmo.tgbotapi.types.chat.ChatBackground
@@ -3842,6 +3871,15 @@ public inline fun Message.possiblyTopicMessageOrThrow(): PossiblyTopicMessage =
public inline fun <T> Message.ifPossiblyTopicMessage(block: (PossiblyTopicMessage) -> T): T? = public inline fun <T> Message.ifPossiblyTopicMessage(block: (PossiblyTopicMessage) -> T): T? =
possiblyTopicMessageOrNull() ?.let(block) 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 <T> Message.ifPossiblyWithEffectMessage(block: (PossiblyWithEffectMessage) -> T):
T? = possiblyWithEffectMessageOrNull() ?.let(block)
public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage<MessageContent>? = public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage<MessageContent>? =
this as? this as?
dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent> dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage<dev.inmo.tgbotapi.types.message.content.MessageContent>
@@ -3936,6 +3974,18 @@ public inline fun <T>
ResendableContent.ifSpoilerableMediaContent(block: (SpoilerableMediaContent) -> T): T? = ResendableContent.ifSpoilerableMediaContent(block: (SpoilerableMediaContent) -> T): T? =
spoilerableMediaContentOrNull() ?.let(block) 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 <T>
ResendableContent.ifWithCustomizedCaptionMediaContent(block: (WithCustomizedCaptionMediaContent) -> T):
T? = withCustomizedCaptionMediaContentOrNull() ?.let(block)
public inline fun ResendableContent.audioMediaGroupPartContentOrNull(): AudioMediaGroupPartContent? public inline fun ResendableContent.audioMediaGroupPartContentOrNull(): AudioMediaGroupPartContent?
= this as? dev.inmo.tgbotapi.types.message.content.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 <T> TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? = public inline fun <T> TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? =
eMailTextSourceOrNull() ?.let(block) 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 <T>
TextSource.ifExpandableBlockquoteTextSource(block: (ExpandableBlockquoteTextSource) -> T): T? =
expandableBlockquoteTextSourceOrNull() ?.let(block)
public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as?
dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource