-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
tl_chat_full_gen.go
3706 lines (3464 loc) · 89.3 KB
/
tl_chat_full_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by gotdgen, DO NOT EDIT.
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"
)
// 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{}
)
// ChatFull represents TL type `chatFull#c9d31138`.
// Full info about a basic group¹.
//
// Links:
// 1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/chatFull for reference.
type ChatFull struct {
// Flags, see TL conditional fields¹
//
// Links:
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
Flags bin.Fields
// Can we change the username of this chat
CanSetUsername bool
// Whether scheduled messages¹ are available
//
// Links:
// 1) https://core.telegram.org/api/scheduled-messages
HasScheduled bool
// Whether the real-time chat translation popup¹ should be hidden.
//
// Links:
// 1) https://core.telegram.org/api/translation
TranslationsDisabled bool
// ID of the chat
ID int64
// About string for this chat
About string
// Participant list
Participants ChatParticipantsClass
// Chat photo
//
// Use SetChatPhoto and GetChatPhoto helpers.
ChatPhoto PhotoClass
// Notification settings
NotifySettings PeerNotifySettings
// Chat invite
//
// Use SetExportedInvite and GetExportedInvite helpers.
ExportedInvite ExportedChatInviteClass
// Info about bots that are in this chat
//
// Use SetBotInfo and GetBotInfo helpers.
BotInfo []BotInfo
// Message ID of the last pinned message¹
//
// Links:
// 1) https://core.telegram.org/api/pin
//
// Use SetPinnedMsgID and GetPinnedMsgID helpers.
PinnedMsgID int
// Peer folder ID, for more info click here¹
//
// Links:
// 1) https://core.telegram.org/api/folders#peer-folders
//
// Use SetFolderID and GetFolderID helpers.
FolderID int
// Group call information
//
// Use SetCall and GetCall helpers.
Call InputGroupCall
// Time-To-Live of messages sent by the current user to this chat
//
// Use SetTTLPeriod and GetTTLPeriod helpers.
TTLPeriod int
// When using phone.getGroupCallJoinAs¹ to get a list of peers that can be used to join
// a group call, this field indicates the peer that should be selected by default.
//
// Links:
// 1) https://core.telegram.org/method/phone.getGroupCallJoinAs
//
// Use SetGroupcallDefaultJoinAs and GetGroupcallDefaultJoinAs helpers.
GroupcallDefaultJoinAs PeerClass
// Emoji representing a specific chat theme
//
// Use SetThemeEmoticon and GetThemeEmoticon helpers.
ThemeEmoticon string
// Pending join requests »¹
//
// Links:
// 1) https://core.telegram.org/api/invites#join-requests
//
// Use SetRequestsPending and GetRequestsPending helpers.
RequestsPending int
// IDs of users who requested to join recently
//
// Use SetRecentRequesters and GetRecentRequesters helpers.
RecentRequesters []int64
// Allowed message reactions »¹
//
// Links:
// 1) https://core.telegram.org/api/reactions
//
// Use SetAvailableReactions and GetAvailableReactions helpers.
AvailableReactions ChatReactionsClass
}
// ChatFullTypeID is TL type id of ChatFull.
const ChatFullTypeID = 0xc9d31138
// construct implements constructor of ChatFullClass.
func (c ChatFull) construct() ChatFullClass { return &c }
// Ensuring interfaces in compile-time for ChatFull.
var (
_ bin.Encoder = &ChatFull{}
_ bin.Decoder = &ChatFull{}
_ bin.BareEncoder = &ChatFull{}
_ bin.BareDecoder = &ChatFull{}
_ ChatFullClass = &ChatFull{}
)
func (c *ChatFull) Zero() bool {
if c == nil {
return true
}
if !(c.Flags.Zero()) {
return false
}
if !(c.CanSetUsername == false) {
return false
}
if !(c.HasScheduled == false) {
return false
}
if !(c.TranslationsDisabled == false) {
return false
}
if !(c.ID == 0) {
return false
}
if !(c.About == "") {
return false
}
if !(c.Participants == nil) {
return false
}
if !(c.ChatPhoto == nil) {
return false
}
if !(c.NotifySettings.Zero()) {
return false
}
if !(c.ExportedInvite == nil) {
return false
}
if !(c.BotInfo == nil) {
return false
}
if !(c.PinnedMsgID == 0) {
return false
}
if !(c.FolderID == 0) {
return false
}
if !(c.Call.Zero()) {
return false
}
if !(c.TTLPeriod == 0) {
return false
}
if !(c.GroupcallDefaultJoinAs == nil) {
return false
}
if !(c.ThemeEmoticon == "") {
return false
}
if !(c.RequestsPending == 0) {
return false
}
if !(c.RecentRequesters == nil) {
return false
}
if !(c.AvailableReactions == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (c *ChatFull) String() string {
if c == nil {
return "ChatFull(nil)"
}
type Alias ChatFull
return fmt.Sprintf("ChatFull%+v", Alias(*c))
}
// FillFrom fills ChatFull from given interface.
func (c *ChatFull) FillFrom(from interface {
GetCanSetUsername() (value bool)
GetHasScheduled() (value bool)
GetTranslationsDisabled() (value bool)
GetID() (value int64)
GetAbout() (value string)
GetParticipants() (value ChatParticipantsClass)
GetChatPhoto() (value PhotoClass, ok bool)
GetNotifySettings() (value PeerNotifySettings)
GetExportedInvite() (value ExportedChatInviteClass, ok bool)
GetBotInfo() (value []BotInfo, ok bool)
GetPinnedMsgID() (value int, ok bool)
GetFolderID() (value int, ok bool)
GetCall() (value InputGroupCall, ok bool)
GetTTLPeriod() (value int, ok bool)
GetGroupcallDefaultJoinAs() (value PeerClass, ok bool)
GetThemeEmoticon() (value string, ok bool)
GetRequestsPending() (value int, ok bool)
GetRecentRequesters() (value []int64, ok bool)
GetAvailableReactions() (value ChatReactionsClass, ok bool)
}) {
c.CanSetUsername = from.GetCanSetUsername()
c.HasScheduled = from.GetHasScheduled()
c.TranslationsDisabled = from.GetTranslationsDisabled()
c.ID = from.GetID()
c.About = from.GetAbout()
c.Participants = from.GetParticipants()
if val, ok := from.GetChatPhoto(); ok {
c.ChatPhoto = val
}
c.NotifySettings = from.GetNotifySettings()
if val, ok := from.GetExportedInvite(); ok {
c.ExportedInvite = val
}
if val, ok := from.GetBotInfo(); ok {
c.BotInfo = val
}
if val, ok := from.GetPinnedMsgID(); ok {
c.PinnedMsgID = val
}
if val, ok := from.GetFolderID(); ok {
c.FolderID = val
}
if val, ok := from.GetCall(); ok {
c.Call = val
}
if val, ok := from.GetTTLPeriod(); ok {
c.TTLPeriod = val
}
if val, ok := from.GetGroupcallDefaultJoinAs(); ok {
c.GroupcallDefaultJoinAs = val
}
if val, ok := from.GetThemeEmoticon(); ok {
c.ThemeEmoticon = val
}
if val, ok := from.GetRequestsPending(); ok {
c.RequestsPending = val
}
if val, ok := from.GetRecentRequesters(); ok {
c.RecentRequesters = val
}
if val, ok := from.GetAvailableReactions(); ok {
c.AvailableReactions = val
}
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ChatFull) TypeID() uint32 {
return ChatFullTypeID
}
// TypeName returns name of type in TL schema.
func (*ChatFull) TypeName() string {
return "chatFull"
}
// TypeInfo returns info about TL type.
func (c *ChatFull) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "chatFull",
ID: ChatFullTypeID,
}
if c == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CanSetUsername",
SchemaName: "can_set_username",
Null: !c.Flags.Has(7),
},
{
Name: "HasScheduled",
SchemaName: "has_scheduled",
Null: !c.Flags.Has(8),
},
{
Name: "TranslationsDisabled",
SchemaName: "translations_disabled",
Null: !c.Flags.Has(19),
},
{
Name: "ID",
SchemaName: "id",
},
{
Name: "About",
SchemaName: "about",
},
{
Name: "Participants",
SchemaName: "participants",
},
{
Name: "ChatPhoto",
SchemaName: "chat_photo",
Null: !c.Flags.Has(2),
},
{
Name: "NotifySettings",
SchemaName: "notify_settings",
},
{
Name: "ExportedInvite",
SchemaName: "exported_invite",
Null: !c.Flags.Has(13),
},
{
Name: "BotInfo",
SchemaName: "bot_info",
Null: !c.Flags.Has(3),
},
{
Name: "PinnedMsgID",
SchemaName: "pinned_msg_id",
Null: !c.Flags.Has(6),
},
{
Name: "FolderID",
SchemaName: "folder_id",
Null: !c.Flags.Has(11),
},
{
Name: "Call",
SchemaName: "call",
Null: !c.Flags.Has(12),
},
{
Name: "TTLPeriod",
SchemaName: "ttl_period",
Null: !c.Flags.Has(14),
},
{
Name: "GroupcallDefaultJoinAs",
SchemaName: "groupcall_default_join_as",
Null: !c.Flags.Has(15),
},
{
Name: "ThemeEmoticon",
SchemaName: "theme_emoticon",
Null: !c.Flags.Has(16),
},
{
Name: "RequestsPending",
SchemaName: "requests_pending",
Null: !c.Flags.Has(17),
},
{
Name: "RecentRequesters",
SchemaName: "recent_requesters",
Null: !c.Flags.Has(17),
},
{
Name: "AvailableReactions",
SchemaName: "available_reactions",
Null: !c.Flags.Has(18),
},
}
return typ
}
// SetFlags sets flags for non-zero fields.
func (c *ChatFull) SetFlags() {
if !(c.CanSetUsername == false) {
c.Flags.Set(7)
}
if !(c.HasScheduled == false) {
c.Flags.Set(8)
}
if !(c.TranslationsDisabled == false) {
c.Flags.Set(19)
}
if !(c.ChatPhoto == nil) {
c.Flags.Set(2)
}
if !(c.ExportedInvite == nil) {
c.Flags.Set(13)
}
if !(c.BotInfo == nil) {
c.Flags.Set(3)
}
if !(c.PinnedMsgID == 0) {
c.Flags.Set(6)
}
if !(c.FolderID == 0) {
c.Flags.Set(11)
}
if !(c.Call.Zero()) {
c.Flags.Set(12)
}
if !(c.TTLPeriod == 0) {
c.Flags.Set(14)
}
if !(c.GroupcallDefaultJoinAs == nil) {
c.Flags.Set(15)
}
if !(c.ThemeEmoticon == "") {
c.Flags.Set(16)
}
if !(c.RequestsPending == 0) {
c.Flags.Set(17)
}
if !(c.RecentRequesters == nil) {
c.Flags.Set(17)
}
if !(c.AvailableReactions == nil) {
c.Flags.Set(18)
}
}
// Encode implements bin.Encoder.
func (c *ChatFull) Encode(b *bin.Buffer) error {
if c == nil {
return fmt.Errorf("can't encode chatFull#c9d31138 as nil")
}
b.PutID(ChatFullTypeID)
return c.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (c *ChatFull) EncodeBare(b *bin.Buffer) error {
if c == nil {
return fmt.Errorf("can't encode chatFull#c9d31138 as nil")
}
c.SetFlags()
if err := c.Flags.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field flags: %w", err)
}
b.PutLong(c.ID)
b.PutString(c.About)
if c.Participants == nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field participants is nil")
}
if err := c.Participants.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field participants: %w", err)
}
if c.Flags.Has(2) {
if c.ChatPhoto == nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field chat_photo is nil")
}
if err := c.ChatPhoto.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field chat_photo: %w", err)
}
}
if err := c.NotifySettings.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field notify_settings: %w", err)
}
if c.Flags.Has(13) {
if c.ExportedInvite == nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field exported_invite is nil")
}
if err := c.ExportedInvite.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field exported_invite: %w", err)
}
}
if c.Flags.Has(3) {
b.PutVectorHeader(len(c.BotInfo))
for idx, v := range c.BotInfo {
if err := v.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field bot_info element with index %d: %w", idx, err)
}
}
}
if c.Flags.Has(6) {
b.PutInt(c.PinnedMsgID)
}
if c.Flags.Has(11) {
b.PutInt(c.FolderID)
}
if c.Flags.Has(12) {
if err := c.Call.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field call: %w", err)
}
}
if c.Flags.Has(14) {
b.PutInt(c.TTLPeriod)
}
if c.Flags.Has(15) {
if c.GroupcallDefaultJoinAs == nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field groupcall_default_join_as is nil")
}
if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field groupcall_default_join_as: %w", err)
}
}
if c.Flags.Has(16) {
b.PutString(c.ThemeEmoticon)
}
if c.Flags.Has(17) {
b.PutInt(c.RequestsPending)
}
if c.Flags.Has(17) {
b.PutVectorHeader(len(c.RecentRequesters))
for _, v := range c.RecentRequesters {
b.PutLong(v)
}
}
if c.Flags.Has(18) {
if c.AvailableReactions == nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field available_reactions is nil")
}
if err := c.AvailableReactions.Encode(b); err != nil {
return fmt.Errorf("unable to encode chatFull#c9d31138: field available_reactions: %w", err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (c *ChatFull) Decode(b *bin.Buffer) error {
if c == nil {
return fmt.Errorf("can't decode chatFull#c9d31138 to nil")
}
if err := b.ConsumeID(ChatFullTypeID); err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: %w", err)
}
return c.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (c *ChatFull) DecodeBare(b *bin.Buffer) error {
if c == nil {
return fmt.Errorf("can't decode chatFull#c9d31138 to nil")
}
{
if err := c.Flags.Decode(b); err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field flags: %w", err)
}
}
c.CanSetUsername = c.Flags.Has(7)
c.HasScheduled = c.Flags.Has(8)
c.TranslationsDisabled = c.Flags.Has(19)
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field id: %w", err)
}
c.ID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field about: %w", err)
}
c.About = value
}
{
value, err := DecodeChatParticipants(b)
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field participants: %w", err)
}
c.Participants = value
}
if c.Flags.Has(2) {
value, err := DecodePhoto(b)
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field chat_photo: %w", err)
}
c.ChatPhoto = value
}
{
if err := c.NotifySettings.Decode(b); err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field notify_settings: %w", err)
}
}
if c.Flags.Has(13) {
value, err := DecodeExportedChatInvite(b)
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field exported_invite: %w", err)
}
c.ExportedInvite = value
}
if c.Flags.Has(3) {
headerLen, err := b.VectorHeader()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field bot_info: %w", err)
}
if headerLen > 0 {
c.BotInfo = make([]BotInfo, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotInfo
if err := value.Decode(b); err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field bot_info: %w", err)
}
c.BotInfo = append(c.BotInfo, value)
}
}
if c.Flags.Has(6) {
value, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field pinned_msg_id: %w", err)
}
c.PinnedMsgID = value
}
if c.Flags.Has(11) {
value, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field folder_id: %w", err)
}
c.FolderID = value
}
if c.Flags.Has(12) {
if err := c.Call.Decode(b); err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field call: %w", err)
}
}
if c.Flags.Has(14) {
value, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field ttl_period: %w", err)
}
c.TTLPeriod = value
}
if c.Flags.Has(15) {
value, err := DecodePeer(b)
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field groupcall_default_join_as: %w", err)
}
c.GroupcallDefaultJoinAs = value
}
if c.Flags.Has(16) {
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field theme_emoticon: %w", err)
}
c.ThemeEmoticon = value
}
if c.Flags.Has(17) {
value, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field requests_pending: %w", err)
}
c.RequestsPending = value
}
if c.Flags.Has(17) {
headerLen, err := b.VectorHeader()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field recent_requesters: %w", err)
}
if headerLen > 0 {
c.RecentRequesters = make([]int64, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field recent_requesters: %w", err)
}
c.RecentRequesters = append(c.RecentRequesters, value)
}
}
if c.Flags.Has(18) {
value, err := DecodeChatReactions(b)
if err != nil {
return fmt.Errorf("unable to decode chatFull#c9d31138: field available_reactions: %w", err)
}
c.AvailableReactions = value
}
return nil
}
// SetCanSetUsername sets value of CanSetUsername conditional field.
func (c *ChatFull) SetCanSetUsername(value bool) {
if value {
c.Flags.Set(7)
c.CanSetUsername = true
} else {
c.Flags.Unset(7)
c.CanSetUsername = false
}
}
// GetCanSetUsername returns value of CanSetUsername conditional field.
func (c *ChatFull) GetCanSetUsername() (value bool) {
if c == nil {
return
}
return c.Flags.Has(7)
}
// SetHasScheduled sets value of HasScheduled conditional field.
func (c *ChatFull) SetHasScheduled(value bool) {
if value {
c.Flags.Set(8)
c.HasScheduled = true
} else {
c.Flags.Unset(8)
c.HasScheduled = false
}
}
// GetHasScheduled returns value of HasScheduled conditional field.
func (c *ChatFull) GetHasScheduled() (value bool) {
if c == nil {
return
}
return c.Flags.Has(8)
}
// SetTranslationsDisabled sets value of TranslationsDisabled conditional field.
func (c *ChatFull) SetTranslationsDisabled(value bool) {
if value {
c.Flags.Set(19)
c.TranslationsDisabled = true
} else {
c.Flags.Unset(19)
c.TranslationsDisabled = false
}
}
// GetTranslationsDisabled returns value of TranslationsDisabled conditional field.
func (c *ChatFull) GetTranslationsDisabled() (value bool) {
if c == nil {
return
}
return c.Flags.Has(19)
}
// GetID returns value of ID field.
func (c *ChatFull) GetID() (value int64) {
if c == nil {
return
}
return c.ID
}
// GetAbout returns value of About field.
func (c *ChatFull) GetAbout() (value string) {
if c == nil {
return
}
return c.About
}
// GetParticipants returns value of Participants field.
func (c *ChatFull) GetParticipants() (value ChatParticipantsClass) {
if c == nil {
return
}
return c.Participants
}
// SetChatPhoto sets value of ChatPhoto conditional field.
func (c *ChatFull) SetChatPhoto(value PhotoClass) {
c.Flags.Set(2)
c.ChatPhoto = value
}
// GetChatPhoto returns value of ChatPhoto conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetChatPhoto() (value PhotoClass, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(2) {
return value, false
}
return c.ChatPhoto, true
}
// GetNotifySettings returns value of NotifySettings field.
func (c *ChatFull) GetNotifySettings() (value PeerNotifySettings) {
if c == nil {
return
}
return c.NotifySettings
}
// SetExportedInvite sets value of ExportedInvite conditional field.
func (c *ChatFull) SetExportedInvite(value ExportedChatInviteClass) {
c.Flags.Set(13)
c.ExportedInvite = value
}
// GetExportedInvite returns value of ExportedInvite conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetExportedInvite() (value ExportedChatInviteClass, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(13) {
return value, false
}
return c.ExportedInvite, true
}
// SetBotInfo sets value of BotInfo conditional field.
func (c *ChatFull) SetBotInfo(value []BotInfo) {
c.Flags.Set(3)
c.BotInfo = value
}
// GetBotInfo returns value of BotInfo conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetBotInfo() (value []BotInfo, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(3) {
return value, false
}
return c.BotInfo, true
}
// SetPinnedMsgID sets value of PinnedMsgID conditional field.
func (c *ChatFull) SetPinnedMsgID(value int) {
c.Flags.Set(6)
c.PinnedMsgID = value
}
// GetPinnedMsgID returns value of PinnedMsgID conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetPinnedMsgID() (value int, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(6) {
return value, false
}
return c.PinnedMsgID, true
}
// SetFolderID sets value of FolderID conditional field.
func (c *ChatFull) SetFolderID(value int) {
c.Flags.Set(11)
c.FolderID = value
}
// GetFolderID returns value of FolderID conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetFolderID() (value int, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(11) {
return value, false
}
return c.FolderID, true
}
// SetCall sets value of Call conditional field.
func (c *ChatFull) SetCall(value InputGroupCall) {
c.Flags.Set(12)
c.Call = value
}
// GetCall returns value of Call conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetCall() (value InputGroupCall, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(12) {
return value, false
}
return c.Call, true
}
// SetTTLPeriod sets value of TTLPeriod conditional field.
func (c *ChatFull) SetTTLPeriod(value int) {
c.Flags.Set(14)
c.TTLPeriod = value
}
// GetTTLPeriod returns value of TTLPeriod conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetTTLPeriod() (value int, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(14) {
return value, false
}
return c.TTLPeriod, true
}
// SetGroupcallDefaultJoinAs sets value of GroupcallDefaultJoinAs conditional field.
func (c *ChatFull) SetGroupcallDefaultJoinAs(value PeerClass) {
c.Flags.Set(15)
c.GroupcallDefaultJoinAs = value
}
// GetGroupcallDefaultJoinAs returns value of GroupcallDefaultJoinAs conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetGroupcallDefaultJoinAs() (value PeerClass, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(15) {
return value, false
}
return c.GroupcallDefaultJoinAs, true
}
// SetThemeEmoticon sets value of ThemeEmoticon conditional field.
func (c *ChatFull) SetThemeEmoticon(value string) {
c.Flags.Set(16)
c.ThemeEmoticon = value
}
// GetThemeEmoticon returns value of ThemeEmoticon conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetThemeEmoticon() (value string, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(16) {
return value, false
}
return c.ThemeEmoticon, true
}
// SetRequestsPending sets value of RequestsPending conditional field.
func (c *ChatFull) SetRequestsPending(value int) {
c.Flags.Set(17)
c.RequestsPending = value
}
// GetRequestsPending returns value of RequestsPending conditional field and
// boolean which is true if field was set.
func (c *ChatFull) GetRequestsPending() (value int, ok bool) {
if c == nil {
return
}
if !c.Flags.Has(17) {
return value, false
}
return c.RequestsPending, true
}
// SetRecentRequesters sets value of RecentRequesters conditional field.
func (c *ChatFull) SetRecentRequesters(value []int64) {
c.Flags.Set(17)
c.RecentRequesters = value
}
// GetRecentRequesters returns value of RecentRequesters conditional field and