package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type InputBotInlineMessageClassArray []InputBotInlineMessageClass
func (s InputBotInlineMessageClassArray ) Sort (less func (a , b InputBotInlineMessageClass ) bool ) InputBotInlineMessageClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageClassArray ) SortStable (less func (a , b InputBotInlineMessageClass ) bool ) InputBotInlineMessageClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageClassArray ) Retain (keep func (x InputBotInlineMessageClass ) bool ) InputBotInlineMessageClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageClassArray ) First () (v InputBotInlineMessageClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageClassArray ) Last () (v InputBotInlineMessageClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageClassArray ) PopFirst () (v InputBotInlineMessageClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageClassArray ) Pop () (v InputBotInlineMessageClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaAuto () (to InputBotInlineMessageMediaAutoArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaAuto )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageText () (to InputBotInlineMessageTextArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageText )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaGeo () (to InputBotInlineMessageMediaGeoArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaGeo )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaVenue () (to InputBotInlineMessageMediaVenueArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaVenue )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaContact () (to InputBotInlineMessageMediaContactArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaContact )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageGame () (to InputBotInlineMessageGameArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageGame )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaInvoice () (to InputBotInlineMessageMediaInvoiceArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaInvoice )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineMessageClassArray ) AsInputBotInlineMessageMediaWebPage () (to InputBotInlineMessageMediaWebPageArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineMessageMediaWebPage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type InputBotInlineMessageMediaAutoArray []InputBotInlineMessageMediaAuto
func (s InputBotInlineMessageMediaAutoArray ) Sort (less func (a , b InputBotInlineMessageMediaAuto ) bool ) InputBotInlineMessageMediaAutoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaAutoArray ) SortStable (less func (a , b InputBotInlineMessageMediaAuto ) bool ) InputBotInlineMessageMediaAutoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaAutoArray ) Retain (keep func (x InputBotInlineMessageMediaAuto ) bool ) InputBotInlineMessageMediaAutoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaAutoArray ) First () (v InputBotInlineMessageMediaAuto , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaAutoArray ) Last () (v InputBotInlineMessageMediaAuto , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaAutoArray ) PopFirst () (v InputBotInlineMessageMediaAuto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaAuto
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaAutoArray ) Pop () (v InputBotInlineMessageMediaAuto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageTextArray []InputBotInlineMessageText
func (s InputBotInlineMessageTextArray ) Sort (less func (a , b InputBotInlineMessageText ) bool ) InputBotInlineMessageTextArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageTextArray ) SortStable (less func (a , b InputBotInlineMessageText ) bool ) InputBotInlineMessageTextArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageTextArray ) Retain (keep func (x InputBotInlineMessageText ) bool ) InputBotInlineMessageTextArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageTextArray ) First () (v InputBotInlineMessageText , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageTextArray ) Last () (v InputBotInlineMessageText , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageTextArray ) PopFirst () (v InputBotInlineMessageText , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageText
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageTextArray ) Pop () (v InputBotInlineMessageText , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageMediaGeoArray []InputBotInlineMessageMediaGeo
func (s InputBotInlineMessageMediaGeoArray ) Sort (less func (a , b InputBotInlineMessageMediaGeo ) bool ) InputBotInlineMessageMediaGeoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaGeoArray ) SortStable (less func (a , b InputBotInlineMessageMediaGeo ) bool ) InputBotInlineMessageMediaGeoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaGeoArray ) Retain (keep func (x InputBotInlineMessageMediaGeo ) bool ) InputBotInlineMessageMediaGeoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaGeoArray ) First () (v InputBotInlineMessageMediaGeo , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaGeoArray ) Last () (v InputBotInlineMessageMediaGeo , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaGeoArray ) PopFirst () (v InputBotInlineMessageMediaGeo , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaGeo
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaGeoArray ) Pop () (v InputBotInlineMessageMediaGeo , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageMediaVenueArray []InputBotInlineMessageMediaVenue
func (s InputBotInlineMessageMediaVenueArray ) Sort (less func (a , b InputBotInlineMessageMediaVenue ) bool ) InputBotInlineMessageMediaVenueArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaVenueArray ) SortStable (less func (a , b InputBotInlineMessageMediaVenue ) bool ) InputBotInlineMessageMediaVenueArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaVenueArray ) Retain (keep func (x InputBotInlineMessageMediaVenue ) bool ) InputBotInlineMessageMediaVenueArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaVenueArray ) First () (v InputBotInlineMessageMediaVenue , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaVenueArray ) Last () (v InputBotInlineMessageMediaVenue , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaVenueArray ) PopFirst () (v InputBotInlineMessageMediaVenue , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaVenue
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaVenueArray ) Pop () (v InputBotInlineMessageMediaVenue , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageMediaContactArray []InputBotInlineMessageMediaContact
func (s InputBotInlineMessageMediaContactArray ) Sort (less func (a , b InputBotInlineMessageMediaContact ) bool ) InputBotInlineMessageMediaContactArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaContactArray ) SortStable (less func (a , b InputBotInlineMessageMediaContact ) bool ) InputBotInlineMessageMediaContactArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaContactArray ) Retain (keep func (x InputBotInlineMessageMediaContact ) bool ) InputBotInlineMessageMediaContactArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaContactArray ) First () (v InputBotInlineMessageMediaContact , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaContactArray ) Last () (v InputBotInlineMessageMediaContact , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaContactArray ) PopFirst () (v InputBotInlineMessageMediaContact , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaContact
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaContactArray ) Pop () (v InputBotInlineMessageMediaContact , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageGameArray []InputBotInlineMessageGame
func (s InputBotInlineMessageGameArray ) Sort (less func (a , b InputBotInlineMessageGame ) bool ) InputBotInlineMessageGameArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageGameArray ) SortStable (less func (a , b InputBotInlineMessageGame ) bool ) InputBotInlineMessageGameArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageGameArray ) Retain (keep func (x InputBotInlineMessageGame ) bool ) InputBotInlineMessageGameArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageGameArray ) First () (v InputBotInlineMessageGame , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageGameArray ) Last () (v InputBotInlineMessageGame , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageGameArray ) PopFirst () (v InputBotInlineMessageGame , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageGame
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageGameArray ) Pop () (v InputBotInlineMessageGame , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageMediaInvoiceArray []InputBotInlineMessageMediaInvoice
func (s InputBotInlineMessageMediaInvoiceArray ) Sort (less func (a , b InputBotInlineMessageMediaInvoice ) bool ) InputBotInlineMessageMediaInvoiceArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaInvoiceArray ) SortStable (less func (a , b InputBotInlineMessageMediaInvoice ) bool ) InputBotInlineMessageMediaInvoiceArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaInvoiceArray ) Retain (keep func (x InputBotInlineMessageMediaInvoice ) bool ) InputBotInlineMessageMediaInvoiceArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaInvoiceArray ) First () (v InputBotInlineMessageMediaInvoice , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaInvoiceArray ) Last () (v InputBotInlineMessageMediaInvoice , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaInvoiceArray ) PopFirst () (v InputBotInlineMessageMediaInvoice , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaInvoice
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaInvoiceArray ) Pop () (v InputBotInlineMessageMediaInvoice , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputBotInlineMessageMediaWebPageArray []InputBotInlineMessageMediaWebPage
func (s InputBotInlineMessageMediaWebPageArray ) Sort (less func (a , b InputBotInlineMessageMediaWebPage ) bool ) InputBotInlineMessageMediaWebPageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaWebPageArray ) SortStable (less func (a , b InputBotInlineMessageMediaWebPage ) bool ) InputBotInlineMessageMediaWebPageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineMessageMediaWebPageArray ) Retain (keep func (x InputBotInlineMessageMediaWebPage ) bool ) InputBotInlineMessageMediaWebPageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineMessageMediaWebPageArray ) First () (v InputBotInlineMessageMediaWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineMessageMediaWebPageArray ) Last () (v InputBotInlineMessageMediaWebPage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineMessageMediaWebPageArray ) PopFirst () (v InputBotInlineMessageMediaWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineMessageMediaWebPage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineMessageMediaWebPageArray ) Pop () (v InputBotInlineMessageMediaWebPage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .