Support messagePaidMedia in inputInvoiceMessage.
This commit is contained in:
parent
1ab9b685c4
commit
fa49c93624
@ -2789,7 +2789,7 @@ paymentReceipt product_info:productInfo date:int32 seller_bot_user_id:int53 type
|
||||
|
||||
//@class InputInvoice @description Describes an invoice to process
|
||||
|
||||
//@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier
|
||||
//@description An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia @chat_id Chat identifier of the message @message_id Message identifier
|
||||
inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice;
|
||||
|
||||
//@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice
|
||||
|
@ -38281,7 +38281,8 @@ Result<ServerMessageId> MessagesManager::get_invoice_message_id(MessageFullId me
|
||||
if (m == nullptr) {
|
||||
return Status::Error(400, "Message not found");
|
||||
}
|
||||
if (m->content->get_type() != MessageContentType::Invoice) {
|
||||
auto content_type = m->content->get_type();
|
||||
if (content_type != MessageContentType::Invoice && content_type != MessageContentType::PaidMedia) {
|
||||
return Status::Error(400, "Message has no invoice");
|
||||
}
|
||||
if (m->message_id.is_scheduled()) {
|
||||
@ -38293,7 +38294,9 @@ Result<ServerMessageId> MessagesManager::get_invoice_message_id(MessageFullId me
|
||||
if (m->reply_markup == nullptr || m->reply_markup->inline_keyboard.empty() ||
|
||||
m->reply_markup->inline_keyboard[0].empty() ||
|
||||
m->reply_markup->inline_keyboard[0][0].type != InlineKeyboardButton::Type::Buy) {
|
||||
return Status::Error(400, "Message has no Pay button");
|
||||
if (content_type != MessageContentType::PaidMedia) {
|
||||
return Status::Error(400, "Message has no Pay button");
|
||||
}
|
||||
}
|
||||
|
||||
return m->message_id.get_server_message_id();
|
||||
|
Loading…
Reference in New Issue
Block a user