Files
mautrix-telegram/pkg/gotd/tg/tl_input_sticker_set_gen.go
T
2025-06-27 20:03:37 -07:00

1466 lines
43 KiB
Go

// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)
// 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{}
)
// InputStickerSetEmpty represents TL type `inputStickerSetEmpty#ffb62b95`.
// Empty constructor
//
// See https://core.telegram.org/constructor/inputStickerSetEmpty for reference.
type InputStickerSetEmpty struct {
}
// InputStickerSetEmptyTypeID is TL type id of InputStickerSetEmpty.
const InputStickerSetEmptyTypeID = 0xffb62b95
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetEmpty) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetEmpty.
var (
_ bin.Encoder = &InputStickerSetEmpty{}
_ bin.Decoder = &InputStickerSetEmpty{}
_ bin.BareEncoder = &InputStickerSetEmpty{}
_ bin.BareDecoder = &InputStickerSetEmpty{}
_ InputStickerSetClass = &InputStickerSetEmpty{}
)
func (i *InputStickerSetEmpty) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetEmpty) String() string {
if i == nil {
return "InputStickerSetEmpty(nil)"
}
type Alias InputStickerSetEmpty
return fmt.Sprintf("InputStickerSetEmpty%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetEmpty) TypeID() uint32 {
return InputStickerSetEmptyTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetEmpty) TypeName() string {
return "inputStickerSetEmpty"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetEmpty) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetEmpty",
ID: InputStickerSetEmptyTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetEmpty) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmpty#ffb62b95 as nil")
}
b.PutID(InputStickerSetEmptyTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetEmpty) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmpty#ffb62b95 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetEmpty) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmpty#ffb62b95 to nil")
}
if err := b.ConsumeID(InputStickerSetEmptyTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetEmpty#ffb62b95: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetEmpty) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmpty#ffb62b95 to nil")
}
return nil
}
// InputStickerSetID represents TL type `inputStickerSetID#9de7a269`.
// Stickerset by ID
//
// See https://core.telegram.org/constructor/inputStickerSetID for reference.
type InputStickerSetID struct {
// ID
ID int64
// Access hash
AccessHash int64
}
// InputStickerSetIDTypeID is TL type id of InputStickerSetID.
const InputStickerSetIDTypeID = 0x9de7a269
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetID) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetID.
var (
_ bin.Encoder = &InputStickerSetID{}
_ bin.Decoder = &InputStickerSetID{}
_ bin.BareEncoder = &InputStickerSetID{}
_ bin.BareDecoder = &InputStickerSetID{}
_ InputStickerSetClass = &InputStickerSetID{}
)
func (i *InputStickerSetID) Zero() bool {
if i == nil {
return true
}
if !(i.ID == 0) {
return false
}
if !(i.AccessHash == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetID) String() string {
if i == nil {
return "InputStickerSetID(nil)"
}
type Alias InputStickerSetID
return fmt.Sprintf("InputStickerSetID%+v", Alias(*i))
}
// FillFrom fills InputStickerSetID from given interface.
func (i *InputStickerSetID) FillFrom(from interface {
GetID() (value int64)
GetAccessHash() (value int64)
}) {
i.ID = from.GetID()
i.AccessHash = from.GetAccessHash()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetID) TypeID() uint32 {
return InputStickerSetIDTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetID) TypeName() string {
return "inputStickerSetID"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetID) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetID",
ID: InputStickerSetIDTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
{
Name: "AccessHash",
SchemaName: "access_hash",
},
}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetID) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetID#9de7a269 as nil")
}
b.PutID(InputStickerSetIDTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetID) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetID#9de7a269 as nil")
}
b.PutLong(i.ID)
b.PutLong(i.AccessHash)
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetID) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetID#9de7a269 to nil")
}
if err := b.ConsumeID(InputStickerSetIDTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetID#9de7a269: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetID) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetID#9de7a269 to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode inputStickerSetID#9de7a269: field id: %w", err)
}
i.ID = value
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode inputStickerSetID#9de7a269: field access_hash: %w", err)
}
i.AccessHash = value
}
return nil
}
// GetID returns value of ID field.
func (i *InputStickerSetID) GetID() (value int64) {
if i == nil {
return
}
return i.ID
}
// GetAccessHash returns value of AccessHash field.
func (i *InputStickerSetID) GetAccessHash() (value int64) {
if i == nil {
return
}
return i.AccessHash
}
// InputStickerSetShortName represents TL type `inputStickerSetShortName#861cc8a0`.
// Stickerset by short name, from a stickerset deep link »¹
//
// Links:
// 1. https://core.telegram.org/api/links#stickerset-links
//
// See https://core.telegram.org/constructor/inputStickerSetShortName for reference.
type InputStickerSetShortName struct {
// Short name from a stickerset deep link »¹
//
// Links:
// 1) https://core.telegram.org/api/links#stickerset-links
ShortName string
}
// InputStickerSetShortNameTypeID is TL type id of InputStickerSetShortName.
const InputStickerSetShortNameTypeID = 0x861cc8a0
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetShortName) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetShortName.
var (
_ bin.Encoder = &InputStickerSetShortName{}
_ bin.Decoder = &InputStickerSetShortName{}
_ bin.BareEncoder = &InputStickerSetShortName{}
_ bin.BareDecoder = &InputStickerSetShortName{}
_ InputStickerSetClass = &InputStickerSetShortName{}
)
func (i *InputStickerSetShortName) Zero() bool {
if i == nil {
return true
}
if !(i.ShortName == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetShortName) String() string {
if i == nil {
return "InputStickerSetShortName(nil)"
}
type Alias InputStickerSetShortName
return fmt.Sprintf("InputStickerSetShortName%+v", Alias(*i))
}
// FillFrom fills InputStickerSetShortName from given interface.
func (i *InputStickerSetShortName) FillFrom(from interface {
GetShortName() (value string)
}) {
i.ShortName = from.GetShortName()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetShortName) TypeID() uint32 {
return InputStickerSetShortNameTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetShortName) TypeName() string {
return "inputStickerSetShortName"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetShortName) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetShortName",
ID: InputStickerSetShortNameTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShortName",
SchemaName: "short_name",
},
}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetShortName) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetShortName#861cc8a0 as nil")
}
b.PutID(InputStickerSetShortNameTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetShortName) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetShortName#861cc8a0 as nil")
}
b.PutString(i.ShortName)
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetShortName) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetShortName#861cc8a0 to nil")
}
if err := b.ConsumeID(InputStickerSetShortNameTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetShortName#861cc8a0: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetShortName) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetShortName#861cc8a0 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode inputStickerSetShortName#861cc8a0: field short_name: %w", err)
}
i.ShortName = value
}
return nil
}
// GetShortName returns value of ShortName field.
func (i *InputStickerSetShortName) GetShortName() (value string) {
if i == nil {
return
}
return i.ShortName
}
// InputStickerSetAnimatedEmoji represents TL type `inputStickerSetAnimatedEmoji#28703c8`.
// Animated emojis stickerset
//
// See https://core.telegram.org/constructor/inputStickerSetAnimatedEmoji for reference.
type InputStickerSetAnimatedEmoji struct {
}
// InputStickerSetAnimatedEmojiTypeID is TL type id of InputStickerSetAnimatedEmoji.
const InputStickerSetAnimatedEmojiTypeID = 0x28703c8
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetAnimatedEmoji) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetAnimatedEmoji.
var (
_ bin.Encoder = &InputStickerSetAnimatedEmoji{}
_ bin.Decoder = &InputStickerSetAnimatedEmoji{}
_ bin.BareEncoder = &InputStickerSetAnimatedEmoji{}
_ bin.BareDecoder = &InputStickerSetAnimatedEmoji{}
_ InputStickerSetClass = &InputStickerSetAnimatedEmoji{}
)
func (i *InputStickerSetAnimatedEmoji) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetAnimatedEmoji) String() string {
if i == nil {
return "InputStickerSetAnimatedEmoji(nil)"
}
type Alias InputStickerSetAnimatedEmoji
return fmt.Sprintf("InputStickerSetAnimatedEmoji%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetAnimatedEmoji) TypeID() uint32 {
return InputStickerSetAnimatedEmojiTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetAnimatedEmoji) TypeName() string {
return "inputStickerSetAnimatedEmoji"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetAnimatedEmoji) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetAnimatedEmoji",
ID: InputStickerSetAnimatedEmojiTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetAnimatedEmoji) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetAnimatedEmoji#28703c8 as nil")
}
b.PutID(InputStickerSetAnimatedEmojiTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetAnimatedEmoji) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetAnimatedEmoji#28703c8 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetAnimatedEmoji) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetAnimatedEmoji#28703c8 to nil")
}
if err := b.ConsumeID(InputStickerSetAnimatedEmojiTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetAnimatedEmoji#28703c8: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetAnimatedEmoji) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetAnimatedEmoji#28703c8 to nil")
}
return nil
}
// InputStickerSetDice represents TL type `inputStickerSetDice#e67f520e`.
// Used for fetching animated dice stickers¹
//
// Links:
// 1. https://core.telegram.org/api/dice
//
// See https://core.telegram.org/constructor/inputStickerSetDice for reference.
type InputStickerSetDice struct {
// The emoji, for now , and are supported
Emoticon string
}
// InputStickerSetDiceTypeID is TL type id of InputStickerSetDice.
const InputStickerSetDiceTypeID = 0xe67f520e
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetDice) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetDice.
var (
_ bin.Encoder = &InputStickerSetDice{}
_ bin.Decoder = &InputStickerSetDice{}
_ bin.BareEncoder = &InputStickerSetDice{}
_ bin.BareDecoder = &InputStickerSetDice{}
_ InputStickerSetClass = &InputStickerSetDice{}
)
func (i *InputStickerSetDice) Zero() bool {
if i == nil {
return true
}
if !(i.Emoticon == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetDice) String() string {
if i == nil {
return "InputStickerSetDice(nil)"
}
type Alias InputStickerSetDice
return fmt.Sprintf("InputStickerSetDice%+v", Alias(*i))
}
// FillFrom fills InputStickerSetDice from given interface.
func (i *InputStickerSetDice) FillFrom(from interface {
GetEmoticon() (value string)
}) {
i.Emoticon = from.GetEmoticon()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetDice) TypeID() uint32 {
return InputStickerSetDiceTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetDice) TypeName() string {
return "inputStickerSetDice"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetDice) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetDice",
ID: InputStickerSetDiceTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Emoticon",
SchemaName: "emoticon",
},
}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetDice) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetDice#e67f520e as nil")
}
b.PutID(InputStickerSetDiceTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetDice) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetDice#e67f520e as nil")
}
b.PutString(i.Emoticon)
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetDice) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetDice#e67f520e to nil")
}
if err := b.ConsumeID(InputStickerSetDiceTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetDice#e67f520e: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetDice) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetDice#e67f520e to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode inputStickerSetDice#e67f520e: field emoticon: %w", err)
}
i.Emoticon = value
}
return nil
}
// GetEmoticon returns value of Emoticon field.
func (i *InputStickerSetDice) GetEmoticon() (value string) {
if i == nil {
return
}
return i.Emoticon
}
// InputStickerSetAnimatedEmojiAnimations represents TL type `inputStickerSetAnimatedEmojiAnimations#cde3739`.
// Animated emoji reaction stickerset (contains animations to play when a user clicks on
// a given animated emoji)
//
// See https://core.telegram.org/constructor/inputStickerSetAnimatedEmojiAnimations for reference.
type InputStickerSetAnimatedEmojiAnimations struct {
}
// InputStickerSetAnimatedEmojiAnimationsTypeID is TL type id of InputStickerSetAnimatedEmojiAnimations.
const InputStickerSetAnimatedEmojiAnimationsTypeID = 0xcde3739
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetAnimatedEmojiAnimations) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetAnimatedEmojiAnimations.
var (
_ bin.Encoder = &InputStickerSetAnimatedEmojiAnimations{}
_ bin.Decoder = &InputStickerSetAnimatedEmojiAnimations{}
_ bin.BareEncoder = &InputStickerSetAnimatedEmojiAnimations{}
_ bin.BareDecoder = &InputStickerSetAnimatedEmojiAnimations{}
_ InputStickerSetClass = &InputStickerSetAnimatedEmojiAnimations{}
)
func (i *InputStickerSetAnimatedEmojiAnimations) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetAnimatedEmojiAnimations) String() string {
if i == nil {
return "InputStickerSetAnimatedEmojiAnimations(nil)"
}
type Alias InputStickerSetAnimatedEmojiAnimations
return fmt.Sprintf("InputStickerSetAnimatedEmojiAnimations%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetAnimatedEmojiAnimations) TypeID() uint32 {
return InputStickerSetAnimatedEmojiAnimationsTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetAnimatedEmojiAnimations) TypeName() string {
return "inputStickerSetAnimatedEmojiAnimations"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetAnimatedEmojiAnimations) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetAnimatedEmojiAnimations",
ID: InputStickerSetAnimatedEmojiAnimationsTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetAnimatedEmojiAnimations) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetAnimatedEmojiAnimations#cde3739 as nil")
}
b.PutID(InputStickerSetAnimatedEmojiAnimationsTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetAnimatedEmojiAnimations) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetAnimatedEmojiAnimations#cde3739 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetAnimatedEmojiAnimations) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetAnimatedEmojiAnimations#cde3739 to nil")
}
if err := b.ConsumeID(InputStickerSetAnimatedEmojiAnimationsTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetAnimatedEmojiAnimations#cde3739: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetAnimatedEmojiAnimations) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetAnimatedEmojiAnimations#cde3739 to nil")
}
return nil
}
// InputStickerSetPremiumGifts represents TL type `inputStickerSetPremiumGifts#c88b3b02`.
// Stickers to show when receiving a gifted Telegram Premium subscription
//
// See https://core.telegram.org/constructor/inputStickerSetPremiumGifts for reference.
type InputStickerSetPremiumGifts struct {
}
// InputStickerSetPremiumGiftsTypeID is TL type id of InputStickerSetPremiumGifts.
const InputStickerSetPremiumGiftsTypeID = 0xc88b3b02
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetPremiumGifts) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetPremiumGifts.
var (
_ bin.Encoder = &InputStickerSetPremiumGifts{}
_ bin.Decoder = &InputStickerSetPremiumGifts{}
_ bin.BareEncoder = &InputStickerSetPremiumGifts{}
_ bin.BareDecoder = &InputStickerSetPremiumGifts{}
_ InputStickerSetClass = &InputStickerSetPremiumGifts{}
)
func (i *InputStickerSetPremiumGifts) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetPremiumGifts) String() string {
if i == nil {
return "InputStickerSetPremiumGifts(nil)"
}
type Alias InputStickerSetPremiumGifts
return fmt.Sprintf("InputStickerSetPremiumGifts%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetPremiumGifts) TypeID() uint32 {
return InputStickerSetPremiumGiftsTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetPremiumGifts) TypeName() string {
return "inputStickerSetPremiumGifts"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetPremiumGifts) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetPremiumGifts",
ID: InputStickerSetPremiumGiftsTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetPremiumGifts) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetPremiumGifts#c88b3b02 as nil")
}
b.PutID(InputStickerSetPremiumGiftsTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetPremiumGifts) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetPremiumGifts#c88b3b02 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetPremiumGifts) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetPremiumGifts#c88b3b02 to nil")
}
if err := b.ConsumeID(InputStickerSetPremiumGiftsTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetPremiumGifts#c88b3b02: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetPremiumGifts) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetPremiumGifts#c88b3b02 to nil")
}
return nil
}
// InputStickerSetEmojiGenericAnimations represents TL type `inputStickerSetEmojiGenericAnimations#4c4d4ce`.
// Generic animation stickerset containing animations to play when reacting to messages
// using a normal emoji without a custom animation¹
//
// Links:
// 1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/constructor/inputStickerSetEmojiGenericAnimations for reference.
type InputStickerSetEmojiGenericAnimations struct {
}
// InputStickerSetEmojiGenericAnimationsTypeID is TL type id of InputStickerSetEmojiGenericAnimations.
const InputStickerSetEmojiGenericAnimationsTypeID = 0x4c4d4ce
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetEmojiGenericAnimations) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetEmojiGenericAnimations.
var (
_ bin.Encoder = &InputStickerSetEmojiGenericAnimations{}
_ bin.Decoder = &InputStickerSetEmojiGenericAnimations{}
_ bin.BareEncoder = &InputStickerSetEmojiGenericAnimations{}
_ bin.BareDecoder = &InputStickerSetEmojiGenericAnimations{}
_ InputStickerSetClass = &InputStickerSetEmojiGenericAnimations{}
)
func (i *InputStickerSetEmojiGenericAnimations) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetEmojiGenericAnimations) String() string {
if i == nil {
return "InputStickerSetEmojiGenericAnimations(nil)"
}
type Alias InputStickerSetEmojiGenericAnimations
return fmt.Sprintf("InputStickerSetEmojiGenericAnimations%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetEmojiGenericAnimations) TypeID() uint32 {
return InputStickerSetEmojiGenericAnimationsTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetEmojiGenericAnimations) TypeName() string {
return "inputStickerSetEmojiGenericAnimations"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetEmojiGenericAnimations) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetEmojiGenericAnimations",
ID: InputStickerSetEmojiGenericAnimationsTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetEmojiGenericAnimations) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiGenericAnimations#4c4d4ce as nil")
}
b.PutID(InputStickerSetEmojiGenericAnimationsTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetEmojiGenericAnimations) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiGenericAnimations#4c4d4ce as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetEmojiGenericAnimations) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiGenericAnimations#4c4d4ce to nil")
}
if err := b.ConsumeID(InputStickerSetEmojiGenericAnimationsTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetEmojiGenericAnimations#4c4d4ce: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetEmojiGenericAnimations) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiGenericAnimations#4c4d4ce to nil")
}
return nil
}
// InputStickerSetEmojiDefaultStatuses represents TL type `inputStickerSetEmojiDefaultStatuses#29d0f5ee`.
// Default custom emoji status¹ stickerset
//
// Links:
// 1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/inputStickerSetEmojiDefaultStatuses for reference.
type InputStickerSetEmojiDefaultStatuses struct {
}
// InputStickerSetEmojiDefaultStatusesTypeID is TL type id of InputStickerSetEmojiDefaultStatuses.
const InputStickerSetEmojiDefaultStatusesTypeID = 0x29d0f5ee
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetEmojiDefaultStatuses) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetEmojiDefaultStatuses.
var (
_ bin.Encoder = &InputStickerSetEmojiDefaultStatuses{}
_ bin.Decoder = &InputStickerSetEmojiDefaultStatuses{}
_ bin.BareEncoder = &InputStickerSetEmojiDefaultStatuses{}
_ bin.BareDecoder = &InputStickerSetEmojiDefaultStatuses{}
_ InputStickerSetClass = &InputStickerSetEmojiDefaultStatuses{}
)
func (i *InputStickerSetEmojiDefaultStatuses) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetEmojiDefaultStatuses) String() string {
if i == nil {
return "InputStickerSetEmojiDefaultStatuses(nil)"
}
type Alias InputStickerSetEmojiDefaultStatuses
return fmt.Sprintf("InputStickerSetEmojiDefaultStatuses%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetEmojiDefaultStatuses) TypeID() uint32 {
return InputStickerSetEmojiDefaultStatusesTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetEmojiDefaultStatuses) TypeName() string {
return "inputStickerSetEmojiDefaultStatuses"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetEmojiDefaultStatuses) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetEmojiDefaultStatuses",
ID: InputStickerSetEmojiDefaultStatusesTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetEmojiDefaultStatuses) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiDefaultStatuses#29d0f5ee as nil")
}
b.PutID(InputStickerSetEmojiDefaultStatusesTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetEmojiDefaultStatuses) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiDefaultStatuses#29d0f5ee as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetEmojiDefaultStatuses) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiDefaultStatuses#29d0f5ee to nil")
}
if err := b.ConsumeID(InputStickerSetEmojiDefaultStatusesTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetEmojiDefaultStatuses#29d0f5ee: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetEmojiDefaultStatuses) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiDefaultStatuses#29d0f5ee to nil")
}
return nil
}
// InputStickerSetEmojiDefaultTopicIcons represents TL type `inputStickerSetEmojiDefaultTopicIcons#44c1f8e9`.
// Default custom emoji¹ stickerset for forum topic icons²
//
// Links:
// 1. https://core.telegram.org/api/custom-emoji
// 2. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/inputStickerSetEmojiDefaultTopicIcons for reference.
type InputStickerSetEmojiDefaultTopicIcons struct {
}
// InputStickerSetEmojiDefaultTopicIconsTypeID is TL type id of InputStickerSetEmojiDefaultTopicIcons.
const InputStickerSetEmojiDefaultTopicIconsTypeID = 0x44c1f8e9
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetEmojiDefaultTopicIcons) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetEmojiDefaultTopicIcons.
var (
_ bin.Encoder = &InputStickerSetEmojiDefaultTopicIcons{}
_ bin.Decoder = &InputStickerSetEmojiDefaultTopicIcons{}
_ bin.BareEncoder = &InputStickerSetEmojiDefaultTopicIcons{}
_ bin.BareDecoder = &InputStickerSetEmojiDefaultTopicIcons{}
_ InputStickerSetClass = &InputStickerSetEmojiDefaultTopicIcons{}
)
func (i *InputStickerSetEmojiDefaultTopicIcons) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetEmojiDefaultTopicIcons) String() string {
if i == nil {
return "InputStickerSetEmojiDefaultTopicIcons(nil)"
}
type Alias InputStickerSetEmojiDefaultTopicIcons
return fmt.Sprintf("InputStickerSetEmojiDefaultTopicIcons%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetEmojiDefaultTopicIcons) TypeID() uint32 {
return InputStickerSetEmojiDefaultTopicIconsTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetEmojiDefaultTopicIcons) TypeName() string {
return "inputStickerSetEmojiDefaultTopicIcons"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetEmojiDefaultTopicIcons) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetEmojiDefaultTopicIcons",
ID: InputStickerSetEmojiDefaultTopicIconsTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetEmojiDefaultTopicIcons) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 as nil")
}
b.PutID(InputStickerSetEmojiDefaultTopicIconsTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetEmojiDefaultTopicIcons) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetEmojiDefaultTopicIcons) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 to nil")
}
if err := b.ConsumeID(InputStickerSetEmojiDefaultTopicIconsTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetEmojiDefaultTopicIcons#44c1f8e9: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetEmojiDefaultTopicIcons) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 to nil")
}
return nil
}
// InputStickerSetEmojiChannelDefaultStatuses represents TL type `inputStickerSetEmojiChannelDefaultStatuses#49748553`.
// Default custom emoji status¹ stickerset for channel statuses
//
// Links:
// 1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/inputStickerSetEmojiChannelDefaultStatuses for reference.
type InputStickerSetEmojiChannelDefaultStatuses struct {
}
// InputStickerSetEmojiChannelDefaultStatusesTypeID is TL type id of InputStickerSetEmojiChannelDefaultStatuses.
const InputStickerSetEmojiChannelDefaultStatusesTypeID = 0x49748553
// construct implements constructor of InputStickerSetClass.
func (i InputStickerSetEmojiChannelDefaultStatuses) construct() InputStickerSetClass { return &i }
// Ensuring interfaces in compile-time for InputStickerSetEmojiChannelDefaultStatuses.
var (
_ bin.Encoder = &InputStickerSetEmojiChannelDefaultStatuses{}
_ bin.Decoder = &InputStickerSetEmojiChannelDefaultStatuses{}
_ bin.BareEncoder = &InputStickerSetEmojiChannelDefaultStatuses{}
_ bin.BareDecoder = &InputStickerSetEmojiChannelDefaultStatuses{}
_ InputStickerSetClass = &InputStickerSetEmojiChannelDefaultStatuses{}
)
func (i *InputStickerSetEmojiChannelDefaultStatuses) Zero() bool {
if i == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (i *InputStickerSetEmojiChannelDefaultStatuses) String() string {
if i == nil {
return "InputStickerSetEmojiChannelDefaultStatuses(nil)"
}
type Alias InputStickerSetEmojiChannelDefaultStatuses
return fmt.Sprintf("InputStickerSetEmojiChannelDefaultStatuses%+v", Alias(*i))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetEmojiChannelDefaultStatuses) TypeID() uint32 {
return InputStickerSetEmojiChannelDefaultStatusesTypeID
}
// TypeName returns name of type in TL schema.
func (*InputStickerSetEmojiChannelDefaultStatuses) TypeName() string {
return "inputStickerSetEmojiChannelDefaultStatuses"
}
// TypeInfo returns info about TL type.
func (i *InputStickerSetEmojiChannelDefaultStatuses) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "inputStickerSetEmojiChannelDefaultStatuses",
ID: InputStickerSetEmojiChannelDefaultStatusesTypeID,
}
if i == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (i *InputStickerSetEmojiChannelDefaultStatuses) Encode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiChannelDefaultStatuses#49748553 as nil")
}
b.PutID(InputStickerSetEmojiChannelDefaultStatusesTypeID)
return i.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (i *InputStickerSetEmojiChannelDefaultStatuses) EncodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't encode inputStickerSetEmojiChannelDefaultStatuses#49748553 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (i *InputStickerSetEmojiChannelDefaultStatuses) Decode(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiChannelDefaultStatuses#49748553 to nil")
}
if err := b.ConsumeID(InputStickerSetEmojiChannelDefaultStatusesTypeID); err != nil {
return fmt.Errorf("unable to decode inputStickerSetEmojiChannelDefaultStatuses#49748553: %w", err)
}
return i.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (i *InputStickerSetEmojiChannelDefaultStatuses) DecodeBare(b *bin.Buffer) error {
if i == nil {
return fmt.Errorf("can't decode inputStickerSetEmojiChannelDefaultStatuses#49748553 to nil")
}
return nil
}
// InputStickerSetClassName is schema name of InputStickerSetClass.
const InputStickerSetClassName = "InputStickerSet"
// InputStickerSetClass represents InputStickerSet generic type.
//
// See https://core.telegram.org/type/InputStickerSet for reference.
//
// Example:
//
// g, err := tg.DecodeInputStickerSet(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tg.InputStickerSetEmpty: // inputStickerSetEmpty#ffb62b95
// case *tg.InputStickerSetID: // inputStickerSetID#9de7a269
// case *tg.InputStickerSetShortName: // inputStickerSetShortName#861cc8a0
// case *tg.InputStickerSetAnimatedEmoji: // inputStickerSetAnimatedEmoji#28703c8
// case *tg.InputStickerSetDice: // inputStickerSetDice#e67f520e
// case *tg.InputStickerSetAnimatedEmojiAnimations: // inputStickerSetAnimatedEmojiAnimations#cde3739
// case *tg.InputStickerSetPremiumGifts: // inputStickerSetPremiumGifts#c88b3b02
// case *tg.InputStickerSetEmojiGenericAnimations: // inputStickerSetEmojiGenericAnimations#4c4d4ce
// case *tg.InputStickerSetEmojiDefaultStatuses: // inputStickerSetEmojiDefaultStatuses#29d0f5ee
// case *tg.InputStickerSetEmojiDefaultTopicIcons: // inputStickerSetEmojiDefaultTopicIcons#44c1f8e9
// case *tg.InputStickerSetEmojiChannelDefaultStatuses: // inputStickerSetEmojiChannelDefaultStatuses#49748553
// default: panic(v)
// }
type InputStickerSetClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() InputStickerSetClass
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
TypeID() uint32
// TypeName returns name of type in TL schema.
TypeName() string
// String implements fmt.Stringer.
String() string
// Zero returns true if current object has a zero value.
Zero() bool
}
// DecodeInputStickerSet implements binary de-serialization for InputStickerSetClass.
func DecodeInputStickerSet(buf *bin.Buffer) (InputStickerSetClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case InputStickerSetEmptyTypeID:
// Decoding inputStickerSetEmpty#ffb62b95.
v := InputStickerSetEmpty{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetIDTypeID:
// Decoding inputStickerSetID#9de7a269.
v := InputStickerSetID{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetShortNameTypeID:
// Decoding inputStickerSetShortName#861cc8a0.
v := InputStickerSetShortName{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetAnimatedEmojiTypeID:
// Decoding inputStickerSetAnimatedEmoji#28703c8.
v := InputStickerSetAnimatedEmoji{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetDiceTypeID:
// Decoding inputStickerSetDice#e67f520e.
v := InputStickerSetDice{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetAnimatedEmojiAnimationsTypeID:
// Decoding inputStickerSetAnimatedEmojiAnimations#cde3739.
v := InputStickerSetAnimatedEmojiAnimations{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetPremiumGiftsTypeID:
// Decoding inputStickerSetPremiumGifts#c88b3b02.
v := InputStickerSetPremiumGifts{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetEmojiGenericAnimationsTypeID:
// Decoding inputStickerSetEmojiGenericAnimations#4c4d4ce.
v := InputStickerSetEmojiGenericAnimations{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetEmojiDefaultStatusesTypeID:
// Decoding inputStickerSetEmojiDefaultStatuses#29d0f5ee.
v := InputStickerSetEmojiDefaultStatuses{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetEmojiDefaultTopicIconsTypeID:
// Decoding inputStickerSetEmojiDefaultTopicIcons#44c1f8e9.
v := InputStickerSetEmojiDefaultTopicIcons{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
case InputStickerSetEmojiChannelDefaultStatusesTypeID:
// Decoding inputStickerSetEmojiChannelDefaultStatuses#49748553.
v := InputStickerSetEmojiChannelDefaultStatuses{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", bin.NewUnexpectedID(id))
}
}
// InputStickerSet boxes the InputStickerSetClass providing a helper.
type InputStickerSetBox struct {
InputStickerSet InputStickerSetClass
}
// Decode implements bin.Decoder for InputStickerSetBox.
func (b *InputStickerSetBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode InputStickerSetBox to nil")
}
v, err := DecodeInputStickerSet(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.InputStickerSet = v
return nil
}
// Encode implements bin.Encode for InputStickerSetBox.
func (b *InputStickerSetBox) Encode(buf *bin.Buffer) error {
if b == nil || b.InputStickerSet == nil {
return fmt.Errorf("unable to encode InputStickerSetClass as nil")
}
return b.InputStickerSet.Encode(buf)
}