aiogram 0.1.0

An ergonomic asynchronous Telegram Bot API framework for Rust, ported from aiogram
Documentation
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
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
// @generated by `cargo run -p xtask -- generate`. DO NOT EDIT.
//! Generated convenience methods on `Bot` for the pinned compatibility baseline.
#![allow(
    clippy::too_many_arguments,
    unused_mut,
    rustdoc::bare_urls,
    rustdoc::invalid_html_tags
)]

use super::Bot;
use crate::error::Result;

/// Generated Bot API convenience methods, excluding custom core shortcuts.
pub const GENERATED_BOT_SHORTCUT_COUNT: usize = 180;

impl Bot {
    #[doc = "Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success."]
    pub async fn add_sticker_to_set(
        &self,
        user_id: i64,
        name: impl Into<String>,
        sticker: crate::types::InputSticker,
    ) -> Result<bool> {
        self.execute(&crate::methods::AddStickerToSet::new(
            user_id, name, sticker,
        ))
        .await
    }

    #[doc = "Use this method to process a received chat join request query. Returns True on success."]
    pub async fn answer_chat_join_request_query(
        &self,
        chat_join_request_query_id: impl Into<String>,
        result: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::AnswerChatJoinRequestQuery::new(
            chat_join_request_query_id,
            result,
        ))
        .await
    }

    #[doc = "Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned."]
    pub async fn answer_guest_query(
        &self,
        guest_query_id: impl Into<String>,
        result: impl Into<crate::types::InlineQueryResultUnion>,
    ) -> Result<crate::types::SentGuestMessage> {
        self.execute(&crate::methods::AnswerGuestQuery::new(
            guest_query_id,
            result,
        ))
        .await
    }

    #[doc = "Use this method to send answers to an inline query. On success, True is returned."]
    pub async fn answer_inline_query(
        &self,
        inline_query_id: impl Into<String>,
        results: Vec<crate::types::InlineQueryResultUnion>,
    ) -> Result<bool> {
        self.execute(&crate::methods::AnswerInlineQuery::new(
            inline_query_id,
            results,
        ))
        .await
    }

    #[doc = "Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent."]
    pub async fn answer_pre_checkout_query(
        &self,
        pre_checkout_query_id: impl Into<String>,
        ok: bool,
    ) -> Result<bool> {
        self.execute(&crate::methods::AnswerPreCheckoutQuery::new(
            pre_checkout_query_id,
            ok,
        ))
        .await
    }

    #[doc = "If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned."]
    pub async fn answer_shipping_query(
        &self,
        shipping_query_id: impl Into<String>,
        ok: bool,
    ) -> Result<bool> {
        self.execute(&crate::methods::AnswerShippingQuery::new(
            shipping_query_id,
            ok,
        ))
        .await
    }

    #[doc = "Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned."]
    pub async fn answer_web_app_query(
        &self,
        web_app_query_id: impl Into<String>,
        result: impl Into<crate::types::InlineQueryResultUnion>,
    ) -> Result<crate::types::SentWebAppMessage> {
        self.execute(&crate::methods::AnswerWebAppQuery::new(
            web_app_query_id,
            result,
        ))
        .await
    }

    #[doc = "Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success."]
    pub async fn approve_chat_join_request(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::ApproveChatJoinRequest::new(
            chat_id, user_id,
        ))
        .await
    }

    #[doc = "Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success."]
    pub async fn approve_suggested_post(&self, chat_id: i64, message_id: i64) -> Result<bool> {
        self.execute(&crate::methods::ApproveSuggestedPost::new(
            chat_id, message_id,
        ))
        .await
    }

    #[doc = "Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn ban_chat_member(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::BanChatMember::new(chat_id, user_id))
            .await
    }

    #[doc = "Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn ban_chat_sender_chat(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        sender_chat_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::BanChatSenderChat::new(
            chat_id,
            sender_chat_id,
        ))
        .await
    }

    #[doc = "Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters."]
    pub async fn close(&self) -> Result<bool> {
        self.execute(&crate::methods::Close::new()).await
    }

    #[doc = "Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success."]
    pub async fn close_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_thread_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::CloseForumTopic::new(
            chat_id,
            message_thread_id,
        ))
        .await
    }

    #[doc = "Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success."]
    pub async fn close_general_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::CloseGeneralForumTopic::new(chat_id))
            .await
    }

    #[doc = "Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success."]
    pub async fn convert_gift_to_stars(
        &self,
        business_connection_id: impl Into<String>,
        owned_gift_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::ConvertGiftToStars::new(
            business_connection_id,
            owned_gift_id,
        ))
        .await
    }

    #[doc = "Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success."]
    pub async fn copy_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        from_chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<crate::types::MessageId> {
        self.execute(&crate::methods::CopyMessage::new(
            chat_id,
            from_chat_id,
            message_id,
        ))
        .await
    }

    #[doc = "Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned."]
    pub async fn copy_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        from_chat_id: impl Into<crate::types::ChatId>,
        message_ids: Vec<i64>,
    ) -> Result<Vec<crate::types::MessageId>> {
        self.execute(&crate::methods::CopyMessages::new(
            chat_id,
            from_chat_id,
            message_ids,
        ))
        .await
    }

    #[doc = "Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object."]
    pub async fn create_chat_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<crate::types::ChatInviteLink> {
        self.execute(&crate::methods::CreateChatInviteLink::new(chat_id))
            .await
    }

    #[doc = "Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object."]
    pub async fn create_chat_subscription_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        subscription_period: i64,
        subscription_price: i64,
    ) -> Result<crate::types::ChatInviteLink> {
        self.execute(&crate::methods::CreateChatSubscriptionInviteLink::new(
            chat_id,
            subscription_period,
            subscription_price,
        ))
        .await
    }

    #[doc = "Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object."]
    pub async fn create_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        name: impl Into<String>,
    ) -> Result<crate::types::ForumTopic> {
        self.execute(&crate::methods::CreateForumTopic::new(chat_id, name))
            .await
    }

    #[doc = "Use this method to create a link for an invoice. Returns the created invoice link as String on success."]
    pub async fn create_invoice_link(
        &self,
        title: impl Into<String>,
        description: impl Into<String>,
        payload: impl Into<String>,
        currency: impl Into<String>,
        prices: Vec<crate::types::LabeledPrice>,
    ) -> Result<String> {
        self.execute(&crate::methods::CreateInvoiceLink::new(
            title,
            description,
            payload,
            currency,
            prices,
        ))
        .await
    }

    #[doc = "Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success."]
    pub async fn create_new_sticker_set(
        &self,
        user_id: i64,
        name: impl Into<String>,
        title: impl Into<String>,
        stickers: Vec<crate::types::InputSticker>,
    ) -> Result<bool> {
        self.execute(&crate::methods::CreateNewStickerSet::new(
            user_id, name, title, stickers,
        ))
        .await
    }

    #[doc = "Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success."]
    pub async fn decline_chat_join_request(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeclineChatJoinRequest::new(
            chat_id, user_id,
        ))
        .await
    }

    #[doc = "Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success."]
    pub async fn decline_suggested_post(&self, chat_id: i64, message_id: i64) -> Result<bool> {
        self.execute(&crate::methods::DeclineSuggestedPost::new(
            chat_id, message_id,
        ))
        .await
    }

    #[doc = "Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success."]
    pub async fn delete_all_message_reactions(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteAllMessageReactions::new(chat_id))
            .await
    }

    #[doc = "Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success."]
    pub async fn delete_business_messages(
        &self,
        business_connection_id: impl Into<String>,
        message_ids: Vec<i64>,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteBusinessMessages::new(
            business_connection_id,
            message_ids,
        ))
        .await
    }

    #[doc = "Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn delete_chat_photo(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteChatPhoto::new(chat_id))
            .await
    }

    #[doc = "Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success."]
    pub async fn delete_chat_sticker_set(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteChatStickerSet::new(chat_id))
            .await
    }

    #[doc = "Use this method to delete an ephemeral message. Note that it is not guaranteed that the user will receive the message deletion event, especially if they are offline. Returns True on success."]
    pub async fn delete_ephemeral_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        receiver_user_id: i64,
        ephemeral_message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteEphemeralMessage::new(
            chat_id,
            receiver_user_id,
            ephemeral_message_id,
        ))
        .await
    }

    #[doc = "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success."]
    pub async fn delete_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_thread_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteForumTopic::new(
            chat_id,
            message_thread_id,
        ))
        .await
    }

    #[doc = "Use this method to delete a message, including service messages, with the following limitations:"]
    pub async fn delete_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteMessage::new(chat_id, message_id))
            .await
    }

    #[doc = "Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success."]
    pub async fn delete_message_reaction(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteMessageReaction::new(
            chat_id, message_id,
        ))
        .await
    }

    #[doc = "Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success."]
    pub async fn delete_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_ids: Vec<i64>,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteMessages::new(chat_id, message_ids))
            .await
    }

    #[doc = "Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success."]
    pub async fn delete_my_commands(
        &self,
        method: crate::methods::DeleteMyCommands,
    ) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to delete a sticker from a set created by the bot. Returns True on success."]
    pub async fn delete_sticker_from_set(&self, sticker: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::DeleteStickerFromSet::new(sticker))
            .await
    }

    #[doc = "Use this method to delete a sticker set that was created by the bot. Returns True on success."]
    pub async fn delete_sticker_set(&self, name: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::DeleteStickerSet::new(name))
            .await
    }

    #[doc = "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success."]
    pub async fn delete_story(
        &self,
        business_connection_id: impl Into<String>,
        story_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::DeleteStory::new(
            business_connection_id,
            story_id,
        ))
        .await
    }

    #[doc = "Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success."]
    pub async fn delete_webhook(&self, method: crate::methods::DeleteWebhook) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object."]
    pub async fn edit_chat_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        invite_link: impl Into<String>,
    ) -> Result<crate::types::ChatInviteLink> {
        self.execute(&crate::methods::EditChatInviteLink::new(
            chat_id,
            invite_link,
        ))
        .await
    }

    #[doc = "Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object."]
    pub async fn edit_chat_subscription_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        invite_link: impl Into<String>,
    ) -> Result<crate::types::ChatInviteLink> {
        self.execute(&crate::methods::EditChatSubscriptionInviteLink::new(
            chat_id,
            invite_link,
        ))
        .await
    }

    #[doc = "Use this method to edit the caption of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned."]
    pub async fn edit_ephemeral_message_caption(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        receiver_user_id: i64,
        ephemeral_message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditEphemeralMessageCaption::new(
            chat_id,
            receiver_user_id,
            ephemeral_message_id,
        ))
        .await
    }

    #[doc = "Use this method to edit the media of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned."]
    pub async fn edit_ephemeral_message_media(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        receiver_user_id: i64,
        ephemeral_message_id: i64,
        media: impl Into<crate::types::InputMediaUnion>,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditEphemeralMessageMedia::new(
            chat_id,
            receiver_user_id,
            ephemeral_message_id,
            media,
        ))
        .await
    }

    #[doc = "Use this method to edit only the reply markup of an ephemeral message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned."]
    pub async fn edit_ephemeral_message_reply_markup(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        receiver_user_id: i64,
        ephemeral_message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditEphemeralMessageReplyMarkup::new(
            chat_id,
            receiver_user_id,
            ephemeral_message_id,
        ))
        .await
    }

    #[doc = "Use this method to edit an ephemeral text message. Note that it is not guaranteed that the user will receive the message edit event, especially if they are offline. On success, True is returned."]
    pub async fn edit_ephemeral_message_text(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        receiver_user_id: i64,
        ephemeral_message_id: i64,
        text: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditEphemeralMessageText::new(
            chat_id,
            receiver_user_id,
            ephemeral_message_id,
            text,
        ))
        .await
    }

    #[doc = "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success."]
    pub async fn edit_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_thread_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditForumTopic::new(
            chat_id,
            message_thread_id,
        ))
        .await
    }

    #[doc = "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success."]
    pub async fn edit_general_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        name: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditGeneralForumTopic::new(chat_id, name))
            .await
    }

    #[doc = "Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent."]
    pub async fn edit_message_caption(
        &self,
        method: crate::methods::EditMessageCaption,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned."]
    pub async fn edit_message_checklist(
        &self,
        business_connection_id: impl Into<String>,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
        checklist: crate::types::InputChecklist,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::EditMessageChecklist::new(
            business_connection_id,
            chat_id,
            message_id,
            checklist,
        ))
        .await
    }

    #[doc = "Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned."]
    pub async fn edit_message_live_location(
        &self,
        latitude: f64,
        longitude: f64,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&crate::methods::EditMessageLiveLocation::new(
            latitude, longitude,
        ))
        .await
    }

    #[doc = "Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent."]
    pub async fn edit_message_media(
        &self,
        media: impl Into<crate::types::InputMediaUnion>,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&crate::methods::EditMessageMedia::new(media))
            .await
    }

    #[doc = "Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent."]
    pub async fn edit_message_reply_markup(
        &self,
        method: crate::methods::EditMessageReplyMarkup,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to edit text, rich and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent."]
    pub async fn edit_message_text(
        &self,
        method: crate::methods::EditMessageText,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&method).await
    }

    #[doc = "Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success."]
    pub async fn edit_story(
        &self,
        business_connection_id: impl Into<String>,
        story_id: i64,
        content: impl Into<crate::types::InputStoryContentUnion>,
    ) -> Result<crate::types::Story> {
        self.execute(&crate::methods::EditStory::new(
            business_connection_id,
            story_id,
            content,
        ))
        .await
    }

    #[doc = "Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success."]
    pub async fn edit_user_star_subscription(
        &self,
        user_id: i64,
        telegram_payment_charge_id: impl Into<String>,
        is_canceled: bool,
    ) -> Result<bool> {
        self.execute(&crate::methods::EditUserStarSubscription::new(
            user_id,
            telegram_payment_charge_id,
            is_canceled,
        ))
        .await
    }

    #[doc = "Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success."]
    pub async fn export_chat_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<String> {
        self.execute(&crate::methods::ExportChatInviteLink::new(chat_id))
            .await
    }

    #[doc = "Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned."]
    pub async fn forward_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        from_chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::ForwardMessage::new(
            chat_id,
            from_chat_id,
            message_id,
        ))
        .await
    }

    #[doc = "Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an Array of MessageId of the sent messages is returned."]
    pub async fn forward_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        from_chat_id: impl Into<crate::types::ChatId>,
        message_ids: Vec<i64>,
    ) -> Result<Vec<crate::types::MessageId>> {
        self.execute(&crate::methods::ForwardMessages::new(
            chat_id,
            from_chat_id,
            message_ids,
        ))
        .await
    }

    #[doc = "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object."]
    pub async fn get_available_gifts(&self) -> Result<crate::types::Gifts> {
        self.execute(&crate::methods::GetAvailableGifts::new())
            .await
    }

    #[doc = "Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success."]
    pub async fn get_business_account_gifts(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<crate::types::OwnedGifts> {
        self.execute(&crate::methods::GetBusinessAccountGifts::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success."]
    pub async fn get_business_account_star_balance(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<crate::types::StarAmount> {
        self.execute(&crate::methods::GetBusinessAccountStarBalance::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success."]
    pub async fn get_business_connection(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<crate::types::BusinessConnection> {
        self.execute(&crate::methods::GetBusinessConnection::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success."]
    pub async fn get_chat(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<crate::types::ChatFullInfo> {
        self.execute(&crate::methods::GetChat::new(chat_id)).await
    }

    #[doc = "Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects."]
    pub async fn get_chat_administrators(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<Vec<crate::types::ResultChatMemberUnion>> {
        self.execute(&crate::methods::GetChatAdministrators::new(chat_id))
            .await
    }

    #[doc = "Returns the gifts owned by a chat. Returns OwnedGifts on success."]
    pub async fn get_chat_gifts(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<crate::types::OwnedGifts> {
        self.execute(&crate::methods::GetChatGifts::new(chat_id))
            .await
    }

    #[doc = "Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success."]
    pub async fn get_chat_member(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<crate::types::ResultChatMemberUnion> {
        self.execute(&crate::methods::GetChatMember::new(chat_id, user_id))
            .await
    }

    #[doc = "Use this method to get the number of members in a chat. Returns Integer on success."]
    pub async fn get_chat_member_count(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<i64> {
        self.execute(&crate::methods::GetChatMemberCount::new(chat_id))
            .await
    }

    #[doc = "Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success."]
    pub async fn get_chat_menu_button(
        &self,
        method: crate::methods::GetChatMenuButton,
    ) -> Result<crate::types::ResultMenuButtonUnion> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects."]
    pub async fn get_custom_emoji_stickers(
        &self,
        custom_emoji_ids: Vec<String>,
    ) -> Result<Vec<crate::types::Sticker>> {
        self.execute(&crate::methods::GetCustomEmojiStickers::new(
            custom_emoji_ids,
        ))
        .await
    }

    #[doc = "Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects."]
    pub async fn get_forum_topic_icon_stickers(&self) -> Result<Vec<crate::types::Sticker>> {
        self.execute(&crate::methods::GetForumTopicIconStickers::new())
            .await
    }

    #[doc = "Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects."]
    pub async fn get_game_high_scores(
        &self,
        user_id: i64,
    ) -> Result<Vec<crate::types::GameHighScore>> {
        self.execute(&crate::methods::GetGameHighScores::new(user_id))
            .await
    }

    #[doc = "Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success."]
    pub async fn get_managed_bot_access_settings(
        &self,
        user_id: i64,
    ) -> Result<crate::types::BotAccessSettings> {
        self.execute(&crate::methods::GetManagedBotAccessSettings::new(user_id))
            .await
    }

    #[doc = "Use this method to get the token of a managed bot. Returns the token as String on success."]
    pub async fn get_managed_bot_token(&self, user_id: i64) -> Result<String> {
        self.execute(&crate::methods::GetManagedBotToken::new(user_id))
            .await
    }

    #[doc = "Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned."]
    pub async fn get_my_commands(
        &self,
        method: crate::methods::GetMyCommands,
    ) -> Result<Vec<crate::types::BotCommand>> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success."]
    pub async fn get_my_default_administrator_rights(
        &self,
        method: crate::methods::GetMyDefaultAdministratorRights,
    ) -> Result<crate::types::ChatAdministratorRights> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get the current bot description for the given user language. Returns BotDescription on success."]
    pub async fn get_my_description(
        &self,
        method: crate::methods::GetMyDescription,
    ) -> Result<crate::types::BotDescription> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get the current bot name for the given user language. Returns BotName on success."]
    pub async fn get_my_name(
        &self,
        method: crate::methods::GetMyName,
    ) -> Result<crate::types::BotName> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success."]
    pub async fn get_my_short_description(
        &self,
        method: crate::methods::GetMyShortDescription,
    ) -> Result<crate::types::BotShortDescription> {
        self.execute(&method).await
    }

    #[doc = "A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object."]
    pub async fn get_my_star_balance(&self) -> Result<crate::types::StarAmount> {
        self.execute(&crate::methods::GetMyStarBalance::new()).await
    }

    #[doc = "Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object."]
    pub async fn get_star_transactions(
        &self,
        method: crate::methods::GetStarTransactions,
    ) -> Result<crate::types::StarTransactions> {
        self.execute(&method).await
    }

    #[doc = "Use this method to get a sticker set. On success, a StickerSet object is returned."]
    pub async fn get_sticker_set(
        &self,
        name: impl Into<String>,
    ) -> Result<crate::types::StickerSet> {
        self.execute(&crate::methods::GetStickerSet::new(name))
            .await
    }

    #[doc = "Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object."]
    pub async fn get_user_chat_boosts(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<crate::types::UserChatBoosts> {
        self.execute(&crate::methods::GetUserChatBoosts::new(chat_id, user_id))
            .await
    }

    #[doc = "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success."]
    pub async fn get_user_gifts(&self, user_id: i64) -> Result<crate::types::OwnedGifts> {
        self.execute(&crate::methods::GetUserGifts::new(user_id))
            .await
    }

    #[doc = "Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an Array of Message objects is returned."]
    pub async fn get_user_personal_chat_messages(
        &self,
        user_id: i64,
        limit: i64,
    ) -> Result<Vec<crate::types::Message>> {
        self.execute(&crate::methods::GetUserPersonalChatMessages::new(
            user_id, limit,
        ))
        .await
    }

    #[doc = "Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object."]
    pub async fn get_user_profile_audios(
        &self,
        user_id: i64,
    ) -> Result<crate::types::UserProfileAudios> {
        self.execute(&crate::methods::GetUserProfileAudios::new(user_id))
            .await
    }

    #[doc = "Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object."]
    pub async fn get_user_profile_photos(
        &self,
        user_id: i64,
    ) -> Result<crate::types::UserProfilePhotos> {
        self.execute(&crate::methods::GetUserProfilePhotos::new(user_id))
            .await
    }

    #[doc = "Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty."]
    pub async fn get_webhook_info(&self) -> Result<crate::types::WebhookInfo> {
        self.execute(&crate::methods::GetWebhookInfo::new()).await
    }

    #[doc = "Gifts a Telegram Premium subscription to the given user. Returns True on success."]
    pub async fn gift_premium_subscription(
        &self,
        user_id: i64,
        month_count: i64,
        star_count: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::GiftPremiumSubscription::new(
            user_id,
            month_count,
            star_count,
        ))
        .await
    }

    #[doc = "Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success."]
    pub async fn hide_general_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::HideGeneralForumTopic::new(chat_id))
            .await
    }

    #[doc = "Use this method for your bot to leave a group, supergroup or channel. Returns True on success."]
    pub async fn leave_chat(&self, chat_id: impl Into<crate::types::ChatId>) -> Result<bool> {
        self.execute(&crate::methods::LeaveChat::new(chat_id)).await
    }

    #[doc = "Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters."]
    pub async fn log_out(&self) -> Result<bool> {
        self.execute(&crate::methods::LogOut::new()).await
    }

    #[doc = "Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success."]
    pub async fn pin_chat_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::PinChatMessage::new(chat_id, message_id))
            .await
    }

    #[doc = "Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success."]
    pub async fn post_story(
        &self,
        business_connection_id: impl Into<String>,
        content: impl Into<crate::types::InputStoryContentUnion>,
        active_period: i64,
    ) -> Result<crate::types::Story> {
        self.execute(&crate::methods::PostStory::new(
            business_connection_id,
            content,
            active_period,
        ))
        .await
    }

    #[doc = "Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success."]
    pub async fn promote_chat_member(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::PromoteChatMember::new(chat_id, user_id))
            .await
    }

    #[doc = "Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success."]
    pub async fn read_business_message(
        &self,
        business_connection_id: impl Into<String>,
        chat_id: i64,
        message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::ReadBusinessMessage::new(
            business_connection_id,
            chat_id,
            message_id,
        ))
        .await
    }

    #[doc = "Refunds a successful payment in Telegram Stars. Returns True on success."]
    pub async fn refund_star_payment(
        &self,
        user_id: i64,
        telegram_payment_charge_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::RefundStarPayment::new(
            user_id,
            telegram_payment_charge_id,
        ))
        .await
    }

    #[doc = "Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success."]
    pub async fn remove_business_account_profile_photo(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::RemoveBusinessAccountProfilePhoto::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success."]
    pub async fn remove_chat_verification(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::RemoveChatVerification::new(chat_id))
            .await
    }

    #[doc = "Removes the profile photo of the bot. Requires no parameters. Returns True on success."]
    pub async fn remove_my_profile_photo(&self) -> Result<bool> {
        self.execute(&crate::methods::RemoveMyProfilePhoto::new())
            .await
    }

    #[doc = "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success."]
    pub async fn remove_user_verification(&self, user_id: i64) -> Result<bool> {
        self.execute(&crate::methods::RemoveUserVerification::new(user_id))
            .await
    }

    #[doc = "Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success."]
    pub async fn reopen_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_thread_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::ReopenForumTopic::new(
            chat_id,
            message_thread_id,
        ))
        .await
    }

    #[doc = "Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success."]
    pub async fn reopen_general_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::ReopenGeneralForumTopic::new(chat_id))
            .await
    }

    #[doc = "Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success."]
    pub async fn replace_managed_bot_token(&self, user_id: i64) -> Result<String> {
        self.execute(&crate::methods::ReplaceManagedBotToken::new(user_id))
            .await
    }

    #[doc = "Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success."]
    pub async fn replace_sticker_in_set(
        &self,
        user_id: i64,
        name: impl Into<String>,
        old_sticker: impl Into<String>,
        sticker: crate::types::InputSticker,
    ) -> Result<bool> {
        self.execute(&crate::methods::ReplaceStickerInSet::new(
            user_id,
            name,
            old_sticker,
            sticker,
        ))
        .await
    }

    #[doc = "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success."]
    pub async fn repost_story(
        &self,
        business_connection_id: impl Into<String>,
        from_chat_id: i64,
        from_story_id: i64,
        active_period: i64,
    ) -> Result<crate::types::Story> {
        self.execute(&crate::methods::RepostStory::new(
            business_connection_id,
            from_chat_id,
            from_story_id,
            active_period,
        ))
        .await
    }

    #[doc = "Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success."]
    pub async fn restrict_chat_member(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
        permissions: crate::types::ChatPermissions,
    ) -> Result<bool> {
        self.execute(&crate::methods::RestrictChatMember::new(
            chat_id,
            user_id,
            permissions,
        ))
        .await
    }

    #[doc = "Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object."]
    pub async fn revoke_chat_invite_link(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        invite_link: impl Into<String>,
    ) -> Result<crate::types::ChatInviteLink> {
        self.execute(&crate::methods::RevokeChatInviteLink::new(
            chat_id,
            invite_link,
        ))
        .await
    }

    #[doc = "Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object."]
    pub async fn save_prepared_inline_message(
        &self,
        user_id: i64,
        result: impl Into<crate::types::InlineQueryResultUnion>,
    ) -> Result<crate::types::PreparedInlineMessage> {
        self.execute(&crate::methods::SavePreparedInlineMessage::new(
            user_id, result,
        ))
        .await
    }

    #[doc = "Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object."]
    pub async fn save_prepared_keyboard_button(
        &self,
        user_id: i64,
        button: crate::types::KeyboardButton,
    ) -> Result<crate::types::PreparedKeyboardButton> {
        self.execute(&crate::methods::SavePreparedKeyboardButton::new(
            user_id, button,
        ))
        .await
    }

    #[doc = "Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future."]
    pub async fn send_animation(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        animation: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendAnimation::new(chat_id, animation))
            .await
    }

    #[doc = "Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future."]
    pub async fn send_audio(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        audio: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendAudio::new(chat_id, audio))
            .await
    }

    #[doc = "Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success."]
    pub async fn send_chat_action(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        action: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SendChatAction::new(chat_id, action))
            .await
    }

    #[doc = "Use this method to process a received chat join request query by showing a Mini App to the user before deciding the outcome. Call answerChatJoinRequestQuery to resolve the join request query based on the user interaction with the Mini App. Returns True on success."]
    pub async fn send_chat_join_request_web_app(
        &self,
        chat_join_request_query_id: impl Into<String>,
        web_app_url: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SendChatJoinRequestWebApp::new(
            chat_join_request_query_id,
            web_app_url,
        ))
        .await
    }

    #[doc = "Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned."]
    pub async fn send_checklist(
        &self,
        business_connection_id: impl Into<String>,
        chat_id: impl Into<crate::types::ChatId>,
        checklist: crate::types::InputChecklist,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendChecklist::new(
            business_connection_id,
            chat_id,
            checklist,
        ))
        .await
    }

    #[doc = "Use this method to send phone contacts. On success, the sent Message is returned."]
    pub async fn send_contact(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        phone_number: impl Into<String>,
        first_name: impl Into<String>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendContact::new(
            chat_id,
            phone_number,
            first_name,
        ))
        .await
    }

    #[doc = "Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned."]
    pub async fn send_dice(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendDice::new(chat_id)).await
    }

    #[doc = "Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future."]
    pub async fn send_document(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        document: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendDocument::new(chat_id, document))
            .await
    }

    #[doc = "Use this method to send a game. On success, the sent Message is returned."]
    pub async fn send_game(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        game_short_name: impl Into<String>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendGame::new(chat_id, game_short_name))
            .await
    }

    #[doc = "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success."]
    pub async fn send_gift(&self, gift_id: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::SendGift::new(gift_id)).await
    }

    #[doc = "Use this method to send invoices. On success, the sent Message is returned."]
    pub async fn send_invoice(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        title: impl Into<String>,
        description: impl Into<String>,
        payload: impl Into<String>,
        currency: impl Into<String>,
        prices: Vec<crate::types::LabeledPrice>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendInvoice::new(
            chat_id,
            title,
            description,
            payload,
            currency,
            prices,
        ))
        .await
    }

    #[doc = "Use this method to send live photos. On success, the sent Message is returned."]
    pub async fn send_live_photo(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        live_photo: impl Into<crate::types::InputFile>,
        photo: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendLivePhoto::new(
            chat_id, live_photo, photo,
        ))
        .await
    }

    #[doc = "Use this method to send point on the map. On success, the sent Message is returned."]
    pub async fn send_location(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        latitude: f64,
        longitude: f64,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendLocation::new(
            chat_id, latitude, longitude,
        ))
        .await
    }

    #[doc = "Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned."]
    pub async fn send_media_group(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        media: Vec<crate::types::MediaUnion>,
    ) -> Result<Vec<crate::types::Message>> {
        self.execute(&crate::methods::SendMediaGroup::new(chat_id, media))
            .await
    }

    #[doc = "Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success."]
    pub async fn send_message_draft(&self, chat_id: i64, draft_id: i64) -> Result<bool> {
        self.execute(&crate::methods::SendMessageDraft::new(chat_id, draft_id))
            .await
    }

    #[doc = "Use this method to send paid media. On success, the sent Message is returned."]
    pub async fn send_paid_media(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        star_count: i64,
        media: Vec<crate::types::InputPaidMediaUnion>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendPaidMedia::new(
            chat_id, star_count, media,
        ))
        .await
    }

    #[doc = "Use this method to send photos. On success, the sent Message is returned."]
    pub async fn send_photo(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        photo: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendPhoto::new(chat_id, photo))
            .await
    }

    #[doc = "Use this method to send a native poll. On success, the sent Message is returned."]
    pub async fn send_poll(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        question: impl Into<String>,
        options: Vec<crate::types::InputPollOptionUnion>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendPoll::new(chat_id, question, options))
            .await
    }

    #[doc = "Use this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent Message is returned."]
    pub async fn send_rich_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        rich_message: crate::types::InputRichMessage,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendRichMessage::new(chat_id, rich_message))
            .await
    }

    #[doc = "Use this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendRichMessage with the complete message to persist it in the user's chat. Returns True on success."]
    pub async fn send_rich_message_draft(
        &self,
        chat_id: i64,
        draft_id: i64,
        rich_message: crate::types::InputRichMessage,
    ) -> Result<bool> {
        self.execute(&crate::methods::SendRichMessageDraft::new(
            chat_id,
            draft_id,
            rich_message,
        ))
        .await
    }

    #[doc = "Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned."]
    pub async fn send_sticker(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        sticker: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendSticker::new(chat_id, sticker))
            .await
    }

    #[doc = "Use this method to send information about a venue. On success, the sent Message is returned."]
    pub async fn send_venue(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        latitude: f64,
        longitude: f64,
        title: impl Into<String>,
        address: impl Into<String>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendVenue::new(
            chat_id, latitude, longitude, title, address,
        ))
        .await
    }

    #[doc = "Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future."]
    pub async fn send_video(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        video: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendVideo::new(chat_id, video))
            .await
    }

    #[doc = "As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned."]
    pub async fn send_video_note(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        video_note: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendVideoNote::new(chat_id, video_note))
            .await
    }

    #[doc = "Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future."]
    pub async fn send_voice(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        voice: impl Into<crate::types::InputFile>,
    ) -> Result<crate::types::Message> {
        self.execute(&crate::methods::SendVoice::new(chat_id, voice))
            .await
    }

    #[doc = "Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success."]
    pub async fn set_business_account_bio(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetBusinessAccountBio::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success."]
    pub async fn set_business_account_gift_settings(
        &self,
        business_connection_id: impl Into<String>,
        show_gift_button: bool,
        accepted_gift_types: crate::types::AcceptedGiftTypes,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetBusinessAccountGiftSettings::new(
            business_connection_id,
            show_gift_button,
            accepted_gift_types,
        ))
        .await
    }

    #[doc = "Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success."]
    pub async fn set_business_account_name(
        &self,
        business_connection_id: impl Into<String>,
        first_name: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetBusinessAccountName::new(
            business_connection_id,
            first_name,
        ))
        .await
    }

    #[doc = "Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success."]
    pub async fn set_business_account_profile_photo(
        &self,
        business_connection_id: impl Into<String>,
        photo: impl Into<crate::types::InputProfilePhotoUnion>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetBusinessAccountProfilePhoto::new(
            business_connection_id,
            photo,
        ))
        .await
    }

    #[doc = "Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success."]
    pub async fn set_business_account_username(
        &self,
        business_connection_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetBusinessAccountUsername::new(
            business_connection_id,
        ))
        .await
    }

    #[doc = "Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success."]
    pub async fn set_chat_administrator_custom_title(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
        custom_title: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatAdministratorCustomTitle::new(
            chat_id,
            user_id,
            custom_title,
        ))
        .await
    }

    #[doc = "Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn set_chat_description(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatDescription::new(chat_id))
            .await
    }

    #[doc = "Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success."]
    pub async fn set_chat_member_tag(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatMemberTag::new(chat_id, user_id))
            .await
    }

    #[doc = "Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success."]
    pub async fn set_chat_menu_button(
        &self,
        method: crate::methods::SetChatMenuButton,
    ) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success."]
    pub async fn set_chat_permissions(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        permissions: crate::types::ChatPermissions,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatPermissions::new(
            chat_id,
            permissions,
        ))
        .await
    }

    #[doc = "Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn set_chat_photo(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        photo: impl Into<crate::types::InputFile>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatPhoto::new(chat_id, photo))
            .await
    }

    #[doc = "Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success."]
    pub async fn set_chat_sticker_set(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        sticker_set_name: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatStickerSet::new(
            chat_id,
            sticker_set_name,
        ))
        .await
    }

    #[doc = "Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn set_chat_title(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        title: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetChatTitle::new(chat_id, title))
            .await
    }

    #[doc = "Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success."]
    pub async fn set_custom_emoji_sticker_set_thumbnail(
        &self,
        name: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetCustomEmojiStickerSetThumbnail::new(
            name,
        ))
        .await
    }

    #[doc = "Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False."]
    pub async fn set_game_score(
        &self,
        user_id: i64,
        score: i64,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&crate::methods::SetGameScore::new(user_id, score))
            .await
    }

    #[doc = "Use this method to change the access settings of a managed bot. Returns True on success."]
    pub async fn set_managed_bot_access_settings(
        &self,
        user_id: i64,
        is_access_restricted: bool,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetManagedBotAccessSettings::new(
            user_id,
            is_access_restricted,
        ))
        .await
    }

    #[doc = "Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success."]
    pub async fn set_message_reaction(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetMessageReaction::new(
            chat_id, message_id,
        ))
        .await
    }

    #[doc = "Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success."]
    pub async fn set_my_commands(&self, commands: Vec<crate::types::BotCommand>) -> Result<bool> {
        self.execute(&crate::methods::SetMyCommands::new(commands))
            .await
    }

    #[doc = "Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success."]
    pub async fn set_my_default_administrator_rights(
        &self,
        method: crate::methods::SetMyDefaultAdministratorRights,
    ) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success."]
    pub async fn set_my_description(
        &self,
        method: crate::methods::SetMyDescription,
    ) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to change the bot's name. Returns True on success."]
    pub async fn set_my_name(&self, method: crate::methods::SetMyName) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Changes the profile photo of the bot. Returns True on success."]
    pub async fn set_my_profile_photo(
        &self,
        photo: impl Into<crate::types::InputProfilePhotoUnion>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetMyProfilePhoto::new(photo))
            .await
    }

    #[doc = "Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success."]
    pub async fn set_my_short_description(
        &self,
        method: crate::methods::SetMyShortDescription,
    ) -> Result<bool> {
        self.execute(&method).await
    }

    #[doc = "Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success."]
    pub async fn set_passport_data_errors(
        &self,
        user_id: i64,
        errors: Vec<crate::types::PassportElementErrorUnion>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetPassportDataErrors::new(user_id, errors))
            .await
    }

    #[doc = "Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success."]
    pub async fn set_sticker_emoji_list(
        &self,
        sticker: impl Into<String>,
        emoji_list: Vec<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetStickerEmojiList::new(
            sticker, emoji_list,
        ))
        .await
    }

    #[doc = "Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success."]
    pub async fn set_sticker_keywords(&self, sticker: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::SetStickerKeywords::new(sticker))
            .await
    }

    #[doc = "Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success."]
    pub async fn set_sticker_mask_position(&self, sticker: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::SetStickerMaskPosition::new(sticker))
            .await
    }

    #[doc = "Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success."]
    pub async fn set_sticker_position_in_set(
        &self,
        sticker: impl Into<String>,
        position: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetStickerPositionInSet::new(
            sticker, position,
        ))
        .await
    }

    #[doc = "Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success."]
    pub async fn set_sticker_set_thumbnail(
        &self,
        name: impl Into<String>,
        user_id: i64,
        format: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetStickerSetThumbnail::new(
            name, user_id, format,
        ))
        .await
    }

    #[doc = "Use this method to set the title of a created sticker set. Returns True on success."]
    pub async fn set_sticker_set_title(
        &self,
        name: impl Into<String>,
        title: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::SetStickerSetTitle::new(name, title))
            .await
    }

    #[doc = "Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success."]
    pub async fn set_user_emoji_status(&self, user_id: i64) -> Result<bool> {
        self.execute(&crate::methods::SetUserEmojiStatus::new(user_id))
            .await
    }

    #[doc = "Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success."]
    pub async fn set_webhook(&self, url: impl Into<String>) -> Result<bool> {
        self.execute(&crate::methods::SetWebhook::new(url)).await
    }

    #[doc = "Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned."]
    pub async fn stop_message_live_location(
        &self,
        method: crate::methods::StopMessageLiveLocation,
    ) -> Result<crate::methods::MessageOrBool> {
        self.execute(&method).await
    }

    #[doc = "Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned."]
    pub async fn stop_poll(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_id: i64,
    ) -> Result<crate::types::Poll> {
        self.execute(&crate::methods::StopPoll::new(chat_id, message_id))
            .await
    }

    #[doc = "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success."]
    pub async fn transfer_business_account_stars(
        &self,
        business_connection_id: impl Into<String>,
        star_count: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::TransferBusinessAccountStars::new(
            business_connection_id,
            star_count,
        ))
        .await
    }

    #[doc = "Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success."]
    pub async fn transfer_gift(
        &self,
        business_connection_id: impl Into<String>,
        owned_gift_id: impl Into<String>,
        new_owner_chat_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::TransferGift::new(
            business_connection_id,
            owned_gift_id,
            new_owner_chat_id,
        ))
        .await
    }

    #[doc = "Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success."]
    pub async fn unban_chat_member(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        user_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnbanChatMember::new(chat_id, user_id))
            .await
    }

    #[doc = "Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success."]
    pub async fn unban_chat_sender_chat(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        sender_chat_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnbanChatSenderChat::new(
            chat_id,
            sender_chat_id,
        ))
        .await
    }

    #[doc = "Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success."]
    pub async fn unhide_general_forum_topic(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnhideGeneralForumTopic::new(chat_id))
            .await
    }

    #[doc = "Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success."]
    pub async fn unpin_all_chat_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnpinAllChatMessages::new(chat_id))
            .await
    }

    #[doc = "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success."]
    pub async fn unpin_all_forum_topic_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
        message_thread_id: i64,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnpinAllForumTopicMessages::new(
            chat_id,
            message_thread_id,
        ))
        .await
    }

    #[doc = "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success."]
    pub async fn unpin_all_general_forum_topic_messages(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnpinAllGeneralForumTopicMessages::new(
            chat_id,
        ))
        .await
    }

    #[doc = "Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success."]
    pub async fn unpin_chat_message(
        &self,
        chat_id: impl Into<crate::types::ChatId>,
    ) -> Result<bool> {
        self.execute(&crate::methods::UnpinChatMessage::new(chat_id))
            .await
    }

    #[doc = "Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success."]
    pub async fn upgrade_gift(
        &self,
        business_connection_id: impl Into<String>,
        owned_gift_id: impl Into<String>,
    ) -> Result<bool> {
        self.execute(&crate::methods::UpgradeGift::new(
            business_connection_id,
            owned_gift_id,
        ))
        .await
    }

    #[doc = "Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success."]
    pub async fn upload_sticker_file(
        &self,
        user_id: i64,
        sticker: impl Into<crate::types::InputFile>,
        sticker_format: impl Into<String>,
    ) -> Result<crate::types::File> {
        self.execute(&crate::methods::UploadStickerFile::new(
            user_id,
            sticker,
            sticker_format,
        ))
        .await
    }

    #[doc = "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success."]
    pub async fn verify_chat(&self, chat_id: impl Into<crate::types::ChatId>) -> Result<bool> {
        self.execute(&crate::methods::VerifyChat::new(chat_id))
            .await
    }

    #[doc = "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success."]
    pub async fn verify_user(&self, user_id: i64) -> Result<bool> {
        self.execute(&crate::methods::VerifyUser::new(user_id))
            .await
    }
}