// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// No-op definition for keeping imports.var ( _ = bin.Buffer{} _ = context.Background() _ = fmt.Stringer(nil) _ = strings.Builder{} _ = errors.Is _ = multierr.AppendInto _ = sort.Ints _ = tdp.Format _ = tgerr.Error{} _ = tdjson.Encoder{})// PaymentsTransferStarGiftRequest represents TL type `payments.transferStarGift#7f18176a`.// Transfer a collectible gift¹ to another user or channel: can only be used if transfer// is free (i.e. messageActionStarGiftUnique².transfer_stars is not set); see here »³// for more info on the full flow (including the different flow to use in case the// transfer isn't free).//// Links:// 1. https://core.telegram.org/api/gifts#collectible-gifts// 2. https://core.telegram.org/constructor/messageActionStarGiftUnique// 3. https://core.telegram.org/api/gifts#transferring-collectible-gifts//// See https://core.telegram.org/method/payments.transferStarGift for reference.typePaymentsTransferStarGiftRequeststruct {// The gift to transfer.StargiftInputSavedStarGiftClass// Destination peer.ToIDInputPeerClass}// PaymentsTransferStarGiftRequestTypeID is TL type id of PaymentsTransferStarGiftRequest.constPaymentsTransferStarGiftRequestTypeID = 0x7f18176a// Ensuring interfaces in compile-time for PaymentsTransferStarGiftRequest.var ( _ bin.Encoder = &PaymentsTransferStarGiftRequest{} _ bin.Decoder = &PaymentsTransferStarGiftRequest{} _ bin.BareEncoder = &PaymentsTransferStarGiftRequest{} _ bin.BareDecoder = &PaymentsTransferStarGiftRequest{})func ( *PaymentsTransferStarGiftRequest) () bool {if == nil {returntrue }if !(.Stargift == nil) {returnfalse }if !(.ToID == nil) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *PaymentsTransferStarGiftRequest) () string {if == nil {return"PaymentsTransferStarGiftRequest(nil)" }typePaymentsTransferStarGiftRequestreturnfmt.Sprintf("PaymentsTransferStarGiftRequest%+v", (*))}// FillFrom fills PaymentsTransferStarGiftRequest from given interface.func ( *PaymentsTransferStarGiftRequest) ( interface { () ( InputSavedStarGiftClass) () ( InputPeerClass)}) { .Stargift = .() .ToID = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*PaymentsTransferStarGiftRequest) () uint32 {returnPaymentsTransferStarGiftRequestTypeID}// TypeName returns name of type in TL schema.func (*PaymentsTransferStarGiftRequest) () string {return"payments.transferStarGift"}// TypeInfo returns info about TL type.func ( *PaymentsTransferStarGiftRequest) () tdp.Type { := tdp.Type{Name: "payments.transferStarGift",ID: PaymentsTransferStarGiftRequestTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "Stargift",SchemaName: "stargift", }, {Name: "ToID",SchemaName: "to_id", }, }return}// Encode implements bin.Encoder.func ( *PaymentsTransferStarGiftRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode payments.transferStarGift#7f18176a as nil") } .PutID(PaymentsTransferStarGiftRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *PaymentsTransferStarGiftRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode payments.transferStarGift#7f18176a as nil") }if .Stargift == nil {returnfmt.Errorf("unable to encode payments.transferStarGift#7f18176a: field stargift is nil") }if := .Stargift.Encode(); != nil {returnfmt.Errorf("unable to encode payments.transferStarGift#7f18176a: field stargift: %w", ) }if .ToID == nil {returnfmt.Errorf("unable to encode payments.transferStarGift#7f18176a: field to_id is nil") }if := .ToID.Encode(); != nil {returnfmt.Errorf("unable to encode payments.transferStarGift#7f18176a: field to_id: %w", ) }returnnil}// Decode implements bin.Decoder.func ( *PaymentsTransferStarGiftRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode payments.transferStarGift#7f18176a to nil") }if := .ConsumeID(PaymentsTransferStarGiftRequestTypeID); != nil {returnfmt.Errorf("unable to decode payments.transferStarGift#7f18176a: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *PaymentsTransferStarGiftRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode payments.transferStarGift#7f18176a to nil") } { , := DecodeInputSavedStarGift()if != nil {returnfmt.Errorf("unable to decode payments.transferStarGift#7f18176a: field stargift: %w", ) } .Stargift = } { , := DecodeInputPeer()if != nil {returnfmt.Errorf("unable to decode payments.transferStarGift#7f18176a: field to_id: %w", ) } .ToID = }returnnil}// GetStargift returns value of Stargift field.func ( *PaymentsTransferStarGiftRequest) () ( InputSavedStarGiftClass) {if == nil {return }return .Stargift}// GetToID returns value of ToID field.func ( *PaymentsTransferStarGiftRequest) () ( InputPeerClass) {if == nil {return }return .ToID}// PaymentsTransferStarGift invokes method payments.transferStarGift#7f18176a returning error if any.// Transfer a collectible gift¹ to another user or channel: can only be used if transfer// is free (i.e. messageActionStarGiftUnique².transfer_stars is not set); see here »³// for more info on the full flow (including the different flow to use in case the// transfer isn't free).//// Links:// 1. https://core.telegram.org/api/gifts#collectible-gifts// 2. https://core.telegram.org/constructor/messageActionStarGiftUnique// 3. https://core.telegram.org/api/gifts#transferring-collectible-gifts//// Possible errors://// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.// 400 MESSAGE_ID_INVALID: The provided message id is invalid.// 400 PAYMENT_REQUIRED: Payment is required for this action, see here » for more info.// 400 PEER_ID_INVALID: The provided peer id is invalid.// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty.// 400 STARGIFT_NOT_FOUND: The specified gift was not found.// 400 STARGIFT_NOT_OWNER: You're not the owner of the gift you trying to transfer.// 400 STARGIFT_NOT_UNIQUE: You can't transfer a non-collectible gift.// 400 STARGIFT_OWNER_INVALID: You cannot transfer or sell a gift owned by another user.// 400 STARGIFT_PEER_INVALID: The specified inputSavedStarGiftChat.peer is invalid.// 400 STARGIFT_TRANSFER_TOO_EARLY_%d: You cannot transfer this gift yet, wait %d seconds.//// See https://core.telegram.org/method/payments.transferStarGift for reference.func ( *Client) ( context.Context, *PaymentsTransferStarGiftRequest) (UpdatesClass, error) {varUpdatesBoxif := .rpc.Invoke(, , &); != nil {returnnil, }return .Updates, nil}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.