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

// BotCommand represents TL type `botCommand#c27ac8c7`.
// Describes a bot command that can be used in a chat
//
// See https://core.telegram.org/constructor/botCommand for reference.
type BotCommand struct {
	// /command name
	Command string
	// Description of the command
	Description string
}

// BotCommandTypeID is TL type id of BotCommand.
const BotCommandTypeID = 0xc27ac8c7

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

func ( *BotCommand) () bool {
	if  == nil {
		return true
	}
	if !(.Command == "") {
		return false
	}
	if !(.Description == "") {
		return false
	}

	return true
}

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

// FillFrom fills BotCommand from given interface.
func ( *BotCommand) ( interface {
	() ( string)
	() ( string)
}) {
	.Command = .()
	.Description = .()
}

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

// TypeName returns name of type in TL schema.
func (*BotCommand) () string {
	return "botCommand"
}

// TypeInfo returns info about TL type.
func ( *BotCommand) () tdp.Type {
	 := tdp.Type{
		Name: "botCommand",
		ID:   BotCommandTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Command",
			SchemaName: "command",
		},
		{
			Name:       "Description",
			SchemaName: "description",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode botCommand#c27ac8c7 as nil")
	}
	.PutID(BotCommandTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode botCommand#c27ac8c7 as nil")
	}
	.PutString(.Command)
	.PutString(.Description)
	return nil
}

// Decode implements bin.Decoder.
func ( *BotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode botCommand#c27ac8c7 to nil")
	}
	if  := .ConsumeID(BotCommandTypeID);  != nil {
		return fmt.Errorf("unable to decode botCommand#c27ac8c7: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *BotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode botCommand#c27ac8c7 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode botCommand#c27ac8c7: field command: %w", )
		}
		.Command = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode botCommand#c27ac8c7: field description: %w", )
		}
		.Description = 
	}
	return nil
}

// GetCommand returns value of Command field.
func ( *BotCommand) () ( string) {
	if  == nil {
		return
	}
	return .Command
}

// GetDescription returns value of Description field.
func ( *BotCommand) () ( string) {
	if  == nil {
		return
	}
	return .Description
}