1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

update invoices API

This commit is contained in:
InsanusMokrassar 2024-06-07 01:18:55 +06:00
parent 7118631213
commit 663d63b009
3 changed files with 8 additions and 10 deletions

View File

@ -2,6 +2,8 @@
## 14.0.1
* In `core` and `api` modules related to invoices changed their APIs to suite current API
## 14.0.0
**Add support of [Telegram Bots API 7.4](https://core.telegram.org/bots/api-changelog#may-28-2024)**

View File

@ -82,7 +82,7 @@ suspend fun TelegramBot.sendInvoice(
title: String,
description: String,
payload: String,
prices: List<LabeledPrice>,
price: LabeledPrice,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
startParameter: StartParameter? = null,
@ -101,7 +101,7 @@ suspend fun TelegramBot.sendInvoice(
replyParameters: ReplyParameters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
SendInvoice(chatId, title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
SendInvoice(chatId, title, description, payload, price, maxTipAmount, suggestedTipAmounts ?.sorted(), startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, threadId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
)
/**
@ -113,7 +113,7 @@ suspend fun TelegramBot.sendInvoice(
title: String,
description: String,
payload: String,
prices: List<LabeledPrice>,
price: LabeledPrice,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
startParameter: StartParameter? = null,
@ -135,7 +135,7 @@ suspend fun TelegramBot.sendInvoice(
title = title,
description = description,
payload = payload,
prices = prices,
price = price,
maxTipAmount = maxTipAmount,
suggestedTipAmounts = suggestedTipAmounts,
startParameter = startParameter,

View File

@ -105,9 +105,7 @@ data class SendInvoice(
title: String,
description: String,
payload: String,
prices: List<LabeledPrice>,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
price: LabeledPrice,
providerData: String? = null,
requireName: Boolean = false,
requirePhoneNumber: Boolean = false,
@ -129,9 +127,7 @@ data class SendInvoice(
payload = payload,
providerToken = null,
currency = Currency.XTR,
prices = prices,
maxTipAmount = maxTipAmount,
suggestedTipAmounts = suggestedTipAmounts,
prices = listOf(price),
providerData = providerData,
requireName = requireName,
requirePhoneNumber = requirePhoneNumber,