tgbot-cpp
Loading...
Searching...
No Matches
TgBot::SendInvoiceArgs Struct Reference

Arguments for Api::sendInvoice. More...

#include <Types.h>

Public Attributes

std::variant< std::int64_t, std::string > chatId { }
 Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
std::string title { }
 Product name, 1-32 characters.
std::string description { }
 Product description, 1-255 characters.
std::string payload { }
 Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
std::string providerToken { }
 Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
std::string currency { }
 Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
std::vector< std::shared_ptr< LabeledPrice > > prices { }
 Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
std::string providerData = ""
 JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
std::string photoUrl = ""
 URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
std::int32_t photoSize = 0
 Photo size in bytes.
std::int32_t photoWidth = 0
 Photo width.
std::int32_t photoHeight = 0
 Photo height.
bool needName = false
 Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
bool needPhoneNumber = false
 Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
bool needEmail = false
 Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
bool needShippingAddress = false
 Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
bool sendPhoneNumberToProvider = false
 Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
bool sendEmailToProvider = false
 Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
bool isFlexible = false
 Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
std::shared_ptr< ReplyParameters > replyParameters = nullptr
 Description of the message to reply to.
std::shared_ptr< InlineKeyboardMarkup > replyMarkup = nullptr
 A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
bool disableNotification = false
 Sends the message silently. Users will receive a notification with no sound.
std::int32_t messageThreadId = 0
 Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only.
std::int32_t maxTipAmount = 0
 The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.
std::vector< std::int32_t > suggestedTipAmounts = { }
 A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
std::string startParameter = ""
 Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non- empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.
bool protectContent = false
 Protects the contents of the sent message from forwarding and saving.
bool allowPaidBroadcast = false
 Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
std::int64_t directMessagesTopicId = 0
 Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat.
std::string messageEffectId = ""
 Unique identifier of the message effect to be added to the message; for private chats only.
std::shared_ptr< SuggestedPostParameters > suggestedPostParameters = nullptr
 A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.

Detailed Description

Arguments for Api::sendInvoice.

Definition at line 18303 of file Types.h.

Member Data Documentation

◆ allowPaidBroadcast

bool TgBot::SendInvoiceArgs::allowPaidBroadcast = false

Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.

Definition at line 18480 of file Types.h.

◆ chatId

std::variant<std::int64_t, std::string> TgBot::SendInvoiceArgs::chatId { }

Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.

Definition at line 18308 of file Types.h.

◆ currency

std::string TgBot::SendInvoiceArgs::currency { }

Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.

Definition at line 18336 of file Types.h.

◆ description

std::string TgBot::SendInvoiceArgs::description { }

Product description, 1-255 characters.

Definition at line 18318 of file Types.h.

◆ directMessagesTopicId

std::int64_t TgBot::SendInvoiceArgs::directMessagesTopicId = 0

Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat.

Definition at line 18486 of file Types.h.

◆ disableNotification

bool TgBot::SendInvoiceArgs::disableNotification = false

Sends the message silently. Users will receive a notification with no sound.

Definition at line 18432 of file Types.h.

◆ isFlexible

bool TgBot::SendInvoiceArgs::isFlexible = false

Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.

Definition at line 18414 of file Types.h.

◆ maxTipAmount

std::int32_t TgBot::SendInvoiceArgs::maxTipAmount = 0

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.

Definition at line 18449 of file Types.h.

◆ messageEffectId

std::string TgBot::SendInvoiceArgs::messageEffectId = ""

Unique identifier of the message effect to be added to the message; for private chats only.

Definition at line 18492 of file Types.h.

◆ messageThreadId

std::int32_t TgBot::SendInvoiceArgs::messageThreadId = 0

Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only.

Definition at line 18439 of file Types.h.

◆ needEmail

bool TgBot::SendInvoiceArgs::needEmail = false

Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.

Definition at line 18390 of file Types.h.

◆ needName

bool TgBot::SendInvoiceArgs::needName = false

Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.

Definition at line 18378 of file Types.h.

◆ needPhoneNumber

bool TgBot::SendInvoiceArgs::needPhoneNumber = false

Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.

Definition at line 18384 of file Types.h.

◆ needShippingAddress

bool TgBot::SendInvoiceArgs::needShippingAddress = false

Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.

Definition at line 18396 of file Types.h.

◆ payload

std::string TgBot::SendInvoiceArgs::payload { }

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.

Definition at line 18324 of file Types.h.

◆ photoHeight

std::int32_t TgBot::SendInvoiceArgs::photoHeight = 0

Photo height.

Definition at line 18372 of file Types.h.

◆ photoSize

std::int32_t TgBot::SendInvoiceArgs::photoSize = 0

Photo size in bytes.

Definition at line 18362 of file Types.h.

◆ photoUrl

std::string TgBot::SendInvoiceArgs::photoUrl = ""

URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

Definition at line 18357 of file Types.h.

◆ photoWidth

std::int32_t TgBot::SendInvoiceArgs::photoWidth = 0

Photo width.

Definition at line 18367 of file Types.h.

◆ prices

std::vector<std::shared_ptr<LabeledPrice> > TgBot::SendInvoiceArgs::prices { }

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.

Definition at line 18343 of file Types.h.

◆ protectContent

bool TgBot::SendInvoiceArgs::protectContent = false

Protects the contents of the sent message from forwarding and saving.

Definition at line 18473 of file Types.h.

◆ providerData

std::string TgBot::SendInvoiceArgs::providerData = ""

JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

Definition at line 18350 of file Types.h.

◆ providerToken

std::string TgBot::SendInvoiceArgs::providerToken { }

Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.

Definition at line 18330 of file Types.h.

◆ replyMarkup

std::shared_ptr<InlineKeyboardMarkup> TgBot::SendInvoiceArgs::replyMarkup = nullptr

A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

Definition at line 18426 of file Types.h.

◆ replyParameters

std::shared_ptr<ReplyParameters> TgBot::SendInvoiceArgs::replyParameters = nullptr

Description of the message to reply to.

Definition at line 18419 of file Types.h.

◆ sendEmailToProvider

bool TgBot::SendInvoiceArgs::sendEmailToProvider = false

Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.

Definition at line 18408 of file Types.h.

◆ sendPhoneNumberToProvider

bool TgBot::SendInvoiceArgs::sendPhoneNumberToProvider = false

Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.

Definition at line 18402 of file Types.h.

◆ startParameter

std::string TgBot::SendInvoiceArgs::startParameter = ""

Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non- empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.

Definition at line 18468 of file Types.h.

◆ suggestedPostParameters

std::shared_ptr<SuggestedPostParameters> TgBot::SendInvoiceArgs::suggestedPostParameters = nullptr

A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.

Definition at line 18500 of file Types.h.

◆ suggestedTipAmounts

std::vector<std::int32_t> TgBot::SendInvoiceArgs::suggestedTipAmounts = { }

A JSON-serialized Array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

Definition at line 18458 of file Types.h.

◆ title

std::string TgBot::SendInvoiceArgs::title { }

Product name, 1-32 characters.

Definition at line 18313 of file Types.h.


The documentation for this struct was generated from the following file: