This repository has been archived by the owner on Feb 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTelegramBotApi.Types.pas
3935 lines (3744 loc) · 130 KB
/
TelegramBotApi.Types.pas
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
{***************************************************************************}
{ }
{ TelegaPi }
{ }
{ Copyright (C) 2021 Maxim Sysoev }
{ }
{ https://t.me/CloudAPI }
{ }
{ }
{***************************************************************************}
{ }
{ Licensed under the Apache License, Version 2.0 (the "License"); }
{ you may not use this file except in compliance with the License. }
{ You may obtain a copy of the License at }
{ }
{ http://www.apache.org/licenses/LICENSE-2.0 }
{ }
{ Unless required by applicable law or agreed to in writing, software }
{ distributed under the License is distributed on an "AS IS" BASIS, }
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
{ See the License for the specific language governing permissions and }
{ limitations under the License. }
{ }
{***************************************************************************}
unit TelegramBotApi.Types;
interface
uses
CloudAPI.Json.Converters,
CloudAPI.Response,
CloudAPI.Types,
System.Generics.Collections,
System.Json.Converters,
System.Json.Serializers,
TelegramBotApi.Json.Converter,
TelegramBotApi.Types.Enums,
TelegramBotApi.Types.Intf,
TelegramBotApi.Types.Keyboards;
type
// TtgMessageEntity = class;
// TtgChatPhoto = class;
TtgMessage = class;
// TtgChatPermissions = class;
// TtgChatLocation = class;
// TtgPhotosize = class;
// TtgAnimation = class;
// TtgVideo = class;
// TtgVideoNote = class;
// TtgVenue = class;
// TtgContact = class;
// TtgDocument = class;
// TtgAudio = class;
// TtgVoice = class;
// TtgPoll = class;
// TtgSticker = class;
// TtgDice = class;
// TtgGame = class;
// TtgLocation = class;
// TtgInvoice = class;
// TtgSuccessfulPayment = class;
// TtgPassportData = class;
// TtgProximityAlertTriggered = class;
// TtgFileInfo = class;
/// <summary>
/// This object represents a unique message identifier.
/// </summary>
TtgMessageId = class
private
[JsonName('message_id')]
FMessageID: Int64;
public
/// <summary>
/// Unique message identifier
/// </summary>
property MessageID: Int64 read FMessageID write FMessageID;
end;
TtgFileInfo = class
private
[JsonName('file_id')]
FFileId: string;
[JsonName('file_unique_id')]
FFileUniqueId: string;
[JsonName('file_size')]
FFileSize: Int64;
public
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId: string read FFileId write FFileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId: string read FFileUniqueId write FFileUniqueId;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize: Int64 read FFileSize write FFileSize;
end;
/// <summary>
/// This object represents a file ready to be downloaded. The file can be
/// downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
/// It is guaranteed that the link will be valid for at least 1 hour. When the link
/// expires, a new one can be requested by calling getFile.
/// </summary>
/// <remarks>
/// Maximum file size to download is 20 MB
/// </remarks>
TtgFile = class(TtgFileInfo)
private
[JsonName('file_path')]
FFilePath: string;
public
function GetFileUrl(const AToken: string): string;
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Optional. File size, if known
/// </summary>
property FileSize;
/// <summary>
/// Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path>
/// to get the file.
/// </summary>
property FilePath: string read FFilePath write FFilePath;
end;
/// <summary>
/// This object represents one size of a photo or a file / sticker thumbnail
/// </summary>
TtgPhotoSize = class(TtgFileInfo)
private
[JsonName('width')]
FWidth: Int64;
[JsonName('height')]
FHeight: Int64;
public
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Photo width
/// </summary>
property Width: Int64 read FWidth write FWidth;
/// <summary>
/// Photo height
/// </summary>
property Height: Int64 read FHeight write FHeight;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents a general file (as opposed to photos, voice messages and audio files).
/// </summary>
TtgDocument = class(TtgFileInfo)
private
[JsonName('thumb')]
FThumb: TtgPhotoSize;
[JsonName('file_name')]
FFilename: string;
[JsonName('mime_type')]
FMimeType: string;
public
constructor Create;
destructor Destroy; override;
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Optional. Document thumbnail as defined by sender
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
/// <summary>
/// Optional. Original filename as defined by sender
/// </summary>
property Filename: string read FFilename write FFilename;
/// <summary>
/// Optional. MIME type of the file as defined by sender
/// </summary>
property MimeType: string read FMimeType write FMimeType;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents a voice note.
/// </summary>
TtgVoice = class(TtgFileInfo)
private
[JsonName('duration')]
FDuration: Int64;
[JsonName('mime_type')]
FMimeType: string;
public
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Duration of the audio in seconds as defined by sender
/// </summary>
property Duration: Int64 read FDuration write FDuration;
/// <summary>
/// Optional. MIME type of the file as defined by sender
/// </summary>
property MimeType: string read FMimeType write FMimeType;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents an audio file to be treated as music by the Telegram clients.
/// </summary>
TtgAudio = class(TtgVoice)
private
[JsonName('performer')]
FPerformer: string;
[JsonName('title')]
FTitle: string;
[JsonName('thumb')]
FThumb: TtgPhotoSize;
FFilename: string;
public
constructor Create;
destructor Destroy; override;
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Duration of the audio in seconds as defined by sender
/// </summary>
property Duration;
/// <summary>
/// Optional. Performer of the audio as defined by sender or by audio tags
/// </summary>
property Performer: string read FPerformer write FPerformer;
/// <summary>
/// Optional. Title of the audio as defined by sender or by audio tags
/// </summary>
property Title: string read FTitle write FTitle;
/// <summary>
/// Optional. Original filename as defined by sender
/// </summary>
property Filename: string read FFilename write FFilename;
/// <summary>
/// Optional. MIME type of the file as defined by sender
/// </summary>
property MimeType;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
/// <summary>
/// Optional. Thumbnail of the album cover to which the music file belongs
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
end;
/// <summary>
/// This object represents a video file.
/// </summary>
TtgVideo = class(TtgPhotoSize)
private
[JsonName('duration')]
FDuration: Int64;
[JsonName('thumb')]
FThumb: TtgPhotoSize;
[JsonName('mime_type')]
FMimeType: string;
FFilename: string;
public
constructor Create;
destructor Destroy; override;
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Video width as defined by sender
/// </summary>
property Width;
/// <summary>
/// Video height as defined by sender
/// </summary>
property Height;
/// <summary>
/// Duration of the video in seconds as defined by sender
/// </summary>
property Duration: Int64 read FDuration write FDuration;
/// <summary>
/// Optional. Video thumbnail
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
/// <summary>
/// Optional. Original filename as defined by sender
/// </summary>
property Filename: string read FFilename write FFilename;
/// <summary>
/// Optional. Mime type of a file as defined by sender
/// </summary>
property MimeType: string read FMimeType write FMimeType;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents an animation file (GIF or H.264/MPEG-4 AVC video without
/// sound).
/// </summary>
TtgAnimation = class(TtgVideo)
private
[JsonName('file_name')]
FFilename: string;
public
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Video width as defined by sender
/// </summary>
property Width;
/// <summary>
/// Video height as defined by sender
/// </summary>
property Height;
/// <summary>
/// Duration of the video in seconds as defined by sender
/// </summary>
property Duration;
/// <summary>
/// Optional. Animation thumbnail as defined by sender
/// </summary>
property Thumb;
/// <summary>
/// Optional. Original animation filename as defined by sender
/// </summary>
property Filename: string read FFilename write FFilename;
/// <summary>
/// Optional. Mime type of a file as defined by sender
/// </summary>
property MimeType;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents a video message (available in Telegram apps as of v.4.0).
/// </summary>
TtgVideoNote = class(TtgFileInfo)
private
[JsonName('length')]
FLength: Int64;
[JsonName('duration')]
FDuration: Int64;
[JsonName('thumb')]
FThumb: TtgPhotoSize;
public
constructor Create;
destructor Destroy; override;
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Video width and height (diameter of the video message) as defined by sender
/// </summary>
property Length: Int64 read FLength write FLength;
/// <summary>
/// Duration of the video in seconds as defined by sender
/// </summary>
property Duration: Int64 read FDuration write FDuration;
/// <summary>
/// Optional. Video thumbnail
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
/// <summary>
/// Optional. File size
/// </summary>
property FileSize;
end;
/// <summary>This object represents a point on the map.</summary>
TtgLocation = class
private
[JsonName('longitude')]
FLongitude: Single;
[JsonName('latitude')]
FLatitude: Single;
[JsonName('horizontal_accuracy')]
FHorizontalAccuracy: Single;
[JsonName('live_period')]
FLivePeriod: Integer;
[JsonName('heading')]
FHeading: Integer;
[JsonName('proximity_alert_radius')]
FProximityAlertRadius: Integer;
public
/// <summary>Longitude as defined by sender</summary>
property Longitude: Single read FLongitude write FLongitude;
/// <summary>
/// Latitude as defined by sender
/// </summary>
property Latitude: Single read FLatitude write FLatitude;
/// <summary>
/// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
/// </summary>
property HorizontalAccuracy: Single read FHorizontalAccuracy write FHorizontalAccuracy;
/// <summary>
/// Optional. Time relative to the message sending date, during which the location
/// can be updated, in seconds. For active live locations only.
/// </summary>
property LivePeriod: Integer read FLivePeriod write FLivePeriod;
/// <summary>
/// Optional. The direction in which user is moving, in degrees; 1-360. For active
/// live locations only.
/// </summary>
property Heading: Integer read FHeading write FHeading;
/// <summary>
/// Optional. Maximum distance for proximity alerts about approaching another chat
/// member, in meters. For sent live locations only.
/// </summary>
property ProximityAlertRadius: Integer read FProximityAlertRadius write FProximityAlertRadius;
end;
/// <summary>
/// This object represents a venue.
/// </summary>
TtgVenue = class
private
[JsonName('location')]
FLocation: TtgLocation;
[JsonName('title')]
FTitle: string;
[JsonName('address')]
FAddress: string;
[JsonName('foursquare_id')]
FFoursquareId: string;
[JsonName('foursquare_type')]
FFoursquareType: string;
[JsonName('google_place_id')]
FGooglePlaceId: string;
[JsonName('google_place_type')]
FGooglePlaceType: string;
public
constructor Create;
destructor Destroy; override;
/// <summary>
/// Venue location
/// </summary>
property Location: TtgLocation read FLocation write FLocation;
/// <summary>Name of the venue</summary>
property Title: string read FTitle write FTitle;
/// <summary>
/// Address of the venue
/// </summary>
property Address: string read FAddress write FAddress;
/// <summary>
/// Optional. Foursquare identifier of the venue
/// </summary>
property FoursquareId: string read FFoursquareId write FFoursquareId;
/// <summary>
/// Optional. Foursquare type of the venue. (For example,
/// “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
/// </summary>
property FoursquareType: string read FFoursquareType write FFoursquareType;
/// <summary>
/// Optional. Google Places identifier of the venue
/// </summary>
property GooglePlaceId: string read FGooglePlaceId write FGooglePlaceId;
/// <summary>
/// Optional. Google Places type of the venue. (See supported types.)
/// </summary>
property GooglePlaceType: string read FGooglePlaceType write FGooglePlaceType;
end;
/// <summary>
/// This object represents a phone contact.
/// </summary>
TtgContact = class
private
[JsonName('phone_number')]
FPhoneNumber: string;
[JsonName('first_name')]
FFirstName: string;
[JsonName('last_name')]
FLastName: string;
[JsonName('user_id')]
FUserId: Int64;
[JsonName('vcard')]
FVCard: string;
public
/// <summary>
/// Contact's phone number
/// </summary>
property PhoneNumber: string read FPhoneNumber write FPhoneNumber;
/// <summary>
/// Contact's first name
/// </summary>
property FirstName: string read FFirstName write FFirstName;
/// <summary>
/// Optional. Contact's last name
/// </summary>
property LastName: string read FLastName write FLastName;
/// <summary>
/// Optional. Contact's user identifier in Telegram
/// </summary>
property UserId: Int64 read FUserId write FUserId;
/// <summary>
/// Optional. Additional data about the contact in the form of a vCard
/// </summary>
property VCard: string read FVCard write FVCard;
end;
/// <summary>
/// This object contains information about one answer option in a poll.
/// </summary>
TtgPollOption = class
private
[JsonName('text')]
FText: string;
[JsonName('voter_count')]
FVoterCount: Integer;
public
/// <summary>
/// Option text, 1-100 characters
/// </summary>
property Text: string read FText write FText;
/// <summary>
/// Number of users that voted for this option
/// </summary>
property VoterCount: Integer read FVoterCount write FVoterCount;
end;
/// <summary>
/// This object represents a Telegram user or bot.
/// </summary>
TtgUser = class(TInterfacedObject, ItgUser)
private
[JsonName('id')]
FID: Int64;
[JsonName('is_bot')]
FIsBot: Boolean;
[JsonName('first_name')]
FFirstName: string;
[JsonName('last_name')]
FLastName: string;
[JsonName('username')]
FUsername: string;
[JsonName('language_code')]
FLanguageCode: string;
[JsonName('can_join_groups')]
FCanJoinGroups: Boolean;
[JsonName('can_read_all_group_messages')]
FCanReadAllGroupMessages: Boolean;
[JsonName('supports_inline_queries')]
FSupportsInlineQueries: Boolean;
function GetID: Int64;
function GetIsBot: Boolean;
function GetFirstName: string;
function GetLastName: string;
function GetUsername: string;
function GetLanguageCode: string;
function GetCanJoinGroups: Boolean;
function GetCanReadAllGroupMessages: Boolean;
function GetSupportsInlineQueries: Boolean;
public
/// <summary>
/// Unique identifier for this user or bot
/// </summary>
property ID: Int64 read GetID;
/// <summary>
/// True, if this user is a bot
/// </summary>
property IsBot: Boolean read GetIsBot;
/// <summary>
/// User's or bot's first name
/// </summary>
property FirstName: string read GetFirstName;
/// <summary>
/// Optional. User's or bot's last name
/// </summary>
property LastName: string read GetLastName;
/// <summary>
/// Optional. User's or bot's username
/// </summary>
property Username: string read GetUsername;
/// <summary>
/// Optional. IETF language tag of the user's language (https://en.wikipedia.
/// org/wiki/IETF_language_tag)
/// </summary>
property LanguageCode: string read GetLanguageCode;
/// <summary>
/// Optional. True, if the bot can be invited to groups. Returned only in getMe
/// <see cref="TTelegramBotApi.GetMe"/>.
/// </summary>
property CanJoinGroups: Boolean read GetCanJoinGroups;
/// <summary>
/// Optional. True, if privacy mode is disabled for the bot. Returned only in getMe
/// <see cref="TTelegramBotApi.GetMe"/>.
/// </summary>
property CanReadAllGroupMessages: Boolean read GetCanReadAllGroupMessages;
/// <summary>
/// Optional. True, if the bot supports inline queries. Returned only in getMe <see
/// cref="TTelegramBotApi.GetMe"/>.
/// </summary>
property SupportsInlineQueries: Boolean read GetSupportsInlineQueries;
end;
/// <summary>
/// This object represents an answer of a user in a non-anonymous poll.
/// </summary>
TtgPollAnswer = class
private
[JsonName('poll_id')]
FPollId: string;
[JsonName('user')]
FUser: TtgUser;
[JsonName('option_ids')]
FOptionIDs: TArray<Integer>;
public
/// <summary>
/// Unique poll identifier
/// </summary>
property PollId: string read FPollId write FPollId;
/// <summary>
/// The user, who changed the answer to the poll
/// </summary>
property User: TtgUser read FUser write FUser;
/// <summary>
/// 0-based identifiers of answer options, chosen by the user. May be empty if the
/// user retracted their vote.
/// </summary>
property OptionIDs: TArray<Integer> read FOptionIDs write FOptionIDs;
end;
/// <summary>
/// This object describes the position on faces where a mask should be placed by
/// default.
/// </summary>
TtgMaskPosition = class
private
[JsonName('mask_position')]
FPoint: string;
[JsonName('x_shift')]
Fx_shift: Single;
[JsonName('y_shift')]
Fy_shift: Single;
[JsonName('scale')]
FScale: Single;
public
/// <summary>
/// The part of the face relative to which the mask should be placed. One of
/// “forehead”, “eyes”, “mouth”, or “chin”.
/// </summary>
property Point: string read FPoint write FPoint;
/// <summary>
/// Shift by X-axis measured in widths of the mask scaled to the face size, from
/// left to right. For example, choosing -1.0 will place mask just to the left of
/// the default mask position.
/// </summary>
property x_shift: Single read Fx_shift write Fx_shift;
/// <summary>
/// Shift by Y-axis measured in heights of the mask scaled to the face size, from
/// top to bottom. For example, 1.0 will place the mask just below the default mask
/// position.
/// </summary>
property y_shift: Single read Fy_shift write Fy_shift;
/// <summary>
/// Mask scaling coefficient. For example, 2.0 means double size.
/// </summary>
property Scale: Single read FScale write FScale;
end;
/// <summary>
/// This object represents a sticker.
/// </summary>
TtgSticker = class(TtgPhotoSize)
private
[JsonName('is_animated')]
FIsAnimated: Boolean;
[JsonName('is_video')]
FIsVideo: Boolean;
[JsonName('thumb')]
FThumb: TtgPhotoSize;
[JsonName('emoji')]
FEmoji: string;
[JsonName('set_name')]
FSetName: string;
FMaskPosition: TtgMaskPosition;
public
/// <summary>
/// Identifier for this file, which can be used to download or reuse the file
/// </summary>
property FileId;
/// <summary>
/// Unique identifier for this file, which is supposed to be the same over time and
/// for different bots. Can't be used to download or reuse the file.
/// </summary>
property FileUniqueId;
/// <summary>
/// Sticker width
/// </summary>
property Width;
/// <summary>
/// Sticker height
/// </summary>
property Height;
/// <summary>
/// True, if the sticker is animated
/// </summary>
property IsAnimated: Boolean read FIsAnimated write FIsAnimated;
/// <summary>
/// True, if the sticker is a video sticker
/// </summary>
property IsVideo: Boolean read FIsVideo write FIsVideo;
/// <summary>
/// Optional. Sticker thumbnail in the .WEBP or .JPG format
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
/// <summary>
/// Optional. Sticker thumbnail in the .WEBP or .JPG format
/// </summary>
property Emoji: string read FEmoji write FEmoji;
/// <summary>
/// Optional. Name of the sticker set to which the sticker belongs
/// </summary>
property SetName: string read FSetName write FSetName;
/// <summary>
/// Optional. For mask stickers, the position where the mask should be placed
/// </summary>
property MaskPosition: TtgMaskPosition read FMaskPosition write FMaskPosition;
/// <summary>
/// Optional. For mask stickers, the position where the mask should be placed
/// </summary>
property FileSize;
end;
/// <summary>
/// This object represents a sticker set.
/// </summary>
TtgStickerSet = class
private
[JsonName('stickers')]
[JsonName('name')]
FName: string;
[JsonName('title')]
FTitle: string;
[JsonName('is_animated')]
FIsAnimated: Boolean;
[JsonName('is_video')]
FIsVideo: Boolean;
[JsonName('contains_masks')]
FContainsMasks: Boolean;
[JsonName('stickers')]
FStickers: TArray<TtgSticker>;
FThumb: TtgPhotoSize;
public
destructor Destroy; override;
/// <summary>
/// Sticker set name
/// </summary>
property Name: string read FName write FName;
/// <summary>
/// Sticker set title
/// </summary>
property Title: string read FTitle write FTitle;
/// <summary>
/// True, if the sticker set contains animated stickers
/// </summary>
property IsAnimated: Boolean read FIsAnimated write FIsAnimated;
/// <summary>
/// True, if the sticker set contains video stickers
/// </summary>
property IsVideo: Boolean read FIsVideo write FIsVideo;
/// <summary>
/// True, if the sticker set contains masks
/// </summary>
property ContainsMasks: Boolean read FContainsMasks write FContainsMasks;
/// <summary>
/// List of all set stickers
/// </summary>
property Stickers: TArray<TtgSticker> read FStickers write FStickers;
/// <summary>
/// Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
/// </summary>
property Thumb: TtgPhotoSize read FThumb write FThumb;
end;
/// <summary>
/// This object represents an animated emoji that displays a random value.
/// </summary>
TtgDice = class
private
[JsonName('emoji')]
FEmoji: string;
[JsonName('value')]
FValue: Integer;
public
/// <summary>
/// Emoji on which the dice throw animation is based
/// </summary>
property Emoji: string read FEmoji write FEmoji;
/// <summary>
/// Value of the dice, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” and “⚽” base
/// emoji, 1-64 for “🎰” base emoji
/// </summary>
property Value: Integer read FValue write FValue;
end;
/// <summary>
/// This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
/// </summary>
TtgGame = class
{ TODO -oOwner -cGeneral : Заполнить }
end;
/// <summary>
/// This object contains basic information about an invoice.
/// </summary>
TtgInvoice = class
{ TODO -oOwner -cGeneral : Заполнить }
end;
/// <summary>
/// This object contains basic information about a successful payment.
/// </summary>
TtgSuccessfulPayment = class
{ TODO -oOwner -cGeneral : Заполнить }
end;
/// <summary>
/// Contains information about Telegram Passport data shared with the bot by the user.
/// </summary>
TtgPassportData = class
{ TODO -oOwner -cGeneral : Заполнить }
end;
/// <summary>
/// This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
/// </summary>
TtgProximityAlertTriggered = class
private
[JsonName('traveler')]
FTraveler: TtgUser;
[JsonName('watcher')]
FWatcher: TtgUser;
[JsonName('distance')]
FDistance: Integer;
public
/// <summary>
/// User that triggered the alert
/// </summary>
property Traveler: TtgUser read FTraveler write FTraveler;
/// <summary>
/// User that set the alert
/// </summary>
property Watcher: TtgUser read FWatcher write FWatcher;
/// <summary>
/// The distance between the users
/// </summary>
property Distance: Integer read FDistance write FDistance;
end;
/// <summary>
/// This object represents a chat photo.
/// </summary>
TtgChatPhoto = class
private
[JsonName('small_file_id')]
FSmallFileId: string;
[JsonName('small_file_unique_id')]
FSmallFileUniqueId: string;
[JsonName('big_file_id')]
FBigFileId: string;
[JsonName('big_file_unique_id')]
FBigFileUniqueId: string;
public
/// <summary>
/// File identifier of small (160x160) chat photo. This file_id can be used only
/// for photo download and only for as long as the photo is not changed.
/// </summary>
property SmallFileId: string read FSmallFileId write FSmallFileId;
/// <summary>
/// Unique file identifier of small (160x160) chat photo, which is supposed to be
/// the same over time and for different bots. Can't be used to download or reuse
/// the file.
/// </summary>
property SmallFileUniqueId: string read FSmallFileUniqueId write FSmallFileUniqueId;
/// <summary>
/// File identifier of big (640x640) chat photo. This file_id can be used only
/// for photo download and only for as long as the photo is not changed.
/// </summary>
property BigFileId: string read FBigFileId write FBigFileId;
/// <summary>
/// Unique file identifier of big (640x640) chat photo, which is supposed to be the
/// same over time and for different bots. Can't be used to download or reuse the
/// file.
/// </summary>
property BigFileUniqueId: string read FBigFileUniqueId write FBigFileUniqueId;
end;
/// <summary>
/// Describes actions that a non-administrator user is allowed to take in a chat.
/// </summary>
TtgChatPermissions = class
private
[JsonName('can_send_messages')]
FCanSendMessages: Boolean;
[JsonName('can_send_media_messages')]
FCanSendMediaMessages: Boolean;
[JsonName('can_send_polls')]
FCanSendPolls: Boolean;
[JsonName('can_send_other_messages')]
FCanSendOtherMessages: Boolean;
[JsonName('can_add_web_page_previews')]
FCanAddWebPagePreviews: Boolean;
[JsonName('can_change_info')]
FCanChangeInfo: Boolean;
[JsonName('can_invite_users')]
FCanInviteUsers: Boolean;
[JsonName('can_pin_messages')]
FCanPinMessages: Boolean;
public
/// <summary>
/// Optional. True, if the user is allowed to send text messages, contacts,
/// locations and venues
/// </summary>
property CanSendMessages: Boolean read FCanSendMessages;
/// <summary>
/// Optional. True, if the user is allowed to send audios, documents, photos,
/// videos, video notes and voice notes, implies can_send_messages
/// </summary>
property CanSendMediaMessages: Boolean read FCanSendMediaMessages;
/// <summary>
/// Optional. True, if the user is allowed to send polls, implies can_send_messages
/// </summary>
property CanSendPolls: Boolean read FCanSendPolls;