payments.sendStarGiftOffer
Send an offer to purchase a collectible gift », see here » for the full flow.
func (c *Client) PaymentsSendStarGiftOffer(ctx context.Context, request *PaymentsSendStarGiftOfferRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.PaymentsSendStarGiftOffer(ctx, &tg.PaymentsSendStarGiftOfferRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPeerClass | yes | Owner of the collectible gift: equal to starGiftUnique.owner_id. |
Slug | string | yes | Identifier of the collectible gift: equal to starGiftUnique.slug. |
Price | StarsAmountClass | yes | Offer price, in stars or TON. |
Duration | int | yes | Duration of the offer, in seconds: must be one of 21600, 43200, 86400, 129600, 172800, or 259200; can also be 120 in test mode. |
RandomID | int64 | yes | Random 64-bit identifier used to avoid sending the same offer twice in case of network issues. |
AllowPaidStars | int64 | — | If the destination peer has paid messages » enabled, specifies the amount of Telegram Stars the sending user has agreed to pay in order to send the offer (in addition to the amount for the offer itself, contained in price). |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | INPUT_STARS_AMOUNT_INVALID | |
| 400 | INPUT_STARS_NANOS_INVALID | |
| 400 | INVOICE_INVALID | The specified invoice is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | RESELL_STARS_TOO_FEW | |
| 400 | RESELL_STARS_TOO_MUCH | |
| 400 | STARGIFT_OFFER_INVALID | |
| 400 | STARGIFT_OFFER_NOT_ALLOWED | |
| 400 | STARGIFT_SLUG_INVALID | The specified gift slug is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
payments.sendStarGiftOffer#8fb86b41