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

// MessagesSendMediaRequest represents TL type `messages.sendMedia#72ccc23d`.
// Send a media
//
// See https://core.telegram.org/method/messages.sendMedia for reference.
type MessagesSendMediaRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Send message silently (no notification should be triggered)
	Silent bool
	// Send message in background
	Background bool
	// Clear the draft
	ClearDraft bool
	// Only for bots, disallows forwarding and saving of the messages, even if the
	// destination chat doesn't have content protection¹ enabled
	//
	// Links:
	//  1) https://telegram.org/blog/protected-content-delete-by-date-and-more
	Noforwards bool
	// Whether to move used stickersets to top, see here for more info on this flag »¹
	//
	// Links:
	//  1) https://core.telegram.org/api/stickers#recent-stickersets
	UpdateStickersetsOrder bool
	// If set, any eventual webpage preview will be shown on top of the message instead of at
	// the bottom.
	InvertMedia bool
	// Destination
	Peer InputPeerClass
	// If set, indicates that the message should be sent in reply to the specified message or
	// story.
	//
	// Use SetReplyTo and GetReplyTo helpers.
	ReplyTo InputReplyToClass
	// Attached media
	Media InputMediaClass
	// Caption
	Message string
	// Random ID to avoid resending the same message
	RandomID int64
	// Reply markup for bot keyboards
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
	// Message entities¹ for styled text
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Scheduled message date for scheduled messages¹
	//
	// Links:
	//  1) https://core.telegram.org/api/scheduled-messages
	//
	// Use SetScheduleDate and GetScheduleDate helpers.
	ScheduleDate int
	// Send this message as the specified peer
	//
	// Use SetSendAs and GetSendAs helpers.
	SendAs InputPeerClass
}

// MessagesSendMediaRequestTypeID is TL type id of MessagesSendMediaRequest.
const MessagesSendMediaRequestTypeID = 0x72ccc23d

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

func ( *MessagesSendMediaRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Silent == false) {
		return false
	}
	if !(.Background == false) {
		return false
	}
	if !(.ClearDraft == false) {
		return false
	}
	if !(.Noforwards == false) {
		return false
	}
	if !(.UpdateStickersetsOrder == false) {
		return false
	}
	if !(.InvertMedia == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.ReplyTo == nil) {
		return false
	}
	if !(.Media == nil) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.RandomID == 0) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.ScheduleDate == 0) {
		return false
	}
	if !(.SendAs == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesSendMediaRequest from given interface.
func ( *MessagesSendMediaRequest) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( InputPeerClass)
	() ( InputReplyToClass,  bool)
	() ( InputMediaClass)
	() ( string)
	() ( int64)
	() ( ReplyMarkupClass,  bool)
	() ( []MessageEntityClass,  bool)
	() ( int,  bool)
	() ( InputPeerClass,  bool)
}) {
	.Silent = .()
	.Background = .()
	.ClearDraft = .()
	.Noforwards = .()
	.UpdateStickersetsOrder = .()
	.InvertMedia = .()
	.Peer = .()
	if ,  := .();  {
		.ReplyTo = 
	}

	.Media = .()
	.Message = .()
	.RandomID = .()
	if ,  := .();  {
		.ReplyMarkup = 
	}

	if ,  := .();  {
		.Entities = 
	}

	if ,  := .();  {
		.ScheduleDate = 
	}

	if ,  := .();  {
		.SendAs = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesSendMediaRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.sendMedia",
		ID:   MessagesSendMediaRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Silent",
			SchemaName: "silent",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Background",
			SchemaName: "background",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "ClearDraft",
			SchemaName: "clear_draft",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "Noforwards",
			SchemaName: "noforwards",
			Null:       !.Flags.Has(14),
		},
		{
			Name:       "UpdateStickersetsOrder",
			SchemaName: "update_stickersets_order",
			Null:       !.Flags.Has(15),
		},
		{
			Name:       "InvertMedia",
			SchemaName: "invert_media",
			Null:       !.Flags.Has(16),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "ReplyTo",
			SchemaName: "reply_to",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Media",
			SchemaName: "media",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "RandomID",
			SchemaName: "random_id",
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "ScheduleDate",
			SchemaName: "schedule_date",
			Null:       !.Flags.Has(10),
		},
		{
			Name:       "SendAs",
			SchemaName: "send_as",
			Null:       !.Flags.Has(13),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessagesSendMediaRequest) () {
	if !(.Silent == false) {
		.Flags.Set(5)
	}
	if !(.Background == false) {
		.Flags.Set(6)
	}
	if !(.ClearDraft == false) {
		.Flags.Set(7)
	}
	if !(.Noforwards == false) {
		.Flags.Set(14)
	}
	if !(.UpdateStickersetsOrder == false) {
		.Flags.Set(15)
	}
	if !(.InvertMedia == false) {
		.Flags.Set(16)
	}
	if !(.ReplyTo == nil) {
		.Flags.Set(0)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
	if !(.Entities == nil) {
		.Flags.Set(3)
	}
	if !(.ScheduleDate == 0) {
		.Flags.Set(10)
	}
	if !(.SendAs == nil) {
		.Flags.Set(13)
	}
}

// Encode implements bin.Encoder.
func ( *MessagesSendMediaRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.sendMedia#72ccc23d as nil")
	}
	.PutID(MessagesSendMediaRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesSendMediaRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.sendMedia#72ccc23d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field peer: %w", )
	}
	if .Flags.Has(0) {
		if .ReplyTo == nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field reply_to is nil")
		}
		if  := .ReplyTo.Encode();  != nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field reply_to: %w", )
		}
	}
	if .Media == nil {
		return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field media is nil")
	}
	if  := .Media.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field media: %w", )
	}
	.PutString(.Message)
	.PutLong(.RandomID)
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field reply_markup: %w", )
		}
	}
	if .Flags.Has(3) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(10) {
		.PutInt(.ScheduleDate)
	}
	if .Flags.Has(13) {
		if .SendAs == nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field send_as is nil")
		}
		if  := .SendAs.Encode();  != nil {
			return fmt.Errorf("unable to encode messages.sendMedia#72ccc23d: field send_as: %w", )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesSendMediaRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.sendMedia#72ccc23d to nil")
	}
	if  := .ConsumeID(MessagesSendMediaRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesSendMediaRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.sendMedia#72ccc23d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field flags: %w", )
		}
	}
	.Silent = .Flags.Has(5)
	.Background = .Flags.Has(6)
	.ClearDraft = .Flags.Has(7)
	.Noforwards = .Flags.Has(14)
	.UpdateStickersetsOrder = .Flags.Has(15)
	.InvertMedia = .Flags.Has(16)
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := DecodeInputReplyTo()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field reply_to: %w", )
		}
		.ReplyTo = 
	}
	{
		,  := DecodeInputMedia()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field media: %w", )
		}
		.Media = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field random_id: %w", )
		}
		.RandomID = 
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	if .Flags.Has(3) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(10) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field schedule_date: %w", )
		}
		.ScheduleDate = 
	}
	if .Flags.Has(13) {
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendMedia#72ccc23d: field send_as: %w", )
		}
		.SendAs = 
	}
	return nil
}

// SetSilent sets value of Silent conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(5)
		.Silent = true
	} else {
		.Flags.Unset(5)
		.Silent = false
	}
}

// GetSilent returns value of Silent conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetBackground sets value of Background conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(6)
		.Background = true
	} else {
		.Flags.Unset(6)
		.Background = false
	}
}

// GetBackground returns value of Background conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(6)
}

// SetClearDraft sets value of ClearDraft conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(7)
		.ClearDraft = true
	} else {
		.Flags.Unset(7)
		.ClearDraft = false
	}
}

// GetClearDraft returns value of ClearDraft conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(7)
}

// SetNoforwards sets value of Noforwards conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(14)
		.Noforwards = true
	} else {
		.Flags.Unset(14)
		.Noforwards = false
	}
}

// GetNoforwards returns value of Noforwards conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(14)
}

// SetUpdateStickersetsOrder sets value of UpdateStickersetsOrder conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(15)
		.UpdateStickersetsOrder = true
	} else {
		.Flags.Unset(15)
		.UpdateStickersetsOrder = false
	}
}

// GetUpdateStickersetsOrder returns value of UpdateStickersetsOrder conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(15)
}

// SetInvertMedia sets value of InvertMedia conditional field.
func ( *MessagesSendMediaRequest) ( bool) {
	if  {
		.Flags.Set(16)
		.InvertMedia = true
	} else {
		.Flags.Unset(16)
		.InvertMedia = false
	}
}

// GetInvertMedia returns value of InvertMedia conditional field.
func ( *MessagesSendMediaRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(16)
}

// GetPeer returns value of Peer field.
func ( *MessagesSendMediaRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetReplyTo sets value of ReplyTo conditional field.
func ( *MessagesSendMediaRequest) ( InputReplyToClass) {
	.Flags.Set(0)
	.ReplyTo = 
}

// GetReplyTo returns value of ReplyTo conditional field and
// boolean which is true if field was set.
func ( *MessagesSendMediaRequest) () ( InputReplyToClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .ReplyTo, true
}

// GetMedia returns value of Media field.
func ( *MessagesSendMediaRequest) () ( InputMediaClass) {
	if  == nil {
		return
	}
	return .Media
}

// GetMessage returns value of Message field.
func ( *MessagesSendMediaRequest) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// GetRandomID returns value of RandomID field.
func ( *MessagesSendMediaRequest) () ( int64) {
	if  == nil {
		return
	}
	return .RandomID
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *MessagesSendMediaRequest) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *MessagesSendMediaRequest) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// SetEntities sets value of Entities conditional field.
func ( *MessagesSendMediaRequest) ( []MessageEntityClass) {
	.Flags.Set(3)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *MessagesSendMediaRequest) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .Entities, true
}

// SetScheduleDate sets value of ScheduleDate conditional field.
func ( *MessagesSendMediaRequest) ( int) {
	.Flags.Set(10)
	.ScheduleDate = 
}

// GetScheduleDate returns value of ScheduleDate conditional field and
// boolean which is true if field was set.
func ( *MessagesSendMediaRequest) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(10) {
		return , false
	}
	return .ScheduleDate, true
}

// SetSendAs sets value of SendAs conditional field.
func ( *MessagesSendMediaRequest) ( InputPeerClass) {
	.Flags.Set(13)
	.SendAs = 
}

// GetSendAs returns value of SendAs conditional field and
// boolean which is true if field was set.
func ( *MessagesSendMediaRequest) () ( InputPeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(13) {
		return , false
	}
	return .SendAs, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *MessagesSendMediaRequest) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(3) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// MessagesSendMedia invokes method messages.sendMedia#72ccc23d returning error if any.
// Send a media
//
// Possible errors:
//
//	400 BOT_PAYMENTS_DISABLED: Please enable bot payments in botfather before calling this method.
//	400 BROADCAST_PUBLIC_VOTERS_FORBIDDEN: You can't forward polls with public voters.
//	400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid.
//	400 BUTTON_TYPE_INVALID: The type of one or more of the buttons you provided is invalid.
//	400 BUTTON_URL_INVALID: Button URL invalid.
//	400 CHANNEL_INVALID: The provided channel is invalid.
//	406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup.
//	403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this.
//	400 CHAT_FORWARDS_RESTRICTED: You can't forward messages from a protected chat.
//	403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info.
//	400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted.
//	403 CHAT_SEND_AUDIOS_FORBIDDEN: You can't send audio messages in this chat.
//	403 CHAT_SEND_DOCS_FORBIDDEN: You can't send documents in this chat.
//	403 CHAT_SEND_GIFS_FORBIDDEN: You can't send gifs in this chat.
//	403 CHAT_SEND_MEDIA_FORBIDDEN: You can't send media in this chat.
//	403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat.
//	403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat.
//	403 CHAT_SEND_POLL_FORBIDDEN: You can't send polls in this chat.
//	403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat.
//	403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat.
//	403 CHAT_SEND_VOICES_FORBIDDEN: You can't send voice recordings in this chat.
//	403 CHAT_WRITE_FORBIDDEN: You can't write in this chat.
//	400 CURRENCY_TOTAL_AMOUNT_INVALID: The total amount of all prices is invalid.
//	400 DOCUMENT_INVALID: The specified document is invalid.
//	400 EMOTICON_INVALID: The specified emoji is invalid.
//	400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length.
//	400 EXTERNAL_URL_INVALID: External URL invalid.
//	400 FILE_PARTS_INVALID: The number of file parts is invalid.
//	400 FILE_PART_LENGTH_INVALID: The length of a file part is invalid.
//	400 FILE_REFERENCE_EMPTY: An empty file reference was specified.
//	400 FILE_REFERENCE_EXPIRED: File reference expired, it must be refetched as described in the documentation.
//	400 GAME_BOT_INVALID: Bots can't send another bot's game.
//	400 IMAGE_PROCESS_FAILED: Failure while processing image.
//	400 INPUT_USER_DEACTIVATED: The specified user was deleted.
//	400 MD5_CHECKSUM_INVALID: The MD5 checksums do not match.
//	400 MEDIA_CAPTION_TOO_LONG: The caption is too long.
//	400 MEDIA_EMPTY: The provided media object is invalid.
//	400 MEDIA_INVALID: Media invalid.
//	400 MESSAGE_EMPTY: The provided message is empty.
//	400 MSG_ID_INVALID: Invalid message ID provided.
//	400 PAYMENT_PROVIDER_INVALID: The specified payment provider is invalid.
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//	400 PHOTO_EXT_INVALID: The extension of the photo is invalid.
//	400 PHOTO_INVALID_DIMENSIONS: The photo dimensions are invalid.
//	400 PHOTO_SAVE_FILE_INVALID: Internal issues, try again later.
//	400 POLL_ANSWERS_INVALID: Invalid poll answers were provided.
//	400 POLL_ANSWER_INVALID: One of the poll answers is not acceptable.
//	400 POLL_OPTION_DUPLICATE: Duplicate poll options provided.
//	400 POLL_OPTION_INVALID: Invalid poll option provided.
//	400 POLL_QUESTION_INVALID: One of the poll questions is not acceptable.
//	403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action.
//	400 QUIZ_CORRECT_ANSWERS_EMPTY: No correct quiz answer was specified.
//	400 QUIZ_CORRECT_ANSWERS_TOO_MUCH: You specified too many correct answers in a quiz, quizzes can only have one right answer!
//	400 QUIZ_CORRECT_ANSWER_INVALID: An invalid value was provided to the correct_answers field.
//	400 QUIZ_MULTIPLE_INVALID: Quizzes can't have the multiple_choice flag set!
//	500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used.
//	400 REPLY_MARKUP_BUY_EMPTY: Reply markup for buy button empty.
//	400 REPLY_MARKUP_INVALID: The provided reply markup is invalid.
//	400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long.
//	400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages.
//	400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future.
//	400 SCHEDULE_TOO_MUCH: There are too many scheduled messages.
//	400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer.
//	420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat.
//	406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore.
//	406 TOPIC_DELETED: The specified topic was deleted.
//	400 TTL_MEDIA_INVALID: Invalid media Time To Live was provided.
//	400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels.
//	403 USER_IS_BLOCKED: You were blocked by this user.
//	400 USER_IS_BOT: Bots can't send messages to other bots.
//	400 VIDEO_CONTENT_TYPE_INVALID: The video's content type is invalid.
//	400 VOICE_MESSAGES_FORBIDDEN: This user's privacy settings forbid you from sending voice messages.
//	400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided.
//	400 WEBPAGE_CURL_FAILED: Failure while fetching the webpage with cURL.
//	400 WEBPAGE_MEDIA_EMPTY: Webpage media empty.
//	400 WEBPAGE_NOT_FOUND: A preview for the specified webpage url could not be generated.
//	400 WEBPAGE_URL_INVALID: The specified webpage url is invalid.
//	400 YOU_BLOCKED_USER: You blocked this user.
//
// See https://core.telegram.org/method/messages.sendMedia for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *MessagesSendMediaRequest) (UpdatesClass, error) {
	var  UpdatesBox

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