-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
tl_user_gen.go
1886 lines (1701 loc) · 40.3 KB
/
tl_user_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/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{}
)
// UserEmpty represents TL type `userEmpty#200250ba`.
// Empty constructor, non-existent user.
//
// See https://core.telegram.org/constructor/userEmpty for reference.
type UserEmpty struct {
// User identifier or 0
ID int
}
// UserEmptyTypeID is TL type id of UserEmpty.
const UserEmptyTypeID = 0x200250ba
func (u *UserEmpty) Zero() bool {
if u == nil {
return true
}
if !(u.ID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (u *UserEmpty) String() string {
if u == nil {
return "UserEmpty(nil)"
}
type Alias UserEmpty
return fmt.Sprintf("UserEmpty%+v", Alias(*u))
}
// FillFrom fills UserEmpty from given interface.
func (u *UserEmpty) FillFrom(from interface {
GetID() (value int)
}) {
u.ID = from.GetID()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UserEmpty) TypeID() uint32 {
return UserEmptyTypeID
}
// TypeName returns name of type in TL schema.
func (*UserEmpty) TypeName() string {
return "userEmpty"
}
// TypeInfo returns info about TL type.
func (u *UserEmpty) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "userEmpty",
ID: UserEmptyTypeID,
}
if u == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (u *UserEmpty) Encode(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't encode userEmpty#200250ba as nil")
}
b.PutID(UserEmptyTypeID)
return u.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (u *UserEmpty) EncodeBare(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't encode userEmpty#200250ba as nil")
}
b.PutInt(u.ID)
return nil
}
// GetID returns value of ID field.
func (u *UserEmpty) GetID() (value int) {
return u.ID
}
// Decode implements bin.Decoder.
func (u *UserEmpty) Decode(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't decode userEmpty#200250ba to nil")
}
if err := b.ConsumeID(UserEmptyTypeID); err != nil {
return fmt.Errorf("unable to decode userEmpty#200250ba: %w", err)
}
return u.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (u *UserEmpty) DecodeBare(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't decode userEmpty#200250ba to nil")
}
{
value, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode userEmpty#200250ba: field id: %w", err)
}
u.ID = value
}
return nil
}
// construct implements constructor of UserClass.
func (u UserEmpty) construct() UserClass { return &u }
// Ensuring interfaces in compile-time for UserEmpty.
var (
_ bin.Encoder = &UserEmpty{}
_ bin.Decoder = &UserEmpty{}
_ bin.BareEncoder = &UserEmpty{}
_ bin.BareDecoder = &UserEmpty{}
_ UserClass = &UserEmpty{}
)
// User represents TL type `user#938458c1`.
// Indicates info about a certain user
//
// See https://core.telegram.org/constructor/user for reference.
type User struct {
// Flags, see TL conditional fields¹
//
// Links:
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
Flags bin.Fields
// Whether this user indicates the currently logged in user
Self bool
// Whether this user is a contact
Contact bool
// Whether this user is a mutual contact
MutualContact bool
// Whether the account of this user was deleted
Deleted bool
// Is this user a bot?
Bot bool
// Can the bot see all messages in groups?
BotChatHistory bool
// Can the bot be added to groups?
BotNochats bool
// Whether this user is verified
Verified bool
// Access to this user must be restricted for the reason specified in restriction_reason
Restricted bool
// See min¹
//
// Links:
// 1) https://core.telegram.org/api/min
Min bool
// Whether the bot can request our geolocation in inline mode
BotInlineGeo bool
// Whether this is an official support user
Support bool
// This may be a scam user
Scam bool
// If set, the profile picture for this user should be refetched
ApplyMinPhoto bool
// Fake field of User.
Fake bool
// ID of the user
ID int
// Access hash of the user
//
// Use SetAccessHash and GetAccessHash helpers.
AccessHash int64
// First name
//
// Use SetFirstName and GetFirstName helpers.
FirstName string
// Last name
//
// Use SetLastName and GetLastName helpers.
LastName string
// Username
//
// Use SetUsername and GetUsername helpers.
Username string
// Phone number
//
// Use SetPhone and GetPhone helpers.
Phone string
// Profile picture of user
//
// Use SetPhoto and GetPhoto helpers.
Photo UserProfilePhotoClass
// Online status of user
//
// Use SetStatus and GetStatus helpers.
Status UserStatusClass
// Version of the bot_info field in userFull¹, incremented every time it changes
//
// Links:
// 1) https://core.telegram.org/constructor/userFull
//
// Use SetBotInfoVersion and GetBotInfoVersion helpers.
BotInfoVersion int
// Contains the reason why access to this user must be restricted.
//
// Use SetRestrictionReason and GetRestrictionReason helpers.
RestrictionReason []RestrictionReason
// Inline placeholder for this inline bot
//
// Use SetBotInlinePlaceholder and GetBotInlinePlaceholder helpers.
BotInlinePlaceholder string
// Language code of the user
//
// Use SetLangCode and GetLangCode helpers.
LangCode string
}
// UserTypeID is TL type id of User.
const UserTypeID = 0x938458c1
func (u *User) Zero() bool {
if u == nil {
return true
}
if !(u.Flags.Zero()) {
return false
}
if !(u.Self == false) {
return false
}
if !(u.Contact == false) {
return false
}
if !(u.MutualContact == false) {
return false
}
if !(u.Deleted == false) {
return false
}
if !(u.Bot == false) {
return false
}
if !(u.BotChatHistory == false) {
return false
}
if !(u.BotNochats == false) {
return false
}
if !(u.Verified == false) {
return false
}
if !(u.Restricted == false) {
return false
}
if !(u.Min == false) {
return false
}
if !(u.BotInlineGeo == false) {
return false
}
if !(u.Support == false) {
return false
}
if !(u.Scam == false) {
return false
}
if !(u.ApplyMinPhoto == false) {
return false
}
if !(u.Fake == false) {
return false
}
if !(u.ID == 0) {
return false
}
if !(u.AccessHash == 0) {
return false
}
if !(u.FirstName == "") {
return false
}
if !(u.LastName == "") {
return false
}
if !(u.Username == "") {
return false
}
if !(u.Phone == "") {
return false
}
if !(u.Photo == nil) {
return false
}
if !(u.Status == nil) {
return false
}
if !(u.BotInfoVersion == 0) {
return false
}
if !(u.RestrictionReason == nil) {
return false
}
if !(u.BotInlinePlaceholder == "") {
return false
}
if !(u.LangCode == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (u *User) String() string {
if u == nil {
return "User(nil)"
}
type Alias User
return fmt.Sprintf("User%+v", Alias(*u))
}
// FillFrom fills User from given interface.
func (u *User) FillFrom(from interface {
GetSelf() (value bool)
GetContact() (value bool)
GetMutualContact() (value bool)
GetDeleted() (value bool)
GetBot() (value bool)
GetBotChatHistory() (value bool)
GetBotNochats() (value bool)
GetVerified() (value bool)
GetRestricted() (value bool)
GetMin() (value bool)
GetBotInlineGeo() (value bool)
GetSupport() (value bool)
GetScam() (value bool)
GetApplyMinPhoto() (value bool)
GetFake() (value bool)
GetID() (value int)
GetAccessHash() (value int64, ok bool)
GetFirstName() (value string, ok bool)
GetLastName() (value string, ok bool)
GetUsername() (value string, ok bool)
GetPhone() (value string, ok bool)
GetPhoto() (value UserProfilePhotoClass, ok bool)
GetStatus() (value UserStatusClass, ok bool)
GetBotInfoVersion() (value int, ok bool)
GetRestrictionReason() (value []RestrictionReason, ok bool)
GetBotInlinePlaceholder() (value string, ok bool)
GetLangCode() (value string, ok bool)
}) {
u.Self = from.GetSelf()
u.Contact = from.GetContact()
u.MutualContact = from.GetMutualContact()
u.Deleted = from.GetDeleted()
u.Bot = from.GetBot()
u.BotChatHistory = from.GetBotChatHistory()
u.BotNochats = from.GetBotNochats()
u.Verified = from.GetVerified()
u.Restricted = from.GetRestricted()
u.Min = from.GetMin()
u.BotInlineGeo = from.GetBotInlineGeo()
u.Support = from.GetSupport()
u.Scam = from.GetScam()
u.ApplyMinPhoto = from.GetApplyMinPhoto()
u.Fake = from.GetFake()
u.ID = from.GetID()
if val, ok := from.GetAccessHash(); ok {
u.AccessHash = val
}
if val, ok := from.GetFirstName(); ok {
u.FirstName = val
}
if val, ok := from.GetLastName(); ok {
u.LastName = val
}
if val, ok := from.GetUsername(); ok {
u.Username = val
}
if val, ok := from.GetPhone(); ok {
u.Phone = val
}
if val, ok := from.GetPhoto(); ok {
u.Photo = val
}
if val, ok := from.GetStatus(); ok {
u.Status = val
}
if val, ok := from.GetBotInfoVersion(); ok {
u.BotInfoVersion = val
}
if val, ok := from.GetRestrictionReason(); ok {
u.RestrictionReason = val
}
if val, ok := from.GetBotInlinePlaceholder(); ok {
u.BotInlinePlaceholder = val
}
if val, ok := from.GetLangCode(); ok {
u.LangCode = val
}
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*User) TypeID() uint32 {
return UserTypeID
}
// TypeName returns name of type in TL schema.
func (*User) TypeName() string {
return "user"
}
// TypeInfo returns info about TL type.
func (u *User) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "user",
ID: UserTypeID,
}
if u == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Self",
SchemaName: "self",
Null: !u.Flags.Has(10),
},
{
Name: "Contact",
SchemaName: "contact",
Null: !u.Flags.Has(11),
},
{
Name: "MutualContact",
SchemaName: "mutual_contact",
Null: !u.Flags.Has(12),
},
{
Name: "Deleted",
SchemaName: "deleted",
Null: !u.Flags.Has(13),
},
{
Name: "Bot",
SchemaName: "bot",
Null: !u.Flags.Has(14),
},
{
Name: "BotChatHistory",
SchemaName: "bot_chat_history",
Null: !u.Flags.Has(15),
},
{
Name: "BotNochats",
SchemaName: "bot_nochats",
Null: !u.Flags.Has(16),
},
{
Name: "Verified",
SchemaName: "verified",
Null: !u.Flags.Has(17),
},
{
Name: "Restricted",
SchemaName: "restricted",
Null: !u.Flags.Has(18),
},
{
Name: "Min",
SchemaName: "min",
Null: !u.Flags.Has(20),
},
{
Name: "BotInlineGeo",
SchemaName: "bot_inline_geo",
Null: !u.Flags.Has(21),
},
{
Name: "Support",
SchemaName: "support",
Null: !u.Flags.Has(23),
},
{
Name: "Scam",
SchemaName: "scam",
Null: !u.Flags.Has(24),
},
{
Name: "ApplyMinPhoto",
SchemaName: "apply_min_photo",
Null: !u.Flags.Has(25),
},
{
Name: "Fake",
SchemaName: "fake",
Null: !u.Flags.Has(26),
},
{
Name: "ID",
SchemaName: "id",
},
{
Name: "AccessHash",
SchemaName: "access_hash",
Null: !u.Flags.Has(0),
},
{
Name: "FirstName",
SchemaName: "first_name",
Null: !u.Flags.Has(1),
},
{
Name: "LastName",
SchemaName: "last_name",
Null: !u.Flags.Has(2),
},
{
Name: "Username",
SchemaName: "username",
Null: !u.Flags.Has(3),
},
{
Name: "Phone",
SchemaName: "phone",
Null: !u.Flags.Has(4),
},
{
Name: "Photo",
SchemaName: "photo",
Null: !u.Flags.Has(5),
},
{
Name: "Status",
SchemaName: "status",
Null: !u.Flags.Has(6),
},
{
Name: "BotInfoVersion",
SchemaName: "bot_info_version",
Null: !u.Flags.Has(14),
},
{
Name: "RestrictionReason",
SchemaName: "restriction_reason",
Null: !u.Flags.Has(18),
},
{
Name: "BotInlinePlaceholder",
SchemaName: "bot_inline_placeholder",
Null: !u.Flags.Has(19),
},
{
Name: "LangCode",
SchemaName: "lang_code",
Null: !u.Flags.Has(22),
},
}
return typ
}
// Encode implements bin.Encoder.
func (u *User) Encode(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't encode user#938458c1 as nil")
}
b.PutID(UserTypeID)
return u.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (u *User) EncodeBare(b *bin.Buffer) error {
if u == nil {
return fmt.Errorf("can't encode user#938458c1 as nil")
}
if !(u.Self == false) {
u.Flags.Set(10)
}
if !(u.Contact == false) {
u.Flags.Set(11)
}
if !(u.MutualContact == false) {
u.Flags.Set(12)
}
if !(u.Deleted == false) {
u.Flags.Set(13)
}
if !(u.Bot == false) {
u.Flags.Set(14)
}
if !(u.BotChatHistory == false) {
u.Flags.Set(15)
}
if !(u.BotNochats == false) {
u.Flags.Set(16)
}
if !(u.Verified == false) {
u.Flags.Set(17)
}
if !(u.Restricted == false) {
u.Flags.Set(18)
}
if !(u.Min == false) {
u.Flags.Set(20)
}
if !(u.BotInlineGeo == false) {
u.Flags.Set(21)
}
if !(u.Support == false) {
u.Flags.Set(23)
}
if !(u.Scam == false) {
u.Flags.Set(24)
}
if !(u.ApplyMinPhoto == false) {
u.Flags.Set(25)
}
if !(u.Fake == false) {
u.Flags.Set(26)
}
if !(u.AccessHash == 0) {
u.Flags.Set(0)
}
if !(u.FirstName == "") {
u.Flags.Set(1)
}
if !(u.LastName == "") {
u.Flags.Set(2)
}
if !(u.Username == "") {
u.Flags.Set(3)
}
if !(u.Phone == "") {
u.Flags.Set(4)
}
if !(u.Photo == nil) {
u.Flags.Set(5)
}
if !(u.Status == nil) {
u.Flags.Set(6)
}
if !(u.BotInfoVersion == 0) {
u.Flags.Set(14)
}
if !(u.RestrictionReason == nil) {
u.Flags.Set(18)
}
if !(u.BotInlinePlaceholder == "") {
u.Flags.Set(19)
}
if !(u.LangCode == "") {
u.Flags.Set(22)
}
if err := u.Flags.Encode(b); err != nil {
return fmt.Errorf("unable to encode user#938458c1: field flags: %w", err)
}
b.PutInt(u.ID)
if u.Flags.Has(0) {
b.PutLong(u.AccessHash)
}
if u.Flags.Has(1) {
b.PutString(u.FirstName)
}
if u.Flags.Has(2) {
b.PutString(u.LastName)
}
if u.Flags.Has(3) {
b.PutString(u.Username)
}
if u.Flags.Has(4) {
b.PutString(u.Phone)
}
if u.Flags.Has(5) {
if u.Photo == nil {
return fmt.Errorf("unable to encode user#938458c1: field photo is nil")
}
if err := u.Photo.Encode(b); err != nil {
return fmt.Errorf("unable to encode user#938458c1: field photo: %w", err)
}
}
if u.Flags.Has(6) {
if u.Status == nil {
return fmt.Errorf("unable to encode user#938458c1: field status is nil")
}
if err := u.Status.Encode(b); err != nil {
return fmt.Errorf("unable to encode user#938458c1: field status: %w", err)
}
}
if u.Flags.Has(14) {
b.PutInt(u.BotInfoVersion)
}
if u.Flags.Has(18) {
b.PutVectorHeader(len(u.RestrictionReason))
for idx, v := range u.RestrictionReason {
if err := v.Encode(b); err != nil {
return fmt.Errorf("unable to encode user#938458c1: field restriction_reason element with index %d: %w", idx, err)
}
}
}
if u.Flags.Has(19) {
b.PutString(u.BotInlinePlaceholder)
}
if u.Flags.Has(22) {
b.PutString(u.LangCode)
}
return nil
}
// SetSelf sets value of Self conditional field.
func (u *User) SetSelf(value bool) {
if value {
u.Flags.Set(10)
u.Self = true
} else {
u.Flags.Unset(10)
u.Self = false
}
}
// GetSelf returns value of Self conditional field.
func (u *User) GetSelf() (value bool) {
return u.Flags.Has(10)
}
// SetContact sets value of Contact conditional field.
func (u *User) SetContact(value bool) {
if value {
u.Flags.Set(11)
u.Contact = true
} else {
u.Flags.Unset(11)
u.Contact = false
}
}
// GetContact returns value of Contact conditional field.
func (u *User) GetContact() (value bool) {
return u.Flags.Has(11)
}
// SetMutualContact sets value of MutualContact conditional field.
func (u *User) SetMutualContact(value bool) {
if value {
u.Flags.Set(12)
u.MutualContact = true
} else {
u.Flags.Unset(12)
u.MutualContact = false
}
}
// GetMutualContact returns value of MutualContact conditional field.
func (u *User) GetMutualContact() (value bool) {
return u.Flags.Has(12)
}
// SetDeleted sets value of Deleted conditional field.
func (u *User) SetDeleted(value bool) {
if value {
u.Flags.Set(13)
u.Deleted = true
} else {
u.Flags.Unset(13)
u.Deleted = false
}
}
// GetDeleted returns value of Deleted conditional field.
func (u *User) GetDeleted() (value bool) {
return u.Flags.Has(13)
}
// SetBot sets value of Bot conditional field.
func (u *User) SetBot(value bool) {
if value {
u.Flags.Set(14)
u.Bot = true
} else {
u.Flags.Unset(14)
u.Bot = false
}
}
// GetBot returns value of Bot conditional field.
func (u *User) GetBot() (value bool) {
return u.Flags.Has(14)
}
// SetBotChatHistory sets value of BotChatHistory conditional field.
func (u *User) SetBotChatHistory(value bool) {
if value {
u.Flags.Set(15)
u.BotChatHistory = true
} else {
u.Flags.Unset(15)
u.BotChatHistory = false
}
}
// GetBotChatHistory returns value of BotChatHistory conditional field.
func (u *User) GetBotChatHistory() (value bool) {
return u.Flags.Has(15)
}
// SetBotNochats sets value of BotNochats conditional field.
func (u *User) SetBotNochats(value bool) {
if value {
u.Flags.Set(16)
u.BotNochats = true
} else {
u.Flags.Unset(16)
u.BotNochats = false
}
}
// GetBotNochats returns value of BotNochats conditional field.
func (u *User) GetBotNochats() (value bool) {
return u.Flags.Has(16)
}
// SetVerified sets value of Verified conditional field.
func (u *User) SetVerified(value bool) {
if value {
u.Flags.Set(17)
u.Verified = true
} else {
u.Flags.Unset(17)
u.Verified = false
}
}
// GetVerified returns value of Verified conditional field.
func (u *User) GetVerified() (value bool) {
return u.Flags.Has(17)
}
// SetRestricted sets value of Restricted conditional field.
func (u *User) SetRestricted(value bool) {
if value {
u.Flags.Set(18)
u.Restricted = true
} else {
u.Flags.Unset(18)
u.Restricted = false
}
}
// GetRestricted returns value of Restricted conditional field.
func (u *User) GetRestricted() (value bool) {
return u.Flags.Has(18)
}
// SetMin sets value of Min conditional field.
func (u *User) SetMin(value bool) {
if value {
u.Flags.Set(20)
u.Min = true
} else {
u.Flags.Unset(20)
u.Min = false
}
}
// GetMin returns value of Min conditional field.
func (u *User) GetMin() (value bool) {
return u.Flags.Has(20)
}
// SetBotInlineGeo sets value of BotInlineGeo conditional field.
func (u *User) SetBotInlineGeo(value bool) {
if value {
u.Flags.Set(21)
u.BotInlineGeo = true
} else {
u.Flags.Unset(21)
u.BotInlineGeo = false
}
}
// GetBotInlineGeo returns value of BotInlineGeo conditional field.
func (u *User) GetBotInlineGeo() (value bool) {
return u.Flags.Has(21)
}
// SetSupport sets value of Support conditional field.
func (u *User) SetSupport(value bool) {
if value {
u.Flags.Set(23)
u.Support = true
} else {
u.Flags.Unset(23)
u.Support = false
}
}
// GetSupport returns value of Support conditional field.
func (u *User) GetSupport() (value bool) {
return u.Flags.Has(23)
}
// SetScam sets value of Scam conditional field.
func (u *User) SetScam(value bool) {
if value {
u.Flags.Set(24)
u.Scam = true
} else {
u.Flags.Unset(24)
u.Scam = false
}
}
// GetScam returns value of Scam conditional field.
func (u *User) GetScam() (value bool) {
return u.Flags.Has(24)
}
// SetApplyMinPhoto sets value of ApplyMinPhoto conditional field.
func (u *User) SetApplyMinPhoto(value bool) {
if value {
u.Flags.Set(25)
u.ApplyMinPhoto = true
} else {
u.Flags.Unset(25)
u.ApplyMinPhoto = false
}
}
// GetApplyMinPhoto returns value of ApplyMinPhoto conditional field.
func (u *User) GetApplyMinPhoto() (value bool) {
return u.Flags.Has(25)
}
// SetFake sets value of Fake conditional field.
func (u *User) SetFake(value bool) {
if value {
u.Flags.Set(26)
u.Fake = true
} else {
u.Flags.Unset(26)
u.Fake = false
}
}
// GetFake returns value of Fake conditional field.
func (u *User) GetFake() (value bool) {
return u.Flags.Has(26)
}