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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
|
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An object of this type can be returned on every function call, in case of an error"]
pub struct Error {
#[doc = "Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user"]
pub code: i32,
#[doc = "Error message; subject to future changes"]
pub message: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An object of this type is returned on a successful function call for certain functions"]
pub struct Ok {}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Contains parameters for TDLib initialization"]
pub struct TdlibParameters {
#[doc = "If set to true, the Telegram test environment will be used instead of the production environment"]
pub use_test_dc: bool,
#[doc = "The path to the directory for the persistent database; if empty, the current working directory will be used"]
pub database_directory: String,
#[doc = "The path to the directory for storing files; if empty, database_directory will be used"]
pub files_directory: String,
#[doc = "If set to true, information about downloaded and uploaded files will be saved between application restarts"]
pub use_file_database: bool,
#[doc = "If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database"]
pub use_chat_info_database: bool,
#[doc = "If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database"]
pub use_message_database: bool,
#[doc = "If set to true, support for secret chats will be enabled"]
pub use_secret_chats: bool,
#[doc = "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org"]
pub api_id: i32,
#[doc = "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org"]
pub api_hash: String,
#[doc = "IETF language tag of the user's operating system language; must be non-empty"]
pub system_language_code: String,
#[doc = "Model of the device the application is being run on; must be non-empty"]
pub device_model: String,
#[doc = "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib"]
pub system_version: String,
#[doc = "Application version; must be non-empty"]
pub application_version: String,
#[doc = "If set to true, old files will automatically be deleted"]
pub enable_storage_optimizer: bool,
#[doc = "If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name"]
pub ignore_file_names: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "TDLib needs an encryption key to decrypt the local database "]
pub struct AuthorizationStateWaitEncryptionKey {
#[doc = "True, if the database is currently encrypted"]
pub is_encrypted: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "TDLib needs the user's authentication code to authorize "]
pub struct AuthorizationStateWaitCode {
#[doc = "Information about the authorization code that was sent \n\nOriginal type: AuthenticationCodeInfo"]
pub code_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link "]
pub struct AuthorizationStateWaitOtherDeviceConfirmation {
#[doc = "A tg:// URL for the QR code. The link will be updated frequently"]
pub link: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration "]
pub struct AuthorizationStateWaitRegistration {
#[doc = "Telegram terms of service \n\nOriginal type: TermsOfService"]
pub terms_of_service: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user has been authorized, but needs to enter a password to start using the application "]
pub struct AuthorizationStateWaitPassword {
#[doc = "Hint for the password; may be empty "]
pub password_hint: String,
#[doc = "True, if a recovery email address has been set up"]
pub has_recovery_email_address: bool,
#[doc = "Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent"]
pub recovery_email_address_pattern: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Describes an image in JPEG format "]
pub struct PhotoSize {
#[serde(rename = "type")]
#[doc = "Image type (see https://core.telegram.org/constructor/photoSize)"]
pub type_: String,
#[doc = "Information about the image file \n\nOriginal type: File"]
pub photo: SerdeJsonValue,
#[doc = "Image width "]
pub width: i32,
#[doc = "Image height"]
pub height: i32,
#[doc = "Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image"]
pub progressive_sizes: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Describes a game "]
pub struct Game {
#[doc = "Game ID "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} "]
pub short_name: String,
#[doc = "Game title "]
pub title: String,
#[doc = "Game text, usually containing scoreboards for a game \n\nOriginal type: FormattedText"]
pub text: SerdeJsonValue,
#[doc = "Game description "]
pub description: String,
#[doc = "Game photo \n\nOriginal type: Photo"]
pub photo: SerdeJsonValue,
#[doc = "Game animation; may be null \n\nOriginal type: Option<Animation>"]
pub animation: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Represents a user"]
pub struct User {
#[doc = "User identifier"]
pub id: i32,
#[doc = "First name of the user"]
pub first_name: String,
#[doc = "Last name of the user"]
pub last_name: String,
#[doc = "Username of the user"]
pub username: String,
#[doc = "Phone number of the user"]
pub phone_number: String,
#[doc = "Current online status of the user \n\nOriginal type: UserStatus"]
pub status: SerdeJsonValue,
#[doc = "Profile photo of the user; may be null \n\nOriginal type: Option<ProfilePhoto>"]
pub profile_photo: SerdeJsonValue,
#[doc = "The user is a contact of the current user"]
pub is_contact: bool,
#[doc = "The user is a contact of the current user and the current user is a contact of the user"]
pub is_mutual_contact: bool,
#[doc = "True, if the user is verified"]
pub is_verified: bool,
#[doc = "True, if the user is Telegram support account"]
pub is_support: bool,
#[doc = "If non-empty, it contains a human-readable description of the reason why access to this user must be restricted"]
pub restriction_reason: String,
#[doc = "True, if many users reported this user as a scam"]
pub is_scam: bool,
#[doc = "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser"]
pub have_access: bool,
#[serde(rename = "type")]
#[doc = "Type of the user \n\nOriginal type: UserType"]
pub type_: SerdeJsonValue,
#[doc = "IETF language tag of the user's language; only available to bots"]
pub language_code: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Describes a message"]
pub struct Message {
#[doc = "Message identifier; unique for the chat to which the message belongs"]
pub id: i64,
#[doc = "The sender of the message \n\nOriginal type: MessageSender"]
pub sender: SerdeJsonValue,
#[doc = "Chat identifier"]
pub chat_id: i64,
#[doc = "Information about the sending state of the message; may be null \n\nOriginal type: Option<MessageSendingState>"]
pub sending_state: SerdeJsonValue,
#[doc = "Information about the scheduling state of the message; may be null \n\nOriginal type: Option<MessageSchedulingState>"]
pub scheduling_state: SerdeJsonValue,
#[doc = "True, if the message is outgoing"]
pub is_outgoing: bool,
#[doc = "True, if the message is pinned"]
pub is_pinned: bool,
#[doc = "True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application"]
pub can_be_edited: bool,
#[doc = "True, if the message can be forwarded"]
pub can_be_forwarded: bool,
#[doc = "True, if the message can be deleted only for the current user while other users will continue to see it"]
pub can_be_deleted_only_for_self: bool,
#[doc = "True, if the message can be deleted for all users"]
pub can_be_deleted_for_all_users: bool,
#[doc = "True, if the message statistics are available"]
pub can_get_statistics: bool,
#[doc = "True, if the message thread info is available"]
pub can_get_message_thread: bool,
#[doc = "True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts"]
pub is_channel_post: bool,
#[doc = "True, if the message contains an unread mention for the current user"]
pub contains_unread_mention: bool,
#[doc = "Point in time (Unix timestamp) when the message was sent"]
pub date: i32,
#[doc = "Point in time (Unix timestamp) when the message was last edited"]
pub edit_date: i32,
#[doc = "Information about the initial message sender; may be null \n\nOriginal type: Option<MessageForwardInfo>"]
pub forward_info: SerdeJsonValue,
#[doc = "Information about interactions with the message; may be null \n\nOriginal type: Option<MessageInteractionInfo>"]
pub interaction_info: SerdeJsonValue,
#[doc = "If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id"]
pub reply_in_chat_id: i64,
#[doc = "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message"]
pub reply_to_message_id: i64,
#[doc = "If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs"]
pub message_thread_id: i64,
#[doc = "For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires"]
pub ttl: i32,
#[doc = "Time left before the message expires, in seconds"]
pub ttl_expires_in: f64,
#[doc = "If non-zero, the user identifier of the bot through which this message was sent"]
pub via_bot_user_id: i32,
#[doc = "For channel posts and anonymous group messages, optional author signature"]
pub author_signature: String,
#[doc = "Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums"]
#[serde(deserialize_with = "deserialize_i64_0")]
pub media_album_id: i64,
#[doc = "If non-empty, contains a human-readable description of the reason why access to this message must be restricted"]
pub restriction_reason: String,
#[doc = "Content of the message"]
pub content: MessageContent,
#[doc = "Reply markup for the message; may be null \n\nOriginal type: Option<ReplyMarkup>"]
pub reply_markup: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat. (Can be a private chat, basic group, supergroup, or secret chat)"]
pub struct Chat {
#[doc = "Chat unique identifier"]
pub id: i64,
#[serde(rename = "type")]
#[doc = "Type of the chat \n\nOriginal type: ChatType"]
pub type_: SerdeJsonValue,
#[doc = "Chat title"]
pub title: String,
#[doc = "Chat photo; may be null \n\nOriginal type: Option<ChatPhotoInfo>"]
pub photo: SerdeJsonValue,
#[doc = "Actions that non-administrator chat members are allowed to take in the chat \n\nOriginal type: ChatPermissions"]
pub permissions: SerdeJsonValue,
#[doc = "Last message in the chat; may be null"]
pub last_message: Option<Message>,
#[doc = "Positions of the chat in chat lists \n\nOriginal type: Vec<ChatPosition>"]
pub positions: SerdeJsonValue,
#[doc = "True, if the chat is marked as unread"]
pub is_marked_as_unread: bool,
#[doc = "True, if the chat is blocked by the current user and private messages from the chat can't be received"]
pub is_blocked: bool,
#[doc = "True, if the chat has scheduled messages"]
pub has_scheduled_messages: bool,
#[doc = "True, if the chat messages can be deleted only for the current user while other users will continue to see the messages"]
pub can_be_deleted_only_for_self: bool,
#[doc = "True, if the chat messages can be deleted for all users"]
pub can_be_deleted_for_all_users: bool,
#[doc = "True, if the chat can be reported to Telegram moderators through reportChat"]
pub can_be_reported: bool,
#[doc = "Default value of the disable_notification parameter, used when a message is sent to the chat"]
pub default_disable_notification: bool,
#[doc = "Number of unread messages in the chat"]
pub unread_count: i32,
#[doc = "Identifier of the last read incoming message"]
pub last_read_inbox_message_id: i64,
#[doc = "Identifier of the last read outgoing message"]
pub last_read_outbox_message_id: i64,
#[doc = "Number of unread messages with a mention/reply in the chat"]
pub unread_mention_count: i32,
#[doc = "Notification settings for this chat \n\nOriginal type: ChatNotificationSettings"]
pub notification_settings: SerdeJsonValue,
#[doc = "Describes actions which should be possible to do through a chat action bar; may be null \n\nOriginal type: Option<ChatActionBar>"]
pub action_bar: SerdeJsonValue,
#[doc = "Group call identifier of an active voice chat; 0 if none or unknown. The voice chat can be received through the method getGroupCall"]
pub voice_chat_group_call_id: i32,
#[doc = "True, if an active voice chat is empty"]
pub is_voice_chat_empty: bool,
#[doc = "Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat"]
pub reply_markup_message_id: i64,
#[doc = "A draft of a message in the chat; may be null \n\nOriginal type: Option<DraftMessage>"]
pub draft_message: SerdeJsonValue,
#[doc = "Contains application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used"]
pub client_data: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A text message "]
pub struct MessageText {
#[doc = "Text of the message \n\nOriginal type: FormattedText"]
pub text: SerdeJsonValue,
#[doc = "A preview of the web page that's mentioned in the text; may be null \n\nOriginal type: Option<WebPage>"]
pub web_page: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An animation message (GIF-style). "]
pub struct MessageAnimation {
#[doc = "The animation description \n\nOriginal type: Animation"]
pub animation: SerdeJsonValue,
#[doc = "Animation caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
#[doc = "True, if the animation thumbnail must be blurred and the animation must be shown only while tapped"]
pub is_secret: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An audio message "]
pub struct MessageAudio {
#[doc = "The audio description \n\nOriginal type: Audio"]
pub audio: SerdeJsonValue,
#[doc = "Audio caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A document message (general file) "]
pub struct MessageDocument {
#[doc = "The document description \n\nOriginal type: Document"]
pub document: SerdeJsonValue,
#[doc = "Document caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A photo message "]
pub struct MessagePhoto {
#[doc = "The photo description \n\nOriginal type: Photo"]
pub photo: SerdeJsonValue,
#[doc = "Photo caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
#[doc = "True, if the photo must be blurred and must be shown only while tapped"]
pub is_secret: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A sticker message "]
pub struct MessageSticker {
#[doc = "The sticker description \n\nOriginal type: Sticker"]
pub sticker: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A video message "]
pub struct MessageVideo {
#[doc = "The video description \n\nOriginal type: Video"]
pub video: SerdeJsonValue,
#[doc = "Video caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
#[doc = "True, if the video thumbnail must be blurred and the video must be shown only while tapped"]
pub is_secret: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A video note message "]
pub struct MessageVideoNote {
#[doc = "The video note description \n\nOriginal type: VideoNote"]
pub video_note: SerdeJsonValue,
#[doc = "True, if at least one of the recipients has viewed the video note "]
pub is_viewed: bool,
#[doc = "True, if the video note thumbnail must be blurred and the video note must be shown only while tapped"]
pub is_secret: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A voice note message "]
pub struct MessageVoiceNote {
#[doc = "The voice note description \n\nOriginal type: VoiceNote"]
pub voice_note: SerdeJsonValue,
#[doc = "Voice note caption \n\nOriginal type: FormattedText"]
pub caption: SerdeJsonValue,
#[doc = "True, if at least one of the recipients has listened to the voice note"]
pub is_listened: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with a location "]
pub struct MessageLocation {
#[doc = "The location description \n\nOriginal type: Location"]
pub location: SerdeJsonValue,
#[doc = "Time relative to the message send date, for which the location can be updated, in seconds"]
pub live_period: i32,
#[doc = "Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes"]
pub expires_in: i32,
#[doc = "For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown"]
pub heading: i32,
#[doc = "For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender"]
pub proximity_alert_radius: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with information about a venue "]
pub struct MessageVenue {
#[doc = "The venue description \n\nOriginal type: Venue"]
pub venue: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with a user contact "]
pub struct MessageContact {
#[doc = "The contact description \n\nOriginal type: Contact"]
pub contact: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A dice message. The dice value is randomly generated by the server"]
pub struct MessageDice {
#[doc = "The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known \n\nOriginal type: Option<DiceStickers>"]
pub initial_state: SerdeJsonValue,
#[doc = "The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known \n\nOriginal type: Option<DiceStickers>"]
pub final_state: SerdeJsonValue,
#[doc = "Emoji on which the dice throw animation is based"]
pub emoji: String,
#[doc = "The dice value. If the value is 0, the dice don't have final state yet"]
pub value: i32,
#[doc = "Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded"]
pub success_animation_frame_number: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with a game "]
pub struct MessageGame {
#[doc = "The game description"]
pub game: Game,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with a poll "]
pub struct MessagePoll {
#[doc = "The poll description \n\nOriginal type: Poll"]
pub poll: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with an invoice from a bot "]
pub struct MessageInvoice {
#[doc = "Product title "]
pub title: String,
#[doc = "Product description "]
pub description: String,
#[doc = "Product photo; may be null \n\nOriginal type: Option<Photo>"]
pub photo: SerdeJsonValue,
#[doc = "Currency for the product price "]
pub currency: String,
#[doc = "Product total price in the minimal quantity of the currency"]
pub total_amount: i64,
#[doc = "Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} "]
pub start_parameter: String,
#[doc = "True, if the invoice is a test invoice"]
pub is_test: bool,
#[doc = "True, if the shipping address should be specified "]
pub need_shipping_address: bool,
#[doc = "The identifier of the message with the receipt, after the product has been purchased"]
pub receipt_message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with information about an ended call "]
pub struct MessageCall {
#[doc = "True, if the call was a video call "]
pub is_video: bool,
#[doc = "Reason why the call was discarded \n\nOriginal type: CallDiscardReason"]
pub discard_reason: SerdeJsonValue,
#[doc = "Call duration, in seconds"]
pub duration: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A newly created voice chat "]
pub struct MessageVoiceChatStarted {
#[doc = "Identifier of the voice chat. The voice chat can be received through the method getGroupCall"]
pub group_call_id: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with information about an ended voice chat "]
pub struct MessageVoiceChatEnded {
#[doc = "Call duration"]
pub duration: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with information about an invite to a voice chat "]
pub struct MessageInviteVoiceChatParticipants {
#[doc = "Identifier of the voice chat. The voice chat can be received through the method getGroupCall "]
pub group_call_id: i32,
#[doc = "Invited user identifiers"]
pub user_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A newly created basic group "]
pub struct MessageBasicGroupChatCreate {
#[doc = "Title of the basic group "]
pub title: String,
#[doc = "User identifiers of members in the basic group"]
pub member_user_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A newly created supergroup or channel "]
pub struct MessageSupergroupChatCreate {
#[doc = "Title of the supergroup or channel"]
pub title: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An updated chat title "]
pub struct MessageChatChangeTitle {
#[doc = "New chat title"]
pub title: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An updated chat photo "]
pub struct MessageChatChangePhoto {
#[doc = "New chat photo \n\nOriginal type: ChatPhoto"]
pub photo: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "New chat members were added "]
pub struct MessageChatAddMembers {
#[doc = "User identifiers of the new members"]
pub member_user_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat member was deleted "]
pub struct MessageChatDeleteMember {
#[doc = "User identifier of the deleted chat member"]
pub user_id: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A basic group was upgraded to a supergroup and was deactivated as the result "]
pub struct MessageChatUpgradeTo {
#[doc = "Identifier of the supergroup to which the basic group was upgraded"]
pub supergroup_id: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A supergroup has been created from a basic group "]
pub struct MessageChatUpgradeFrom {
#[doc = "Title of the newly created supergroup "]
pub title: String,
#[doc = "The identifier of the original basic group"]
pub basic_group_id: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message has been pinned "]
pub struct MessagePinMessage {
#[doc = "Identifier of the pinned message, can be an identifier of a deleted message or 0"]
pub message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The TTL (Time To Live) setting messages in a secret chat has been changed "]
pub struct MessageChatSetTtl {
#[doc = "New TTL"]
pub ttl: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A non-standard action has happened in the chat "]
pub struct MessageCustomServiceAction {
#[doc = "Message text to be shown in the chat"]
pub text: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new high score was achieved in a game "]
pub struct MessageGameScore {
#[doc = "Identifier of the message with the game, can be an identifier of a deleted message "]
pub game_message_id: i64,
#[doc = "Identifier of the game; may be different from the games presented in the message with the game "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub game_id: i64,
#[doc = "New score"]
pub score: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A payment has been completed "]
pub struct MessagePaymentSuccessful {
#[doc = "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message "]
pub invoice_message_id: i64,
#[doc = "Currency for the price of the product "]
pub currency: String,
#[doc = "Total price for the product, in the minimal quantity of the currency"]
pub total_amount: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A payment has been completed; for bots only "]
pub struct MessagePaymentSuccessfulBot {
#[doc = "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message "]
pub invoice_message_id: i64,
#[doc = "Currency for price of the product"]
pub currency: String,
#[doc = "Total price for the product, in the minimal quantity of the currency "]
pub total_amount: i64,
#[doc = "Invoice payload "]
pub invoice_payload: String,
#[doc = "Identifier of the shipping option chosen by the user; may be empty if not applicable "]
pub shipping_option_id: String,
#[doc = "Information about the order; may be null \n\nOriginal type: Option<OrderInfo>"]
pub order_info: SerdeJsonValue,
#[doc = "Telegram payment identifier "]
pub telegram_payment_charge_id: String,
#[doc = "Provider payment identifier"]
pub provider_payment_charge_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The current user has connected a website by logging in using Telegram Login Widget on it "]
pub struct MessageWebsiteConnected {
#[doc = "Domain name of the connected website"]
pub domain_name: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Telegram Passport data has been sent "]
pub struct MessagePassportDataSent {
#[doc = "List of Telegram Passport element types sent \n\nOriginal type: Vec<PassportElementType>"]
pub types: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Telegram Passport data has been received; for bots only "]
pub struct MessagePassportDataReceived {
#[doc = "List of received Telegram Passport elements \n\nOriginal type: Vec<EncryptedPassportElement>"]
pub elements: SerdeJsonValue,
#[doc = "Encrypted data credentials \n\nOriginal type: EncryptedCredentials"]
pub credentials: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A user in the chat came within proximity alert range "]
pub struct MessageProximityAlertTriggered {
#[doc = "The user or chat, which triggered the proximity alert \n\nOriginal type: MessageSender"]
pub traveler: SerdeJsonValue,
#[doc = "The user or chat, which subscribed for the proximity alert \n\nOriginal type: MessageSender"]
pub watcher: SerdeJsonValue,
#[doc = "The distance between the users"]
pub distance: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Contains settings for the authentication of the user's phone number"]
pub struct PhoneNumberAuthenticationSettings {
#[doc = "Pass true if the authentication code may be sent via flash call to the specified phone number"]
pub allow_flash_call: bool,
#[doc = "Pass true if the authenticated phone number is used on the current device"]
pub is_current_phone_number: bool,
#[doc = "For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details"]
pub allow_sms_retriever_api: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user authorization state has changed "]
pub struct UpdateAuthorizationState {
#[doc = "New authorization state"]
pub authorization_state: AuthorizationState,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new message was received; can also be an outgoing message "]
pub struct UpdateNewMessage {
#[doc = "The new message"]
pub message: Message,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option \"use_quick_ack\" is set to true. This update may be sent multiple times for the same message"]
pub struct UpdateMessageSendAcknowledged {
#[doc = "The chat identifier of the sent message "]
pub chat_id: i64,
#[doc = "A temporary message identifier"]
pub message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message has been successfully sent "]
pub struct UpdateMessageSendSucceeded {
#[doc = "Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change "]
pub message: Message,
#[doc = "The previous temporary message identifier"]
pub old_message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update"]
pub struct UpdateMessageSendFailed {
#[doc = "Contains information about the message which failed to send "]
pub message: Message,
#[doc = "The previous temporary message identifier "]
pub old_message_id: i64,
#[doc = "An error code "]
pub error_code: i32,
#[doc = "Error message"]
pub error_message: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The message content has changed "]
pub struct UpdateMessageContent {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Message identifier "]
pub message_id: i64,
#[doc = "New message content"]
pub new_content: MessageContent,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message was edited. Changes in the message content will come in a separate updateMessageContent "]
pub struct UpdateMessageEdited {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Message identifier "]
pub message_id: i64,
#[doc = "Point in time (Unix timestamp) when the message was edited "]
pub edit_date: i32,
#[doc = "New message reply markup; may be null \n\nOriginal type: Option<ReplyMarkup>"]
pub reply_markup: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The message pinned state was changed "]
pub struct UpdateMessageIsPinned {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The message identifier "]
pub message_id: i64,
#[doc = "True, if the message is pinned"]
pub is_pinned: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The information about interactions with a message has changed "]
pub struct UpdateMessageInteractionInfo {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Message identifier "]
pub message_id: i64,
#[doc = "New information about interactions with the message; may be null \n\nOriginal type: Option<MessageInteractionInfo>"]
pub interaction_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the TTL timer for self-destructing messages "]
pub struct UpdateMessageContentOpened {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Message identifier"]
pub message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with an unread mention was read "]
pub struct UpdateMessageMentionRead {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Message identifier "]
pub message_id: i64,
#[doc = "The new number of unread mention messages left in the chat"]
pub unread_mention_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A message with a live location was viewed. When the update is received, the application is supposed to update the live location"]
pub struct UpdateMessageLiveLocationViewed {
#[doc = "Identifier of the chat with the live location message "]
pub chat_id: i64,
#[doc = "Identifier of the message with live location"]
pub message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates "]
pub struct UpdateNewChat {
#[doc = "The chat"]
pub chat: Chat,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The title of a chat was changed "]
pub struct UpdateChatTitle {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new chat title"]
pub title: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat photo was changed "]
pub struct UpdateChatPhoto {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new chat photo; may be null \n\nOriginal type: Option<ChatPhotoInfo>"]
pub photo: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Chat permissions was changed "]
pub struct UpdateChatPermissions {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new chat permissions \n\nOriginal type: ChatPermissions"]
pub permissions: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case "]
pub struct UpdateChatLastMessage {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new last message in the chat; may be null "]
pub last_message: Option<Message>,
#[doc = "The new chat positions in the chat lists \n\nOriginal type: Vec<ChatPosition>"]
pub positions: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent "]
pub struct UpdateChatPosition {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "New chat position. If new order is 0, then the chat needs to be removed from the list \n\nOriginal type: ChatPosition"]
pub position: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat was marked as unread or was read "]
pub struct UpdateChatIsMarkedAsUnread {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "New value of is_marked_as_unread"]
pub is_marked_as_unread: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat was blocked or unblocked "]
pub struct UpdateChatIsBlocked {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "New value of is_blocked"]
pub is_blocked: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat's has_scheduled_messages field has changed "]
pub struct UpdateChatHasScheduledMessages {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "New value of has_scheduled_messages"]
pub has_scheduled_messages: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat voice chat state has changed "]
pub struct UpdateChatVoiceChat {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "New value of voice_chat_group_call_id "]
pub voice_chat_group_call_id: i32,
#[doc = "New value of is_voice_chat_empty"]
pub is_voice_chat_empty: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed "]
pub struct UpdateChatDefaultDisableNotification {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new default_disable_notification value"]
pub default_disable_notification: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Incoming messages were read or number of unread messages has been changed "]
pub struct UpdateChatReadInbox {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Identifier of the last read incoming message "]
pub last_read_inbox_message_id: i64,
#[doc = "The number of unread messages left in the chat"]
pub unread_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Outgoing messages were read "]
pub struct UpdateChatReadOutbox {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Identifier of last read outgoing message"]
pub last_read_outbox_message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The chat unread_mention_count has changed "]
pub struct UpdateChatUnreadMentionCount {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The number of unread mention messages left in the chat"]
pub unread_mention_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Notification settings for a chat were changed "]
pub struct UpdateChatNotificationSettings {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new notification settings \n\nOriginal type: ChatNotificationSettings"]
pub notification_settings: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Notification settings for some type of chats were updated "]
pub struct UpdateScopeNotificationSettings {
#[doc = "Types of chats for which notification settings were updated \n\nOriginal type: NotificationSettingsScope"]
pub scope: SerdeJsonValue,
#[doc = "The new notification settings \n\nOriginal type: ScopeNotificationSettings"]
pub notification_settings: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The chat action bar was changed "]
pub struct UpdateChatActionBar {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new value of the action bar; may be null \n\nOriginal type: Option<ChatActionBar>"]
pub action_bar: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user"]
pub struct UpdateChatReplyMarkup {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat"]
pub reply_markup_message_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied "]
pub struct UpdateChatDraftMessage {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "The new draft message; may be null \n\nOriginal type: Option<DraftMessage>"]
pub draft_message: SerdeJsonValue,
#[doc = "The new chat positions in the chat lists \n\nOriginal type: Vec<ChatPosition>"]
pub positions: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of chat filters or a chat filter has changed "]
pub struct UpdateChatFilters {
#[doc = "The new list of chat filters \n\nOriginal type: Vec<ChatFilterInfo>"]
pub chat_filters: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed "]
pub struct UpdateChatOnlineMemberCount {
#[doc = "Identifier of the chat "]
pub chat_id: i64,
#[doc = "New number of online members in the chat, or 0 if unknown"]
pub online_member_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A notification was changed "]
pub struct UpdateNotification {
#[doc = "Unique notification group identifier "]
pub notification_group_id: i32,
#[doc = "Changed notification \n\nOriginal type: Notification"]
pub notification: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A list of active notifications in a notification group has changed"]
pub struct UpdateNotificationGroup {
#[doc = "Unique notification group identifier"]
pub notification_group_id: i32,
#[serde(rename = "type")]
#[doc = "New type of the notification group \n\nOriginal type: NotificationGroupType"]
pub type_: SerdeJsonValue,
#[doc = "Identifier of a chat to which all notifications in the group belong"]
pub chat_id: i64,
#[doc = "Chat identifier, which notification settings must be applied to the added notifications"]
pub notification_settings_chat_id: i64,
#[doc = "True, if the notifications should be shown without sound"]
pub is_silent: bool,
#[doc = "Total number of unread notifications in the group, can be bigger than number of active notifications"]
pub total_count: i32,
#[doc = "List of added group notifications, sorted by notification ID \n\nOriginal type: Vec<Notification>"]
pub added_notifications: SerdeJsonValue,
#[doc = "Identifiers of removed group notifications, sorted by notification ID"]
pub removed_notification_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update "]
pub struct UpdateActiveNotifications {
#[doc = "Lists of active notification groups \n\nOriginal type: Vec<NotificationGroup>"]
pub groups: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications"]
pub struct UpdateHavePendingNotifications {
#[doc = "True, if there are some delayed notification updates, which will be sent soon"]
pub have_delayed_notifications: bool,
#[doc = "True, if there can be some yet unreceived notifications, which are being fetched from the server"]
pub have_unreceived_notifications: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some messages were deleted "]
pub struct UpdateDeleteMessages {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "Identifiers of the deleted messages"]
pub message_ids: Vec<i64>,
#[doc = "True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)"]
pub is_permanent: bool,
#[doc = "True, if the messages are deleted only from the cache and can possibly be retrieved again in the future"]
pub from_cache: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "User activity in the chat has changed "]
pub struct UpdateUserChatAction {
#[doc = "Chat identifier "]
pub chat_id: i64,
#[doc = "If not 0, a message thread identifier in which the action was performed "]
pub message_thread_id: i64,
#[doc = "Identifier of a user performing an action "]
pub user_id: i32,
#[doc = "The action description \n\nOriginal type: ChatAction"]
pub action: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user went online or offline "]
pub struct UpdateUserStatus {
#[doc = "User identifier "]
pub user_id: i32,
#[doc = "New status of the user \n\nOriginal type: UserStatus"]
pub status: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application "]
pub struct UpdateUser {
#[doc = "New data about the user"]
pub user: User,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application "]
pub struct UpdateBasicGroup {
#[doc = "New data about the group \n\nOriginal type: BasicGroup"]
pub basic_group: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application "]
pub struct UpdateSupergroup {
#[doc = "New data about the supergroup \n\nOriginal type: Supergroup"]
pub supergroup: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application "]
pub struct UpdateSecretChat {
#[doc = "New data about the secret chat \n\nOriginal type: SecretChat"]
pub secret_chat: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data from userFullInfo has been changed "]
pub struct UpdateUserFullInfo {
#[doc = "User identifier "]
pub user_id: i32,
#[doc = "New full information about the user \n\nOriginal type: UserFullInfo"]
pub user_full_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data from basicGroupFullInfo has been changed "]
pub struct UpdateBasicGroupFullInfo {
#[doc = "Identifier of a basic group "]
pub basic_group_id: i32,
#[doc = "New full information about the group \n\nOriginal type: BasicGroupFullInfo"]
pub basic_group_full_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some data from supergroupFullInfo has been changed "]
pub struct UpdateSupergroupFullInfo {
#[doc = "Identifier of the supergroup or channel "]
pub supergroup_id: i32,
#[doc = "New full information about the supergroup \n\nOriginal type: SupergroupFullInfo"]
pub supergroup_full_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Service notification from the server. Upon receiving this the application must show a popup with the content of the notification"]
pub struct UpdateServiceNotification {
#[serde(rename = "type")]
#[doc = "Notification type. If type begins with \"AUTH_KEY_DROP_\", then two buttons \"Cancel\" and \"Log out\" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method"]
pub type_: String,
#[doc = "Notification content"]
pub content: MessageContent,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Information about a file was updated "]
pub struct UpdateFile {
#[doc = "New data about the file \n\nOriginal type: File"]
pub file: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The file generation process needs to be started by the application"]
pub struct UpdateFileGenerationStart {
#[doc = "Unique identifier for the generation process"]
#[serde(deserialize_with = "deserialize_i64_0")]
pub generation_id: i64,
#[doc = "The path to a file from which a new file is generated; may be empty"]
pub original_path: String,
#[doc = "The path to a file that should be created and where the new file should be generated"]
pub destination_path: String,
#[doc = "String specifying the conversion applied to the original file. If conversion is \"#url#\" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the application"]
pub conversion: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "File generation is no longer needed "]
pub struct UpdateFileGenerationStop {
#[doc = "Unique identifier for the generation process"]
#[serde(deserialize_with = "deserialize_i64_0")]
pub generation_id: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "New call was created or information about a call was updated "]
pub struct UpdateCall {
#[doc = "New data about a call \n\nOriginal type: Call"]
pub call: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Information about a group call was updated "]
pub struct UpdateGroupCall {
#[doc = "New data about a group call \n\nOriginal type: GroupCall"]
pub group_call: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined"]
pub struct UpdateGroupCallParticipant {
#[doc = "Identifier of group call "]
pub group_call_id: i32,
#[doc = "New data about a participant \n\nOriginal type: GroupCallParticipant"]
pub participant: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "New call signaling data arrived "]
pub struct UpdateNewCallSignalingData {
#[doc = "The call identifier "]
pub call_id: i32,
#[doc = "The data"]
pub data: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some privacy setting rules have been changed "]
pub struct UpdateUserPrivacySettingRules {
#[doc = "The privacy setting \n\nOriginal type: UserPrivacySetting"]
pub setting: SerdeJsonValue,
#[doc = "New privacy rules \n\nOriginal type: UserPrivacySettingRules"]
pub rules: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Number of unread messages in a chat list has changed. This update is sent only if the message database is used "]
pub struct UpdateUnreadMessageCount {
#[doc = "The chat list with changed number of unread messages \n\nOriginal type: ChatList"]
pub chat_list: SerdeJsonValue,
#[doc = "Total number of unread messages "]
pub unread_count: i32,
#[doc = "Total number of unread messages in unmuted chats"]
pub unread_unmuted_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used"]
pub struct UpdateUnreadChatCount {
#[doc = "The chat list with changed number of unread messages \n\nOriginal type: ChatList"]
pub chat_list: SerdeJsonValue,
#[doc = "Approximate total number of chats in the chat list"]
pub total_count: i32,
#[doc = "Total number of unread chats "]
pub unread_count: i32,
#[doc = "Total number of unread unmuted chats"]
pub unread_unmuted_count: i32,
#[doc = "Total number of chats marked as unread "]
pub marked_as_unread_count: i32,
#[doc = "Total number of unmuted chats marked as unread"]
pub marked_as_unread_unmuted_count: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "An option changed its value "]
pub struct UpdateOption {
#[doc = "The option name "]
pub name: String,
#[doc = "The new option value \n\nOriginal type: OptionValue"]
pub value: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A sticker set has changed "]
pub struct UpdateStickerSet {
#[doc = "The sticker set \n\nOriginal type: StickerSet"]
pub sticker_set: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of installed sticker sets was updated "]
pub struct UpdateInstalledStickerSets {
#[doc = "True, if the list of installed mask sticker sets was updated "]
pub is_masks: bool,
#[doc = "The new list of installed ordinary sticker sets"]
#[serde(deserialize_with = "deserialize_i64_1")]
pub sticker_set_ids: Vec<i64>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of trending sticker sets was updated or some of them were viewed "]
pub struct UpdateTrendingStickerSets {
#[doc = "The prefix of the list of trending sticker sets with the newest trending sticker sets \n\nOriginal type: StickerSets"]
pub sticker_sets: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of recently used stickers was updated "]
pub struct UpdateRecentStickers {
#[doc = "True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated "]
pub is_attached: bool,
#[doc = "The new list of file identifiers of recently used stickers"]
pub sticker_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of favorite stickers was updated "]
pub struct UpdateFavoriteStickers {
#[doc = "The new list of file identifiers of favorite stickers"]
pub sticker_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of saved animations was updated "]
pub struct UpdateSavedAnimations {
#[doc = "The new list of file identifiers of saved animations"]
pub animation_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The selected background has changed "]
pub struct UpdateSelectedBackground {
#[doc = "True, if background for dark theme has changed "]
pub for_dark_theme: bool,
#[doc = "The new selected background; may be null \n\nOriginal type: Option<Background>"]
pub background: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Some language pack strings have been updated "]
pub struct UpdateLanguagePackStrings {
#[doc = "Localization target to which the language pack belongs "]
pub localization_target: String,
#[doc = "Identifier of the updated language pack "]
pub language_pack_id: String,
#[doc = "List of changed language pack strings \n\nOriginal type: Vec<LanguagePackString>"]
pub strings: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The connection state has changed. This update must be used only to show a human-readable description of the connection state "]
pub struct UpdateConnectionState {
#[doc = "The new connection state \n\nOriginal type: ConnectionState"]
pub state: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason \"Decline ToS update\" "]
pub struct UpdateTermsOfService {
#[doc = "Identifier of the terms of service "]
pub terms_of_service_id: String,
#[doc = "The new terms of service \n\nOriginal type: TermsOfService"]
pub terms_of_service: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request "]
pub struct UpdateUsersNearby {
#[doc = "The new list of users nearby \n\nOriginal type: Vec<ChatNearby>"]
pub users_nearby: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of supported dice emojis has changed "]
pub struct UpdateDiceEmojis {
#[doc = "The new list of supported dice emojis"]
pub emojis: Vec<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed "]
pub struct UpdateAnimationSearchParameters {
#[doc = "Name of the animation search provider "]
pub provider: String,
#[doc = "The new list of emojis suggested for searching"]
pub emojis: Vec<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The list of suggested to the user actions has changed "]
pub struct UpdateSuggestedActions {
#[doc = "Added suggested actions \n\nOriginal type: Vec<SuggestedAction>"]
pub added_actions: SerdeJsonValue,
#[doc = "Removed suggested actions \n\nOriginal type: Vec<SuggestedAction>"]
pub removed_actions: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming inline query; for bots only "]
pub struct UpdateNewInlineQuery {
#[doc = "Unique query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Identifier of the user who sent the query "]
pub sender_user_id: i32,
#[doc = "User location; may be null \n\nOriginal type: Option<Location>"]
pub user_location: SerdeJsonValue,
#[doc = "Contains information about the type of the chat, from which the query originated; may be null if unknown \n\nOriginal type: Option<ChatType>"]
pub chat_type: SerdeJsonValue,
#[doc = "Text of the query "]
pub query: String,
#[doc = "Offset of the first entry to return"]
pub offset: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "The user has chosen a result of an inline query; for bots only "]
pub struct UpdateNewChosenInlineResult {
#[doc = "Identifier of the user who sent the query "]
pub sender_user_id: i32,
#[doc = "User location; may be null \n\nOriginal type: Option<Location>"]
pub user_location: SerdeJsonValue,
#[doc = "Text of the query "]
pub query: String,
#[doc = "Identifier of the chosen result "]
pub result_id: String,
#[doc = "Identifier of the sent inline message, if known"]
pub inline_message_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming callback query; for bots only "]
pub struct UpdateNewCallbackQuery {
#[doc = "Unique query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Identifier of the user who sent the query"]
pub sender_user_id: i32,
#[doc = "Identifier of the chat where the query was sent "]
pub chat_id: i64,
#[doc = "Identifier of the message, from which the query originated"]
pub message_id: i64,
#[doc = "Identifier that uniquely corresponds to the chat to which the message was sent "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub chat_instance: i64,
#[doc = "Query payload \n\nOriginal type: CallbackQueryPayload"]
pub payload: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming callback query from a message sent via a bot; for bots only "]
pub struct UpdateNewInlineCallbackQuery {
#[doc = "Unique query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Identifier of the user who sent the query "]
pub sender_user_id: i32,
#[doc = "Identifier of the inline message, from which the query originated"]
pub inline_message_id: String,
#[doc = "An identifier uniquely corresponding to the chat a message was sent to "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub chat_instance: i64,
#[doc = "Query payload \n\nOriginal type: CallbackQueryPayload"]
pub payload: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming shipping query; for bots only. Only for invoices with flexible price "]
pub struct UpdateNewShippingQuery {
#[doc = "Unique query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Identifier of the user who sent the query "]
pub sender_user_id: i32,
#[doc = "Invoice payload "]
pub invoice_payload: String,
#[doc = "User shipping address \n\nOriginal type: Address"]
pub shipping_address: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming pre-checkout query; for bots only. Contains full information about a checkout "]
pub struct UpdateNewPreCheckoutQuery {
#[doc = "Unique query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "Identifier of the user who sent the query "]
pub sender_user_id: i32,
#[doc = "Currency for the product price "]
pub currency: String,
#[doc = "Total price for the product, in the minimal quantity of the currency"]
pub total_amount: i64,
#[doc = "Invoice payload "]
pub invoice_payload: String,
#[doc = "Identifier of a shipping option chosen by the user; may be empty if not applicable "]
pub shipping_option_id: String,
#[doc = "Information about the order; may be null \n\nOriginal type: Option<OrderInfo>"]
pub order_info: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming event; for bots only "]
pub struct UpdateNewCustomEvent {
#[doc = "A JSON-serialized event"]
pub event: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A new incoming query; for bots only "]
pub struct UpdateNewCustomQuery {
#[doc = "The query identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub id: i64,
#[doc = "JSON-serialized query data "]
pub data: String,
#[doc = "Query timeout"]
pub timeout: i32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A poll was updated; for bots only "]
pub struct UpdatePoll {
#[doc = "New data about the poll \n\nOriginal type: Poll"]
pub poll: SerdeJsonValue,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "A user changed the answer to a poll; for bots only "]
pub struct UpdatePollAnswer {
#[doc = "Unique poll identifier "]
#[serde(deserialize_with = "deserialize_i64_0")]
pub poll_id: i64,
#[doc = "The user, who changed the answer to the poll "]
pub user_id: i32,
#[doc = "0-based identifiers of answer options, chosen by the user"]
pub option_ids: Vec<i32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Represents the current authorization state of the TDLib client"]
#[serde(tag = "@type")]
pub enum AuthorizationState {
#[doc = "TDLib needs TdlibParameters for initialization"]
AuthorizationStateWaitTdlibParameters,
AuthorizationStateWaitEncryptionKey(AuthorizationStateWaitEncryptionKey),
#[doc = "TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options"]
AuthorizationStateWaitPhoneNumber,
AuthorizationStateWaitCode(AuthorizationStateWaitCode),
AuthorizationStateWaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation),
AuthorizationStateWaitRegistration(AuthorizationStateWaitRegistration),
AuthorizationStateWaitPassword(AuthorizationStateWaitPassword),
#[doc = "The user has been successfully authorized. TDLib is now ready to answer queries"]
AuthorizationStateReady,
#[doc = "The user is currently logging out"]
AuthorizationStateLoggingOut,
#[doc = "TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received"]
AuthorizationStateClosing,
#[doc = "TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to \nwith error code 500. To continue working, one should create a new instance of the TDLib client"]
AuthorizationStateClosed,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Contains the content of a message"]
#[serde(tag = "@type")]
pub enum MessageContent {
MessageText(MessageText),
MessageAnimation(MessageAnimation),
MessageAudio(MessageAudio),
MessageDocument(MessageDocument),
MessagePhoto(MessagePhoto),
#[doc = "An expired photo message (self-destructed after TTL has elapsed)"]
MessageExpiredPhoto,
MessageSticker(MessageSticker),
MessageVideo(MessageVideo),
#[doc = "An expired video message (self-destructed after TTL has elapsed)"]
MessageExpiredVideo,
MessageVideoNote(MessageVideoNote),
MessageVoiceNote(MessageVoiceNote),
MessageLocation(MessageLocation),
MessageVenue(MessageVenue),
MessageContact(MessageContact),
MessageDice(MessageDice),
MessageGame(MessageGame),
MessagePoll(MessagePoll),
MessageInvoice(MessageInvoice),
MessageCall(MessageCall),
MessageVoiceChatStarted(MessageVoiceChatStarted),
MessageVoiceChatEnded(MessageVoiceChatEnded),
MessageInviteVoiceChatParticipants(MessageInviteVoiceChatParticipants),
MessageBasicGroupChatCreate(MessageBasicGroupChatCreate),
MessageSupergroupChatCreate(MessageSupergroupChatCreate),
MessageChatChangeTitle(MessageChatChangeTitle),
MessageChatChangePhoto(MessageChatChangePhoto),
#[doc = "A deleted chat photo"]
MessageChatDeletePhoto,
MessageChatAddMembers(MessageChatAddMembers),
#[doc = "A new member joined the chat by invite link"]
MessageChatJoinByLink,
MessageChatDeleteMember(MessageChatDeleteMember),
MessageChatUpgradeTo(MessageChatUpgradeTo),
MessageChatUpgradeFrom(MessageChatUpgradeFrom),
MessagePinMessage(MessagePinMessage),
#[doc = "A screenshot of a message in the chat has been taken"]
MessageScreenshotTaken,
MessageChatSetTtl(MessageChatSetTtl),
MessageCustomServiceAction(MessageCustomServiceAction),
MessageGameScore(MessageGameScore),
MessagePaymentSuccessful(MessagePaymentSuccessful),
MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot),
#[doc = "A contact has registered with Telegram"]
MessageContactRegistered,
MessageWebsiteConnected(MessageWebsiteConnected),
MessagePassportDataSent(MessagePassportDataSent),
MessagePassportDataReceived(MessagePassportDataReceived),
MessageProximityAlertTriggered(MessageProximityAlertTriggered),
#[doc = "Message content that is not supported in the current TDLib version"]
MessageUnsupported,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[doc = "Contains notifications about data changes"]
#[serde(tag = "@type")]
pub enum Update {
UpdateAuthorizationState(UpdateAuthorizationState),
UpdateNewMessage(UpdateNewMessage),
UpdateMessageSendAcknowledged(UpdateMessageSendAcknowledged),
UpdateMessageSendSucceeded(UpdateMessageSendSucceeded),
UpdateMessageSendFailed(UpdateMessageSendFailed),
UpdateMessageContent(UpdateMessageContent),
UpdateMessageEdited(UpdateMessageEdited),
UpdateMessageIsPinned(UpdateMessageIsPinned),
UpdateMessageInteractionInfo(UpdateMessageInteractionInfo),
UpdateMessageContentOpened(UpdateMessageContentOpened),
UpdateMessageMentionRead(UpdateMessageMentionRead),
UpdateMessageLiveLocationViewed(UpdateMessageLiveLocationViewed),
UpdateNewChat(UpdateNewChat),
UpdateChatTitle(UpdateChatTitle),
UpdateChatPhoto(UpdateChatPhoto),
UpdateChatPermissions(UpdateChatPermissions),
UpdateChatLastMessage(UpdateChatLastMessage),
UpdateChatPosition(UpdateChatPosition),
UpdateChatIsMarkedAsUnread(UpdateChatIsMarkedAsUnread),
UpdateChatIsBlocked(UpdateChatIsBlocked),
UpdateChatHasScheduledMessages(UpdateChatHasScheduledMessages),
UpdateChatVoiceChat(UpdateChatVoiceChat),
UpdateChatDefaultDisableNotification(UpdateChatDefaultDisableNotification),
UpdateChatReadInbox(UpdateChatReadInbox),
UpdateChatReadOutbox(UpdateChatReadOutbox),
UpdateChatUnreadMentionCount(UpdateChatUnreadMentionCount),
UpdateChatNotificationSettings(UpdateChatNotificationSettings),
UpdateScopeNotificationSettings(UpdateScopeNotificationSettings),
UpdateChatActionBar(UpdateChatActionBar),
UpdateChatReplyMarkup(UpdateChatReplyMarkup),
UpdateChatDraftMessage(UpdateChatDraftMessage),
UpdateChatFilters(UpdateChatFilters),
UpdateChatOnlineMemberCount(UpdateChatOnlineMemberCount),
UpdateNotification(UpdateNotification),
UpdateNotificationGroup(UpdateNotificationGroup),
UpdateActiveNotifications(UpdateActiveNotifications),
UpdateHavePendingNotifications(UpdateHavePendingNotifications),
UpdateDeleteMessages(UpdateDeleteMessages),
UpdateUserChatAction(UpdateUserChatAction),
UpdateUserStatus(UpdateUserStatus),
UpdateUser(UpdateUser),
UpdateBasicGroup(UpdateBasicGroup),
UpdateSupergroup(UpdateSupergroup),
UpdateSecretChat(UpdateSecretChat),
UpdateUserFullInfo(UpdateUserFullInfo),
UpdateBasicGroupFullInfo(UpdateBasicGroupFullInfo),
UpdateSupergroupFullInfo(UpdateSupergroupFullInfo),
UpdateServiceNotification(UpdateServiceNotification),
UpdateFile(UpdateFile),
UpdateFileGenerationStart(UpdateFileGenerationStart),
UpdateFileGenerationStop(UpdateFileGenerationStop),
UpdateCall(UpdateCall),
UpdateGroupCall(UpdateGroupCall),
UpdateGroupCallParticipant(UpdateGroupCallParticipant),
UpdateNewCallSignalingData(UpdateNewCallSignalingData),
UpdateUserPrivacySettingRules(UpdateUserPrivacySettingRules),
UpdateUnreadMessageCount(UpdateUnreadMessageCount),
UpdateUnreadChatCount(UpdateUnreadChatCount),
UpdateOption(UpdateOption),
UpdateStickerSet(UpdateStickerSet),
UpdateInstalledStickerSets(UpdateInstalledStickerSets),
UpdateTrendingStickerSets(UpdateTrendingStickerSets),
UpdateRecentStickers(UpdateRecentStickers),
UpdateFavoriteStickers(UpdateFavoriteStickers),
UpdateSavedAnimations(UpdateSavedAnimations),
UpdateSelectedBackground(UpdateSelectedBackground),
UpdateLanguagePackStrings(UpdateLanguagePackStrings),
UpdateConnectionState(UpdateConnectionState),
UpdateTermsOfService(UpdateTermsOfService),
UpdateUsersNearby(UpdateUsersNearby),
UpdateDiceEmojis(UpdateDiceEmojis),
UpdateAnimationSearchParameters(UpdateAnimationSearchParameters),
UpdateSuggestedActions(UpdateSuggestedActions),
UpdateNewInlineQuery(UpdateNewInlineQuery),
UpdateNewChosenInlineResult(UpdateNewChosenInlineResult),
UpdateNewCallbackQuery(UpdateNewCallbackQuery),
UpdateNewInlineCallbackQuery(UpdateNewInlineCallbackQuery),
UpdateNewShippingQuery(UpdateNewShippingQuery),
UpdateNewPreCheckoutQuery(UpdateNewPreCheckoutQuery),
UpdateNewCustomEvent(UpdateNewCustomEvent),
UpdateNewCustomQuery(UpdateNewCustomQuery),
UpdatePoll(UpdatePoll),
UpdatePollAnswer(UpdatePollAnswer),
}
pub trait ClientExt: ClientLike {
#[doc = "Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `parameters`: Parameters"]
fn set_tdlib_parameters(&self, parameters: TdlibParameters) -> ResponseFuture<Ok> {
self.send(json!({
"parameters": parameters,
"@type": "setTdlibParameters"
}))
}
#[doc = "Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, \nor if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword"]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `phone_number`: The phone number of the user, in international format "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `settings`: Settings for the authentication of the user's phone number"]
fn set_authentication_phone_number(
&self,
phone_number: String,
settings: PhoneNumberAuthenticationSettings,
) -> ResponseFuture<Ok> {
self.send(json!({
"phone_number": phone_number,
"settings": settings,
"@type": "setAuthenticationPhoneNumber"
}))
}
#[doc = "Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `code`: The verification code received via SMS, Telegram message, phone call, or flash call"]
fn check_authentication_code(&self, code: String) -> ResponseFuture<Ok> {
self.send(json!({
"code": code,
"@type": "checkAuthenticationCode"
}))
}
#[doc = "Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `password`: The password to check"]
fn check_authentication_password(&self, password: String) -> ResponseFuture<Ok> {
self.send(json!({
"password": password,
"@type": "checkAuthenticationPassword"
}))
}
#[doc = "Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `new_encryption_key`: New encryption key"]
fn set_database_encryption_key(&self, new_encryption_key: String) -> ResponseFuture<Ok> {
self.send(json!({
"new_encryption_key": new_encryption_key,
"@type": "setDatabaseEncryptionKey"
}))
}
#[doc = "Returns network data usage statistics. Can be called before authorization "]
#[doc = " \n\n"]
#[doc = "parameters: "]
#[doc = " * `only_current`: If true, returns only data for the current library launch"]
#[doc = " \n\n"]
#[doc = "Original return type: `NetworkStatistics`"]
fn get_network_statistics(&self, only_current: bool) -> ResponseFuture<SerdeJsonValue> {
self.send(json!({
"only_current": only_current,
"@type": "getNetworkStatistics"
}))
}
#[doc = "Returns application config, provided by the server. Can be called before authorization"]
#[doc = " \n\n"]
#[doc = "Original return type: `JsonValue`"]
fn get_application_config(&self) -> ResponseFuture<SerdeJsonValue> {
self.send(json!({
"@type": "getApplicationConfig"
}))
}
}
|