//go:build !no_gotd_slices
// +build !no_gotd_slices

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

// InputBotInlineMessageClassArray is adapter for slice of InputBotInlineMessageClass.
type InputBotInlineMessageClassArray []InputBotInlineMessageClass

// Sort sorts slice of InputBotInlineMessageClass.
func ( InputBotInlineMessageClassArray) ( func(,  InputBotInlineMessageClass) bool) InputBotInlineMessageClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageClass.
func ( InputBotInlineMessageClassArray) ( func(,  InputBotInlineMessageClass) bool) InputBotInlineMessageClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageClass.
func ( InputBotInlineMessageClassArray) ( func( InputBotInlineMessageClass) bool) InputBotInlineMessageClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageClassArray) () ( InputBotInlineMessageClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageClassArray) () ( InputBotInlineMessageClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsInputBotInlineMessageMediaAuto returns copy with only InputBotInlineMessageMediaAuto constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaAutoArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaAuto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageText returns copy with only InputBotInlineMessageText constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageTextArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageText)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageMediaGeo returns copy with only InputBotInlineMessageMediaGeo constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaGeoArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaGeo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageMediaVenue returns copy with only InputBotInlineMessageMediaVenue constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaVenueArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageMediaContact returns copy with only InputBotInlineMessageMediaContact constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaContactArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaContact)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageGame returns copy with only InputBotInlineMessageGame constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageGameArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageGame)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageMediaInvoice returns copy with only InputBotInlineMessageMediaInvoice constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaInvoiceArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaInvoice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineMessageMediaWebPage returns copy with only InputBotInlineMessageMediaWebPage constructors.
func ( InputBotInlineMessageClassArray) () ( InputBotInlineMessageMediaWebPageArray) {
	for ,  := range  {
		,  := .(*InputBotInlineMessageMediaWebPage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputBotInlineMessageMediaAutoArray is adapter for slice of InputBotInlineMessageMediaAuto.
type InputBotInlineMessageMediaAutoArray []InputBotInlineMessageMediaAuto

// Sort sorts slice of InputBotInlineMessageMediaAuto.
func ( InputBotInlineMessageMediaAutoArray) ( func(,  InputBotInlineMessageMediaAuto) bool) InputBotInlineMessageMediaAutoArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaAuto.
func ( InputBotInlineMessageMediaAutoArray) ( func(,  InputBotInlineMessageMediaAuto) bool) InputBotInlineMessageMediaAutoArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaAuto.
func ( InputBotInlineMessageMediaAutoArray) ( func( InputBotInlineMessageMediaAuto) bool) InputBotInlineMessageMediaAutoArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaAutoArray) () ( InputBotInlineMessageMediaAuto,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaAutoArray) () ( InputBotInlineMessageMediaAuto,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaAutoArray) () ( InputBotInlineMessageMediaAuto,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaAuto
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaAutoArray) () ( InputBotInlineMessageMediaAuto,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageTextArray is adapter for slice of InputBotInlineMessageText.
type InputBotInlineMessageTextArray []InputBotInlineMessageText

// Sort sorts slice of InputBotInlineMessageText.
func ( InputBotInlineMessageTextArray) ( func(,  InputBotInlineMessageText) bool) InputBotInlineMessageTextArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageText.
func ( InputBotInlineMessageTextArray) ( func(,  InputBotInlineMessageText) bool) InputBotInlineMessageTextArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageText.
func ( InputBotInlineMessageTextArray) ( func( InputBotInlineMessageText) bool) InputBotInlineMessageTextArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageTextArray) () ( InputBotInlineMessageText,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageTextArray) () ( InputBotInlineMessageText,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageTextArray) () ( InputBotInlineMessageText,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageText
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageTextArray) () ( InputBotInlineMessageText,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageMediaGeoArray is adapter for slice of InputBotInlineMessageMediaGeo.
type InputBotInlineMessageMediaGeoArray []InputBotInlineMessageMediaGeo

// Sort sorts slice of InputBotInlineMessageMediaGeo.
func ( InputBotInlineMessageMediaGeoArray) ( func(,  InputBotInlineMessageMediaGeo) bool) InputBotInlineMessageMediaGeoArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaGeo.
func ( InputBotInlineMessageMediaGeoArray) ( func(,  InputBotInlineMessageMediaGeo) bool) InputBotInlineMessageMediaGeoArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaGeo.
func ( InputBotInlineMessageMediaGeoArray) ( func( InputBotInlineMessageMediaGeo) bool) InputBotInlineMessageMediaGeoArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaGeoArray) () ( InputBotInlineMessageMediaGeo,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaGeoArray) () ( InputBotInlineMessageMediaGeo,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaGeoArray) () ( InputBotInlineMessageMediaGeo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaGeo
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaGeoArray) () ( InputBotInlineMessageMediaGeo,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageMediaVenueArray is adapter for slice of InputBotInlineMessageMediaVenue.
type InputBotInlineMessageMediaVenueArray []InputBotInlineMessageMediaVenue

// Sort sorts slice of InputBotInlineMessageMediaVenue.
func ( InputBotInlineMessageMediaVenueArray) ( func(,  InputBotInlineMessageMediaVenue) bool) InputBotInlineMessageMediaVenueArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaVenue.
func ( InputBotInlineMessageMediaVenueArray) ( func(,  InputBotInlineMessageMediaVenue) bool) InputBotInlineMessageMediaVenueArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaVenue.
func ( InputBotInlineMessageMediaVenueArray) ( func( InputBotInlineMessageMediaVenue) bool) InputBotInlineMessageMediaVenueArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaVenueArray) () ( InputBotInlineMessageMediaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaVenueArray) () ( InputBotInlineMessageMediaVenue,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaVenueArray) () ( InputBotInlineMessageMediaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaVenue
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaVenueArray) () ( InputBotInlineMessageMediaVenue,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageMediaContactArray is adapter for slice of InputBotInlineMessageMediaContact.
type InputBotInlineMessageMediaContactArray []InputBotInlineMessageMediaContact

// Sort sorts slice of InputBotInlineMessageMediaContact.
func ( InputBotInlineMessageMediaContactArray) ( func(,  InputBotInlineMessageMediaContact) bool) InputBotInlineMessageMediaContactArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaContact.
func ( InputBotInlineMessageMediaContactArray) ( func(,  InputBotInlineMessageMediaContact) bool) InputBotInlineMessageMediaContactArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaContact.
func ( InputBotInlineMessageMediaContactArray) ( func( InputBotInlineMessageMediaContact) bool) InputBotInlineMessageMediaContactArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaContactArray) () ( InputBotInlineMessageMediaContact,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaContactArray) () ( InputBotInlineMessageMediaContact,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaContactArray) () ( InputBotInlineMessageMediaContact,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaContact
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaContactArray) () ( InputBotInlineMessageMediaContact,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageGameArray is adapter for slice of InputBotInlineMessageGame.
type InputBotInlineMessageGameArray []InputBotInlineMessageGame

// Sort sorts slice of InputBotInlineMessageGame.
func ( InputBotInlineMessageGameArray) ( func(,  InputBotInlineMessageGame) bool) InputBotInlineMessageGameArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageGame.
func ( InputBotInlineMessageGameArray) ( func(,  InputBotInlineMessageGame) bool) InputBotInlineMessageGameArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageGame.
func ( InputBotInlineMessageGameArray) ( func( InputBotInlineMessageGame) bool) InputBotInlineMessageGameArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageGameArray) () ( InputBotInlineMessageGame,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageGameArray) () ( InputBotInlineMessageGame,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageGameArray) () ( InputBotInlineMessageGame,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageGame
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageGameArray) () ( InputBotInlineMessageGame,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageMediaInvoiceArray is adapter for slice of InputBotInlineMessageMediaInvoice.
type InputBotInlineMessageMediaInvoiceArray []InputBotInlineMessageMediaInvoice

// Sort sorts slice of InputBotInlineMessageMediaInvoice.
func ( InputBotInlineMessageMediaInvoiceArray) ( func(,  InputBotInlineMessageMediaInvoice) bool) InputBotInlineMessageMediaInvoiceArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaInvoice.
func ( InputBotInlineMessageMediaInvoiceArray) ( func(,  InputBotInlineMessageMediaInvoice) bool) InputBotInlineMessageMediaInvoiceArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaInvoice.
func ( InputBotInlineMessageMediaInvoiceArray) ( func( InputBotInlineMessageMediaInvoice) bool) InputBotInlineMessageMediaInvoiceArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaInvoiceArray) () ( InputBotInlineMessageMediaInvoice,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaInvoiceArray) () ( InputBotInlineMessageMediaInvoice,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaInvoiceArray) () ( InputBotInlineMessageMediaInvoice,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaInvoice
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaInvoiceArray) () ( InputBotInlineMessageMediaInvoice,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// InputBotInlineMessageMediaWebPageArray is adapter for slice of InputBotInlineMessageMediaWebPage.
type InputBotInlineMessageMediaWebPageArray []InputBotInlineMessageMediaWebPage

// Sort sorts slice of InputBotInlineMessageMediaWebPage.
func ( InputBotInlineMessageMediaWebPageArray) ( func(,  InputBotInlineMessageMediaWebPage) bool) InputBotInlineMessageMediaWebPageArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputBotInlineMessageMediaWebPage.
func ( InputBotInlineMessageMediaWebPageArray) ( func(,  InputBotInlineMessageMediaWebPage) bool) InputBotInlineMessageMediaWebPageArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputBotInlineMessageMediaWebPage.
func ( InputBotInlineMessageMediaWebPageArray) ( func( InputBotInlineMessageMediaWebPage) bool) InputBotInlineMessageMediaWebPageArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputBotInlineMessageMediaWebPageArray) () ( InputBotInlineMessageMediaWebPage,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputBotInlineMessageMediaWebPageArray) () ( InputBotInlineMessageMediaWebPage,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaWebPageArray) () ( InputBotInlineMessageMediaWebPage,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputBotInlineMessageMediaWebPage
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputBotInlineMessageMediaWebPageArray) () ( InputBotInlineMessageMediaWebPage,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}