Skip to main content

payments.getStarsGiftOptions

Obtain a list of Telegram Stars gift options » as starsGiftOption constructors.

func (c *Client) PaymentsGetStarsGiftOptions(ctx context.Context, request *PaymentsGetStarsGiftOptionsRequest) ([]StarsGiftOption, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PaymentsGetStarsGiftOptions(ctx, &tg.PaymentsGetStarsGiftOptionsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // []StarsGiftOption
return nil
})

Parameters

NameTypeRequiredDescription
UserIDInputUserClassReceiver of the gift (optional).

Returns

[]StarsGiftOption

Possible errors

CodeTypeDescription
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400USER_GIFT_UNAVAILABLEGifts are not available in the current region (stars_gifts_enabled is equal to false).
400USER_ID_INVALIDThe provided user ID is invalid.

References