// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// 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{}
)

// MessagesGetEmojiGroupsRequest represents TL type `messages.getEmojiGroups#7488ce5b`.
// Represents a list of emoji categories¹, to be used when selecting custom emojis².
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-categories
//  2. https://core.telegram.org/api/custom-emoji
//
// See https://core.telegram.org/method/messages.getEmojiGroups for reference.
type MessagesGetEmojiGroupsRequest struct {
	// Hash for pagination, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// MessagesGetEmojiGroupsRequestTypeID is TL type id of MessagesGetEmojiGroupsRequest.
const MessagesGetEmojiGroupsRequestTypeID = 0x7488ce5b

// Ensuring interfaces in compile-time for MessagesGetEmojiGroupsRequest.
var (
	_ bin.Encoder     = &MessagesGetEmojiGroupsRequest{}
	_ bin.Decoder     = &MessagesGetEmojiGroupsRequest{}
	_ bin.BareEncoder = &MessagesGetEmojiGroupsRequest{}
	_ bin.BareDecoder = &MessagesGetEmojiGroupsRequest{}
)

func ( *MessagesGetEmojiGroupsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessagesGetEmojiGroupsRequest) () string {
	if  == nil {
		return "MessagesGetEmojiGroupsRequest(nil)"
	}
	type  MessagesGetEmojiGroupsRequest
	return fmt.Sprintf("MessagesGetEmojiGroupsRequest%+v", (*))
}

// FillFrom fills MessagesGetEmojiGroupsRequest from given interface.
func ( *MessagesGetEmojiGroupsRequest) ( interface {
	() ( int)
}) {
	.Hash = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessagesGetEmojiGroupsRequest) () uint32 {
	return MessagesGetEmojiGroupsRequestTypeID
}

// TypeName returns name of type in TL schema.
func (*MessagesGetEmojiGroupsRequest) () string {
	return "messages.getEmojiGroups"
}

// TypeInfo returns info about TL type.
func ( *MessagesGetEmojiGroupsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getEmojiGroups",
		ID:   MessagesGetEmojiGroupsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetEmojiGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiGroups#7488ce5b as nil")
	}
	.PutID(MessagesGetEmojiGroupsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetEmojiGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiGroups#7488ce5b as nil")
	}
	.PutInt(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetEmojiGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiGroups#7488ce5b to nil")
	}
	if  := .ConsumeID(MessagesGetEmojiGroupsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getEmojiGroups#7488ce5b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetEmojiGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiGroups#7488ce5b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiGroups#7488ce5b: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *MessagesGetEmojiGroupsRequest) () ( int) {
	if  == nil {
		return
	}
	return .Hash
}

// MessagesGetEmojiGroups invokes method messages.getEmojiGroups#7488ce5b returning error if any.
// Represents a list of emoji categories¹, to be used when selecting custom emojis².
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-categories
//  2. https://core.telegram.org/api/custom-emoji
//
// See https://core.telegram.org/method/messages.getEmojiGroups for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  int) (MessagesEmojiGroupsClass, error) {
	var  MessagesEmojiGroupsBox

	 := &MessagesGetEmojiGroupsRequest{
		Hash: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .EmojiGroups, nil
}