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 SendMessageActionClassArray []SendMessageActionClass
func (s SendMessageActionClassArray ) Sort (less func (a , b SendMessageActionClass ) bool ) SendMessageActionClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageActionClassArray ) SortStable (less func (a , b SendMessageActionClass ) bool ) SendMessageActionClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageActionClassArray ) Retain (keep func (x SendMessageActionClass ) bool ) SendMessageActionClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageActionClassArray ) First () (v SendMessageActionClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageActionClassArray ) Last () (v SendMessageActionClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageActionClassArray ) PopFirst () (v SendMessageActionClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageActionClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageActionClassArray ) Pop () (v SendMessageActionClass , 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 SendMessageActionClassArray ) AsSendMessageUploadVideoAction () (to SendMessageUploadVideoActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageUploadVideoAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageUploadAudioAction () (to SendMessageUploadAudioActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageUploadAudioAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageUploadPhotoAction () (to SendMessageUploadPhotoActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageUploadPhotoAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageUploadDocumentAction () (to SendMessageUploadDocumentActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageUploadDocumentAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageUploadRoundAction () (to SendMessageUploadRoundActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageUploadRoundAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageHistoryImportAction () (to SendMessageHistoryImportActionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageHistoryImportAction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageEmojiInteraction () (to SendMessageEmojiInteractionArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageEmojiInteraction )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s SendMessageActionClassArray ) AsSendMessageEmojiInteractionSeen () (to SendMessageEmojiInteractionSeenArray ) {
for _ , elem := range s {
value , ok := elem .(*SendMessageEmojiInteractionSeen )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type SendMessageUploadVideoActionArray []SendMessageUploadVideoAction
func (s SendMessageUploadVideoActionArray ) Sort (less func (a , b SendMessageUploadVideoAction ) bool ) SendMessageUploadVideoActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadVideoActionArray ) SortStable (less func (a , b SendMessageUploadVideoAction ) bool ) SendMessageUploadVideoActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadVideoActionArray ) Retain (keep func (x SendMessageUploadVideoAction ) bool ) SendMessageUploadVideoActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageUploadVideoActionArray ) First () (v SendMessageUploadVideoAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageUploadVideoActionArray ) Last () (v SendMessageUploadVideoAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageUploadVideoActionArray ) PopFirst () (v SendMessageUploadVideoAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageUploadVideoAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageUploadVideoActionArray ) Pop () (v SendMessageUploadVideoAction , 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 SendMessageUploadAudioActionArray []SendMessageUploadAudioAction
func (s SendMessageUploadAudioActionArray ) Sort (less func (a , b SendMessageUploadAudioAction ) bool ) SendMessageUploadAudioActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadAudioActionArray ) SortStable (less func (a , b SendMessageUploadAudioAction ) bool ) SendMessageUploadAudioActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadAudioActionArray ) Retain (keep func (x SendMessageUploadAudioAction ) bool ) SendMessageUploadAudioActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageUploadAudioActionArray ) First () (v SendMessageUploadAudioAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageUploadAudioActionArray ) Last () (v SendMessageUploadAudioAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageUploadAudioActionArray ) PopFirst () (v SendMessageUploadAudioAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageUploadAudioAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageUploadAudioActionArray ) Pop () (v SendMessageUploadAudioAction , 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 SendMessageUploadPhotoActionArray []SendMessageUploadPhotoAction
func (s SendMessageUploadPhotoActionArray ) Sort (less func (a , b SendMessageUploadPhotoAction ) bool ) SendMessageUploadPhotoActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadPhotoActionArray ) SortStable (less func (a , b SendMessageUploadPhotoAction ) bool ) SendMessageUploadPhotoActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadPhotoActionArray ) Retain (keep func (x SendMessageUploadPhotoAction ) bool ) SendMessageUploadPhotoActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageUploadPhotoActionArray ) First () (v SendMessageUploadPhotoAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageUploadPhotoActionArray ) Last () (v SendMessageUploadPhotoAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageUploadPhotoActionArray ) PopFirst () (v SendMessageUploadPhotoAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageUploadPhotoAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageUploadPhotoActionArray ) Pop () (v SendMessageUploadPhotoAction , 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 SendMessageUploadDocumentActionArray []SendMessageUploadDocumentAction
func (s SendMessageUploadDocumentActionArray ) Sort (less func (a , b SendMessageUploadDocumentAction ) bool ) SendMessageUploadDocumentActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadDocumentActionArray ) SortStable (less func (a , b SendMessageUploadDocumentAction ) bool ) SendMessageUploadDocumentActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadDocumentActionArray ) Retain (keep func (x SendMessageUploadDocumentAction ) bool ) SendMessageUploadDocumentActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageUploadDocumentActionArray ) First () (v SendMessageUploadDocumentAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageUploadDocumentActionArray ) Last () (v SendMessageUploadDocumentAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageUploadDocumentActionArray ) PopFirst () (v SendMessageUploadDocumentAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageUploadDocumentAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageUploadDocumentActionArray ) Pop () (v SendMessageUploadDocumentAction , 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 SendMessageUploadRoundActionArray []SendMessageUploadRoundAction
func (s SendMessageUploadRoundActionArray ) Sort (less func (a , b SendMessageUploadRoundAction ) bool ) SendMessageUploadRoundActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadRoundActionArray ) SortStable (less func (a , b SendMessageUploadRoundAction ) bool ) SendMessageUploadRoundActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageUploadRoundActionArray ) Retain (keep func (x SendMessageUploadRoundAction ) bool ) SendMessageUploadRoundActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageUploadRoundActionArray ) First () (v SendMessageUploadRoundAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageUploadRoundActionArray ) Last () (v SendMessageUploadRoundAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageUploadRoundActionArray ) PopFirst () (v SendMessageUploadRoundAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageUploadRoundAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageUploadRoundActionArray ) Pop () (v SendMessageUploadRoundAction , 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 SendMessageHistoryImportActionArray []SendMessageHistoryImportAction
func (s SendMessageHistoryImportActionArray ) Sort (less func (a , b SendMessageHistoryImportAction ) bool ) SendMessageHistoryImportActionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageHistoryImportActionArray ) SortStable (less func (a , b SendMessageHistoryImportAction ) bool ) SendMessageHistoryImportActionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageHistoryImportActionArray ) Retain (keep func (x SendMessageHistoryImportAction ) bool ) SendMessageHistoryImportActionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageHistoryImportActionArray ) First () (v SendMessageHistoryImportAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageHistoryImportActionArray ) Last () (v SendMessageHistoryImportAction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageHistoryImportActionArray ) PopFirst () (v SendMessageHistoryImportAction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageHistoryImportAction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageHistoryImportActionArray ) Pop () (v SendMessageHistoryImportAction , 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 SendMessageEmojiInteractionArray []SendMessageEmojiInteraction
func (s SendMessageEmojiInteractionArray ) Sort (less func (a , b SendMessageEmojiInteraction ) bool ) SendMessageEmojiInteractionArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageEmojiInteractionArray ) SortStable (less func (a , b SendMessageEmojiInteraction ) bool ) SendMessageEmojiInteractionArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageEmojiInteractionArray ) Retain (keep func (x SendMessageEmojiInteraction ) bool ) SendMessageEmojiInteractionArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageEmojiInteractionArray ) First () (v SendMessageEmojiInteraction , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageEmojiInteractionArray ) Last () (v SendMessageEmojiInteraction , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageEmojiInteractionArray ) PopFirst () (v SendMessageEmojiInteraction , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageEmojiInteraction
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageEmojiInteractionArray ) Pop () (v SendMessageEmojiInteraction , 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 SendMessageEmojiInteractionSeenArray []SendMessageEmojiInteractionSeen
func (s SendMessageEmojiInteractionSeenArray ) Sort (less func (a , b SendMessageEmojiInteractionSeen ) bool ) SendMessageEmojiInteractionSeenArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageEmojiInteractionSeenArray ) SortStable (less func (a , b SendMessageEmojiInteractionSeen ) bool ) SendMessageEmojiInteractionSeenArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s SendMessageEmojiInteractionSeenArray ) Retain (keep func (x SendMessageEmojiInteractionSeen ) bool ) SendMessageEmojiInteractionSeenArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s SendMessageEmojiInteractionSeenArray ) First () (v SendMessageEmojiInteractionSeen , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s SendMessageEmojiInteractionSeenArray ) Last () (v SendMessageEmojiInteractionSeen , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *SendMessageEmojiInteractionSeenArray ) PopFirst () (v SendMessageEmojiInteractionSeen , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero SendMessageEmojiInteractionSeen
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *SendMessageEmojiInteractionSeenArray ) Pop () (v SendMessageEmojiInteractionSeen , 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 .