Rename tgapi request structs
Add MaybeInaccessibleMessage tests and godoc Update wiki and Bot API docs for the new naming
This commit is contained in:
@@ -7,6 +7,62 @@ type LabeledPrice struct {
|
||||
Amount int `json:"amount"`
|
||||
}
|
||||
|
||||
type Invoice struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
StartParameter string `json:"start_parameter"`
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
}
|
||||
|
||||
// ShippingQuery represents an incoming shipping query.
|
||||
// See https://core.telegram.org/bots/api#shippingquery
|
||||
type ShippingQuery struct {
|
||||
ID string `json:"id"`
|
||||
From User `json:"from"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
ShippingAddress ShippingAddress `json:"shipping_address"`
|
||||
}
|
||||
|
||||
// ShippingAddress represents a shipping address.
|
||||
// See https://core.telegram.org/bots/api#shippingaddress
|
||||
type ShippingAddress struct {
|
||||
CountryCode string `json:"country_code"`
|
||||
State string `json:"state"`
|
||||
City string `json:"city"`
|
||||
StreetLine1 string `json:"street_line1"`
|
||||
StreetLine2 string `json:"street_line2"`
|
||||
PostCode string `json:"post_code"`
|
||||
}
|
||||
|
||||
// OrderInfo represents information about an order.
|
||||
// See https://core.telegram.org/bots/api#orderinfo
|
||||
type OrderInfo struct {
|
||||
Name string `json:"name"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
Email string `json:"email"`
|
||||
ShippingAddress ShippingAddress `json:"shipping_address"`
|
||||
}
|
||||
|
||||
// PreCheckoutQuery represents an incoming pre-checkout query.
|
||||
// See https://core.telegram.org/bots/api#precheckoutquery
|
||||
type PreCheckoutQuery struct {
|
||||
ID string `json:"id"`
|
||||
From User `json:"from"`
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
ShippingOptionID string `json:"shipping_option_id"`
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
}
|
||||
|
||||
// PaidMediaPurchased represents a purchased paid media.
|
||||
// See https://core.telegram.org/bots/api#paidmediapurchased
|
||||
type PaidMediaPurchased struct {
|
||||
From User `json:"from"`
|
||||
PaidMediaPayload string `json:"paid_media_payload"`
|
||||
}
|
||||
|
||||
// ShippingOption represents one shipping option.
|
||||
// See https://core.telegram.org/bots/api#shippingoption
|
||||
type ShippingOption struct {
|
||||
@@ -14,3 +70,27 @@ type ShippingOption struct {
|
||||
Title string `json:"title"`
|
||||
Prices []LabeledPrice `json:"prices"`
|
||||
}
|
||||
|
||||
type SuccessfulPayment struct {
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
|
||||
SubscriptionExpirationDate int `json:"subscription_expiration_date,omitempty"`
|
||||
IsRecurring bool `json:"is_recurring,omitempty"`
|
||||
IsFirstRecurring bool `json:"is_first_recurring,omitempty"`
|
||||
ShippingOptionID string `json:"shipping_option_id,omitempty"`
|
||||
OrderInfo *OrderInfo `json:"order_info,omitempty"`
|
||||
|
||||
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
||||
ProviderPaymentChargeID string `json:"proviced_payment_charge_id"`
|
||||
}
|
||||
|
||||
type RefundedPayment struct {
|
||||
Currency string `json:"currency"`
|
||||
TotalAmount int `json:"total_amount"`
|
||||
InvoicePayload string `json:"invoice_payload"`
|
||||
|
||||
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
|
||||
ProviderPaymentChargeID string `json:"proviced_payment_charge_id,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user