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

update SendInvoice

This commit is contained in:
InsanusMokrassar 2021-04-26 19:28:19 +06:00
parent 1846d20b0d
commit cd30660256
3 changed files with 11 additions and 8 deletions

View File

@ -2,6 +2,9 @@
## 0.34.0 ## 0.34.0
* `Core`:
* `SendInvoice#startParameter` becomes optional and replaced in `SendInvoice` constructor
## 0.33.4 ## 0.33.4
* `Common`: * `Common`:

View File

@ -30,13 +30,13 @@ data class SendInvoice(
val payload: String, val payload: String,
@SerialName(providerTokenField) @SerialName(providerTokenField)
val providerToken: String, val providerToken: String,
@SerialName(startParameterField)
val startParameter: StartParameter,
@SerialName(currencyField) @SerialName(currencyField)
override val currency: Currency, override val currency: Currency,
@Serializable(LabeledPricesSerializer::class) @Serializable(LabeledPricesSerializer::class)
@SerialName(pricesField) @SerialName(pricesField)
override val prices: List<LabeledPrice>, override val prices: List<LabeledPrice>,
@SerialName(startParameterField)
val startParameter: StartParameter? = null,
@SerialName(providerDataField) @SerialName(providerDataField)
val providerData: String? = null, val providerData: String? = null,
@SerialName(requireNameField) @SerialName(requireNameField)

View File

@ -14,9 +14,9 @@ suspend fun TelegramBot.sendInvoice(
description: String, description: String,
payload: String, payload: String,
providerToken: String, providerToken: String,
startParameter: StartParameter,
currency: Currency, currency: Currency,
prices: List<LabeledPrice>, prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null, providerData: String? = null,
requireName: Boolean = false, requireName: Boolean = false,
requirePhoneNumber: Boolean = false, requirePhoneNumber: Boolean = false,
@ -30,7 +30,7 @@ suspend fun TelegramBot.sendInvoice(
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = execute( ) = execute(
SendInvoice(chatId, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) SendInvoice(chatId, title, description, payload, providerToken, currency, prices, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
) )
suspend fun TelegramBot.sendInvoice( suspend fun TelegramBot.sendInvoice(
@ -39,9 +39,9 @@ suspend fun TelegramBot.sendInvoice(
description: String, description: String,
payload: String, payload: String,
providerToken: String, providerToken: String,
startParameter: StartParameter,
currency: Currency, currency: Currency,
prices: List<LabeledPrice>, prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null, providerData: String? = null,
requireName: Boolean = false, requireName: Boolean = false,
requirePhoneNumber: Boolean = false, requirePhoneNumber: Boolean = false,
@ -54,7 +54,7 @@ suspend fun TelegramBot.sendInvoice(
replyToMessageId: MessageIdentifier? = null, replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = sendInvoice(user.id, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) ) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.replyWithInvoice( suspend inline fun TelegramBot.replyWithInvoice(
to: Message, to: Message,
@ -62,9 +62,9 @@ suspend inline fun TelegramBot.replyWithInvoice(
description: String, description: String,
payload: String, payload: String,
providerToken: String, providerToken: String,
startParameter: StartParameter,
currency: Currency, currency: Currency,
prices: List<LabeledPrice>, prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null, providerData: String? = null,
requireName: Boolean = false, requireName: Boolean = false,
requirePhoneNumber: Boolean = false, requirePhoneNumber: Boolean = false,
@ -76,4 +76,4 @@ suspend inline fun TelegramBot.replyWithInvoice(
disableNotification: Boolean = false, disableNotification: Boolean = false,
allowSendingWithoutReply: Boolean? = null, allowSendingWithoutReply: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null replyMarkup: InlineKeyboardMarkup? = null
) = sendInvoice(to.chat.id, title, description, payload, providerToken, startParameter, currency, prices, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) ) = sendInvoice(to.chat.id, title, description, payload, providerToken, currency, prices, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)