Add shipping and bot command types documentation
parent
1e3171403a
commit
189bf08685
46
types.go
46
types.go
|
@ -1740,21 +1740,42 @@ 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 string `json:"id"`
|
// ID unique query identifier
|
||||||
From *User `json:"from"`
|
ID string `json:"id"`
|
||||||
InvoicePayload string `json:"invoice_payload"`
|
// From user who sent the query
|
||||||
|
From *User `json:"from"`
|
||||||
|
// InvoicePayload bot specified 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 string `json:"id"`
|
// ID unique query identifier
|
||||||
From *User `json:"from"`
|
ID string `json:"id"`
|
||||||
Currency string `json:"currency"`
|
// From user who sent the query
|
||||||
TotalAmount int `json:"total_amount"`
|
From *User `json:"from"`
|
||||||
InvoicePayload string `json:"invoice_payload"`
|
// Currency three-letter ISO 4217 currency code
|
||||||
ShippingOptionID string `json:"shipping_option_id,omitempty"`
|
// // (see https://core.telegram.org/bots/payments#supported-currencies)
|
||||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
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"`
|
||||||
|
// InvoicePayload bot specified 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"`
|
||||||
|
// OrderInfo order info provided by the user
|
||||||
|
//
|
||||||
|
// optional
|
||||||
|
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error is an error containing extra information returned by the Telegram API.
|
// Error is an error containing extra information returned by the Telegram API.
|
||||||
|
@ -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 string `json:"command"`
|
// Command text of the command, 1-32 characters.
|
||||||
|
// Can contain only lowercase English letters, digits and underscores.
|
||||||
|
Command string `json:"command"`
|
||||||
|
// Description of the command, 3-256 characters.
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue