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

// BotsGetBotRecommendationsRequest represents TL type `bots.getBotRecommendations#a1b70815`.
// Obtain a list of similarly themed bots, selected based on similarities in their
// subscriber bases, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/recommend
//
// See https://core.telegram.org/method/bots.getBotRecommendations for reference.
type BotsGetBotRecommendationsRequest struct {
	// The method will return bots related to the passed bot.
	Bot InputUserClass
}

// BotsGetBotRecommendationsRequestTypeID is TL type id of BotsGetBotRecommendationsRequest.
const BotsGetBotRecommendationsRequestTypeID = 0xa1b70815

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

func ( *BotsGetBotRecommendationsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Bot == nil) {
		return false
	}

	return true
}

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

// FillFrom fills BotsGetBotRecommendationsRequest from given interface.
func ( *BotsGetBotRecommendationsRequest) ( interface {
	() ( InputUserClass)
}) {
	.Bot = .()
}

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

// TypeName returns name of type in TL schema.
func (*BotsGetBotRecommendationsRequest) () string {
	return "bots.getBotRecommendations"
}

// TypeInfo returns info about TL type.
func ( *BotsGetBotRecommendationsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "bots.getBotRecommendations",
		ID:   BotsGetBotRecommendationsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Bot",
			SchemaName: "bot",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotsGetBotRecommendationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getBotRecommendations#a1b70815 as nil")
	}
	.PutID(BotsGetBotRecommendationsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotsGetBotRecommendationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getBotRecommendations#a1b70815 as nil")
	}
	if .Bot == nil {
		return fmt.Errorf("unable to encode bots.getBotRecommendations#a1b70815: field bot is nil")
	}
	if  := .Bot.Encode();  != nil {
		return fmt.Errorf("unable to encode bots.getBotRecommendations#a1b70815: field bot: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *BotsGetBotRecommendationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.getBotRecommendations#a1b70815 to nil")
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode bots.getBotRecommendations#a1b70815: field bot: %w", )
		}
		.Bot = 
	}
	return nil
}

// GetBot returns value of Bot field.
func ( *BotsGetBotRecommendationsRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .Bot
}

// BotsGetBotRecommendations invokes method bots.getBotRecommendations#a1b70815 returning error if any.
// Obtain a list of similarly themed bots, selected based on similarities in their
// subscriber bases, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/recommend
//
// Possible errors:
//
//	400 BOT_INVALID: This is not a valid bot.
//
// See https://core.telegram.org/method/bots.getBotRecommendations for reference.
func ( *Client) ( context.Context,  InputUserClass) (UsersUsersClass, error) {
	var  UsersUsersBox

	 := &BotsGetBotRecommendationsRequest{
		Bot: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Users, nil
}