1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

InvoiceOfPayment is renamed to InvoiceContent

This commit is contained in:
InsanusMokrassar 2020-02-07 10:47:35 +06:00
parent 04e4407b96
commit c2c7ac0d1e
4 changed files with 10 additions and 16 deletions

View File

@ -43,8 +43,8 @@
* Now it is possible to get updates by polling with custom executor engine
* `CommonMultipartFileRequest` now is internal
* Added `LiveLocation` class for more useful tracking live locations
* `InvoiceOfPayment` now is `MessageContent` instead of `PaymentInfo`
* `SendInvoice` now return `ContentMessage<InvoiceOfPayment>`
* `InvoiceOfPayment` is renamed to `InvoiceContent` and now is `MessageContent` instead of `PaymentInfo`
* `SendInvoice` now return `ContentMessage<InvoiceContent>`
* `paymentInfo` inside of `CommonMessageImpl` now can be set only to `SuccessfulPaymentInfo`
* Added `RecordVideoNoteAction` and `UploadVideoNoteAction` for `record_video_note` and `upload_video_note` actions

View File

@ -6,15 +6,13 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMe
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategy
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.media.PhotoContent
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.InvoiceOfPayment
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.InvoiceContent
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.LabeledPrice
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.LabeledPricesSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.abstracts.*
import kotlinx.serialization.*
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceOfPayment>>
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
/**
@ -67,9 +65,9 @@ data class SendInvoice(
DisableNotification,
ReplyMessageId,
ReplyMarkup,
SendMessageRequest<ContentMessage<InvoiceOfPayment>> {
SendMessageRequest<ContentMessage<InvoiceContent>> {
override fun method(): String = "sendInvoice"
override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceOfPayment>>
override val resultDeserializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
get() = invoiceMessageSerializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()

View File

@ -14,9 +14,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Unknow
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.media.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.InvoiceOfPayment
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.InvoiceContent
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.SuccessfulPaymentInfo
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.abstracts.PaymentInfo
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.Invoice
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.SuccessfulPayment
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
@ -130,7 +129,7 @@ internal data class RawMessage(
location != null -> LocationContent(location)
venue != null -> VenueContent(venue)
poll != null -> PollContent(poll)
invoice != null -> InvoiceOfPayment(invoice)
invoice != null -> InvoiceContent(invoice)
else -> null
}
}

View File

@ -1,17 +1,14 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.payments
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.payments.SendInvoice
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.abstracts.PaymentInfo
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.Invoice
data class InvoiceOfPayment(
data class InvoiceContent(
val invoice: Invoice
) : MessageContent {
override fun createResend(
@ -19,7 +16,7 @@ data class InvoiceOfPayment(
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): Request<ContentMessage<InvoiceOfPayment>> {
): Request<ContentMessage<InvoiceContent>> {
error("Unfortunately, currently InvoiceOfPayment can not be resend due to requirement of additional parameters," +
" which can't be provided during the call of this method")
}