1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +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
* `Core`:
* `SendInvoice#startParameter` becomes optional and replaced in `SendInvoice` constructor
## 0.33.4
* `Common`:

View File

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

View File

@ -14,9 +14,9 @@ suspend fun TelegramBot.sendInvoice(
description: String,
payload: String,
providerToken: String,
startParameter: StartParameter,
currency: Currency,
prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null,
requireName: Boolean = false,
requirePhoneNumber: Boolean = false,
@ -30,7 +30,7 @@ suspend fun TelegramBot.sendInvoice(
allowSendingWithoutReply: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = 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(
@ -39,9 +39,9 @@ suspend fun TelegramBot.sendInvoice(
description: String,
payload: String,
providerToken: String,
startParameter: StartParameter,
currency: Currency,
prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null,
requireName: Boolean = false,
requirePhoneNumber: Boolean = false,
@ -54,7 +54,7 @@ suspend fun TelegramBot.sendInvoice(
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = 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(
to: Message,
@ -62,9 +62,9 @@ suspend inline fun TelegramBot.replyWithInvoice(
description: String,
payload: String,
providerToken: String,
startParameter: StartParameter,
currency: Currency,
prices: List<LabeledPrice>,
startParameter: StartParameter? = null,
providerData: String? = null,
requireName: Boolean = false,
requirePhoneNumber: Boolean = false,
@ -76,4 +76,4 @@ suspend inline fun TelegramBot.replyWithInvoice(
disableNotification: Boolean = false,
allowSendingWithoutReply: Boolean? = 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)