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

// MessageMediaClassArray is adapter for slice of MessageMediaClass.
type MessageMediaClassArray []MessageMediaClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsMessageMediaPhoto returns copy with only MessageMediaPhoto constructors.
func ( MessageMediaClassArray) () ( MessageMediaPhotoArray) {
	for ,  := range  {
		,  := .(*MessageMediaPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaGeo returns copy with only MessageMediaGeo constructors.
func ( MessageMediaClassArray) () ( MessageMediaGeoArray) {
	for ,  := range  {
		,  := .(*MessageMediaGeo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaContact returns copy with only MessageMediaContact constructors.
func ( MessageMediaClassArray) () ( MessageMediaContactArray) {
	for ,  := range  {
		,  := .(*MessageMediaContact)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaDocument returns copy with only MessageMediaDocument constructors.
func ( MessageMediaClassArray) () ( MessageMediaDocumentArray) {
	for ,  := range  {
		,  := .(*MessageMediaDocument)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaWebPage returns copy with only MessageMediaWebPage constructors.
func ( MessageMediaClassArray) () ( MessageMediaWebPageArray) {
	for ,  := range  {
		,  := .(*MessageMediaWebPage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaVenue returns copy with only MessageMediaVenue constructors.
func ( MessageMediaClassArray) () ( MessageMediaVenueArray) {
	for ,  := range  {
		,  := .(*MessageMediaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaGame returns copy with only MessageMediaGame constructors.
func ( MessageMediaClassArray) () ( MessageMediaGameArray) {
	for ,  := range  {
		,  := .(*MessageMediaGame)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaInvoice returns copy with only MessageMediaInvoice constructors.
func ( MessageMediaClassArray) () ( MessageMediaInvoiceArray) {
	for ,  := range  {
		,  := .(*MessageMediaInvoice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaGeoLive returns copy with only MessageMediaGeoLive constructors.
func ( MessageMediaClassArray) () ( MessageMediaGeoLiveArray) {
	for ,  := range  {
		,  := .(*MessageMediaGeoLive)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaPoll returns copy with only MessageMediaPoll constructors.
func ( MessageMediaClassArray) () ( MessageMediaPollArray) {
	for ,  := range  {
		,  := .(*MessageMediaPoll)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaDice returns copy with only MessageMediaDice constructors.
func ( MessageMediaClassArray) () ( MessageMediaDiceArray) {
	for ,  := range  {
		,  := .(*MessageMediaDice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaStory returns copy with only MessageMediaStory constructors.
func ( MessageMediaClassArray) () ( MessageMediaStoryArray) {
	for ,  := range  {
		,  := .(*MessageMediaStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaGiveaway returns copy with only MessageMediaGiveaway constructors.
func ( MessageMediaClassArray) () ( MessageMediaGiveawayArray) {
	for ,  := range  {
		,  := .(*MessageMediaGiveaway)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsMessageMediaGiveawayResults returns copy with only MessageMediaGiveawayResults constructors.
func ( MessageMediaClassArray) () ( MessageMediaGiveawayResultsArray) {
	for ,  := range  {
		,  := .(*MessageMediaGiveawayResults)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// MessageMediaPhotoArray is adapter for slice of MessageMediaPhoto.
type MessageMediaPhotoArray []MessageMediaPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaGeoArray is adapter for slice of MessageMediaGeo.
type MessageMediaGeoArray []MessageMediaGeo

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaContactArray is adapter for slice of MessageMediaContact.
type MessageMediaContactArray []MessageMediaContact

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaDocumentArray is adapter for slice of MessageMediaDocument.
type MessageMediaDocumentArray []MessageMediaDocument

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaWebPageArray is adapter for slice of MessageMediaWebPage.
type MessageMediaWebPageArray []MessageMediaWebPage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaVenueArray is adapter for slice of MessageMediaVenue.
type MessageMediaVenueArray []MessageMediaVenue

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaGameArray is adapter for slice of MessageMediaGame.
type MessageMediaGameArray []MessageMediaGame

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaInvoiceArray is adapter for slice of MessageMediaInvoice.
type MessageMediaInvoiceArray []MessageMediaInvoice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaGeoLiveArray is adapter for slice of MessageMediaGeoLive.
type MessageMediaGeoLiveArray []MessageMediaGeoLive

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaPollArray is adapter for slice of MessageMediaPoll.
type MessageMediaPollArray []MessageMediaPoll

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaDiceArray is adapter for slice of MessageMediaDice.
type MessageMediaDiceArray []MessageMediaDice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaStoryArray is adapter for slice of MessageMediaStory.
type MessageMediaStoryArray []MessageMediaStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByID sorts slice of MessageMediaStory by ID.
func ( MessageMediaStoryArray) () MessageMediaStoryArray {
	return .Sort(func(,  MessageMediaStory) bool {
		return .GetID() < .GetID()
	})
}

// SortStableByID sorts slice of MessageMediaStory by ID.
func ( MessageMediaStoryArray) () MessageMediaStoryArray {
	return .SortStable(func(,  MessageMediaStory) bool {
		return .GetID() < .GetID()
	})
}

// FillMap fills constructors to given map.
func ( MessageMediaStoryArray) ( map[int]MessageMediaStory) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( MessageMediaStoryArray) () map[int]MessageMediaStory {
	 := make(map[int]MessageMediaStory, len())
	.FillMap()
	return 
}

// MessageMediaGiveawayArray is adapter for slice of MessageMediaGiveaway.
type MessageMediaGiveawayArray []MessageMediaGiveaway

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// MessageMediaGiveawayResultsArray is adapter for slice of MessageMediaGiveawayResults.
type MessageMediaGiveawayResultsArray []MessageMediaGiveawayResults

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}