Add shipping and bot command types documentation

bot-api-6.1
Ilya Kaznacheev 2020-10-24 23:34:43 +03:00
parent 1e3171403a
commit 189bf08685
No known key found for this signature in database
GPG Key ID: 7E2C1D8A4AB37D50
1 changed files with 35 additions and 11 deletions

View File

@ -1740,20 +1740,41 @@ type SuccessfulPayment struct {
// ShippingQuery contains information about an incoming shipping query. // ShippingQuery contains information about an incoming shipping query.
type ShippingQuery struct { type ShippingQuery struct {
// ID unique query identifier
ID string `json:"id"` ID string `json:"id"`
// From user who sent the query
From *User `json:"from"` From *User `json:"from"`
// InvoicePayload bot specified invoice payload
InvoicePayload string `json:"invoice_payload"` InvoicePayload string `json:"invoice_payload"`
// ShippingAddress user specified shipping address
ShippingAddress *ShippingAddress `json:"shipping_address"` ShippingAddress *ShippingAddress `json:"shipping_address"`
} }
// PreCheckoutQuery contains information about an incoming pre-checkout query. // PreCheckoutQuery contains information about an incoming pre-checkout query.
type PreCheckoutQuery struct { type PreCheckoutQuery struct {
// ID unique query identifier
ID string `json:"id"` ID string `json:"id"`
// From user who sent the query
From *User `json:"from"` From *User `json:"from"`
// Currency three-letter ISO 4217 currency code
// // (see https://core.telegram.org/bots/payments#supported-currencies)
Currency string `json:"currency"` Currency string `json:"currency"`
// TotalAmount total price in the smallest units of the currency (integer, not float/double).
// // For example, for a price of US$ 1.45 pass amount = 145.
// // See the exp parameter in currencies.json,
// // (https://core.telegram.org/bots/payments/currencies.json)
// // it shows the number of digits past the decimal point
// // for each currency (2 for the majority of currencies).
TotalAmount int `json:"total_amount"` TotalAmount int `json:"total_amount"`
// InvoicePayload bot specified invoice payload
InvoicePayload string `json:"invoice_payload"` InvoicePayload string `json:"invoice_payload"`
// ShippingOptionID identifier of the shipping option chosen by the user
//
// optional
ShippingOptionID string `json:"shipping_option_id,omitempty"` ShippingOptionID string `json:"shipping_option_id,omitempty"`
// OrderInfo order info provided by the user
//
// optional
OrderInfo *OrderInfo `json:"order_info,omitempty"` OrderInfo *OrderInfo `json:"order_info,omitempty"`
} }
@ -1770,6 +1791,9 @@ func (e Error) Error() string {
// BotCommand represents a bot command. // BotCommand represents a bot command.
type BotCommand struct { type BotCommand struct {
// Command text of the command, 1-32 characters.
// Can contain only lowercase English letters, digits and underscores.
Command string `json:"command"` Command string `json:"command"`
// Description of the command, 3-256 characters.
Description string `json:"description"` Description string `json:"description"`
} }