@@ -819,7 +819,12 @@ public extension TelegramBot {
819
819
options: [ String ] ,
820
820
isAnonymous: Bool ? = nil ,
821
821
type: PollType ? = nil ,
822
+ allowMultipleAnswers: Bool ? = nil ,
822
823
correctOptionId: Int ? = nil ,
824
+ explanation: String ? = nil ,
825
+ explanationParseMode: ParseMode ? = nil ,
826
+ openPeriod: Int ? = nil ,
827
+ closeDate: Date ? = nil ,
823
828
isClosed: Bool ? = nil ,
824
829
disableNotification: Bool ? = nil ,
825
830
replyToMessageId: Int ? = nil ,
@@ -831,7 +836,12 @@ public extension TelegramBot {
831
836
" options " : options,
832
837
" is_anonymous " : isAnonymous,
833
838
" type " : type,
839
+ " allow_multiple_answers " : allowMultipleAnswers,
834
840
" correct_option_id " : correctOptionId,
841
+ " explanation " : explanation,
842
+ " explanation_parse_mode " : explanationParseMode,
843
+ " open_period " : openPeriod,
844
+ " close_date " : closeDate,
835
845
" is_closed " : isClosed,
836
846
" disable_notification " : disableNotification,
837
847
" reply_to_message_id " : replyToMessageId,
@@ -844,7 +854,12 @@ public extension TelegramBot {
844
854
options: [ String ] ,
845
855
isAnonymous: Bool ? = nil ,
846
856
type: PollType ? = nil ,
857
+ allowMultipleAnswers: Bool ? = nil ,
847
858
correctOptionId: Int ? = nil ,
859
+ explanation: String ? = nil ,
860
+ explanationParseMode: ParseMode ? = nil ,
861
+ openPeriod: Int ? = nil ,
862
+ closeDate: Date ? = nil ,
848
863
isClosed: Bool ? = nil ,
849
864
disableNotification: Bool ? = nil ,
850
865
replyToMessageId: Int ? = nil ,
@@ -858,10 +873,50 @@ public extension TelegramBot {
858
873
" options " : options,
859
874
" is_anonymous " : isAnonymous,
860
875
" type " : type,
876
+ " allow_multiple_answers " : allowMultipleAnswers,
861
877
" correct_option_id " : correctOptionId,
878
+ " explanation " : explanation,
879
+ " explanation_parse_mode " : explanationParseMode,
880
+ " open_period " : openPeriod,
881
+ " close_date " : closeDate,
862
882
" is_closed " : isClosed,
863
883
" disable_notification " : disableNotification,
864
884
" reply_to_message_id " : replyToMessageId,
885
+ " reply_markup " : replyMarkup] ,
886
+ queue: queue, completion: completion)
887
+ }
888
+ typealias SendDiceCompletion = ( _ result: Message ? , _ error: DataTaskError ? ) -> ( )
889
+
890
+ @discardableResult
891
+ func sendDiceSync(
892
+ chatId: ChatId ,
893
+ emoji: String ? = nil ,
894
+ disableNotification: Bool ? = nil ,
895
+ replyToMessageId: Int ? = nil ,
896
+ replyMarkup: ReplyMarkup ? = nil ,
897
+ _ parameters: [ String : Encodable ? ] = [ : ] ) -> Message ? {
898
+ return requestSync ( " sendDice " , defaultParameters [ " sendDice " ] , parameters, [
899
+ " chat_id " : chatId,
900
+ " emoji " : emoji,
901
+ " disable_notification " : disableNotification,
902
+ " reply_to_message_id " : replyToMessageId,
903
+ " reply_markup " : replyMarkup] )
904
+ }
905
+
906
+ func sendDiceAsync(
907
+ chatId: ChatId ,
908
+ emoji: String ? = nil ,
909
+ disableNotification: Bool ? = nil ,
910
+ replyToMessageId: Int ? = nil ,
911
+ replyMarkup: ReplyMarkup ? = nil ,
912
+ _ parameters: [ String : Encodable ? ] = [ : ] ,
913
+ queue: DispatchQueue = . main,
914
+ completion: SendDiceCompletion ? = nil ) {
915
+ return requestAsync ( " sendDice " , defaultParameters [ " sendDice " ] , parameters, [
916
+ " chat_id " : chatId,
917
+ " emoji " : emoji,
918
+ " disable_notification " : disableNotification,
919
+ " reply_to_message_id " : replyToMessageId,
865
920
" reply_markup " : replyMarkup] ,
866
921
queue: queue, completion: completion)
867
922
}
@@ -1441,6 +1496,44 @@ public extension TelegramBot {
1441
1496
" cache_time " : cacheTime] ,
1442
1497
queue: queue, completion: completion)
1443
1498
}
1499
+ typealias SetMyCommandsCompletion = ( _ result: Bool ? , _ error: DataTaskError ? ) -> ( )
1500
+
1501
+ @discardableResult
1502
+ func setMyCommandsSync(
1503
+ commands: [ BotCommand ] ,
1504
+ _ parameters: [ String : Encodable ? ] = [ : ] ) -> Bool ? {
1505
+ return requestSync ( " setMyCommands " , defaultParameters [ " setMyCommands " ] , parameters, [
1506
+ " commands " : commands] )
1507
+ }
1508
+
1509
+ func setMyCommandsAsync(
1510
+ commands: [ BotCommand ] ,
1511
+ _ parameters: [ String : Encodable ? ] = [ : ] ,
1512
+ queue: DispatchQueue = . main,
1513
+ completion: SetMyCommandsCompletion ? = nil ) {
1514
+ return requestAsync ( " setMyCommands " , defaultParameters [ " setMyCommands " ] , parameters, [
1515
+ " commands " : commands] ,
1516
+ queue: queue, completion: completion)
1517
+ }
1518
+ typealias GetMyCommandsCompletion = ( _ result: [ BotCommand ] ? , _ error: DataTaskError ? ) -> ( )
1519
+
1520
+ @discardableResult
1521
+ func getMyCommandsSync(
1522
+
1523
+ _ parameters: [ String : Encodable ? ] = [ : ] ) -> [ BotCommand ] ? {
1524
+ return requestSync ( " getMyCommands " , defaultParameters [ " getMyCommands " ] , parameters, [
1525
+ : ] )
1526
+ }
1527
+
1528
+ func getMyCommandsAsync(
1529
+
1530
+ _ parameters: [ String : Encodable ? ] = [ : ] ,
1531
+ queue: DispatchQueue = . main,
1532
+ completion: GetMyCommandsCompletion ? = nil ) {
1533
+ return requestAsync ( " getMyCommands " , defaultParameters [ " getMyCommands " ] , parameters, [
1534
+ : ] ,
1535
+ queue: queue, completion: completion)
1536
+ }
1444
1537
typealias EditMessageTextCompletion = ( _ result: MessageOrBool ? , _ error: DataTaskError ? ) -> ( )
1445
1538
1446
1539
@discardableResult
@@ -1723,7 +1816,8 @@ public extension TelegramBot {
1723
1816
userId: Int64 ,
1724
1817
name: String ,
1725
1818
title: String ,
1726
- pngSticker: FileInfo ,
1819
+ pngSticker: FileInfo ? = nil ,
1820
+ tgsSticker: InputFile ? = nil ,
1727
1821
emojis: String ,
1728
1822
containsMasks: Bool ? = nil ,
1729
1823
maskPosition: Bool ? = nil ,
@@ -1733,6 +1827,7 @@ public extension TelegramBot {
1733
1827
" name " : name,
1734
1828
" title " : title,
1735
1829
" png_sticker " : pngSticker,
1830
+ " tgs_sticker " : tgsSticker,
1736
1831
" emojis " : emojis,
1737
1832
" contains_masks " : containsMasks,
1738
1833
" mask_position " : maskPosition] )
@@ -1742,7 +1837,8 @@ public extension TelegramBot {
1742
1837
userId: Int64 ,
1743
1838
name: String ,
1744
1839
title: String ,
1745
- pngSticker: FileInfo ,
1840
+ pngSticker: FileInfo ? = nil ,
1841
+ tgsSticker: InputFile ? = nil ,
1746
1842
emojis: String ,
1747
1843
containsMasks: Bool ? = nil ,
1748
1844
maskPosition: Bool ? = nil ,
@@ -1754,6 +1850,7 @@ public extension TelegramBot {
1754
1850
" name " : name,
1755
1851
" title " : title,
1756
1852
" png_sticker " : pngSticker,
1853
+ " tgs_sticker " : tgsSticker,
1757
1854
" emojis " : emojis,
1758
1855
" contains_masks " : containsMasks,
1759
1856
" mask_position " : maskPosition] ,
@@ -1765,22 +1862,25 @@ public extension TelegramBot {
1765
1862
func addStickerToSetSync(
1766
1863
userId: Int ,
1767
1864
name: String ,
1768
- pngSticker: FileInfo ,
1865
+ pngSticker: FileInfo ? = nil ,
1866
+ tgsSticker: InputFile ? = nil ,
1769
1867
emojis: String ,
1770
1868
maskPosition: MaskPosition ? = nil ,
1771
1869
_ parameters: [ String : Encodable ? ] = [ : ] ) -> Bool ? {
1772
1870
return requestSync ( " addStickerToSet " , defaultParameters [ " addStickerToSet " ] , parameters, [
1773
1871
" user_id " : userId,
1774
1872
" name " : name,
1775
1873
" png_sticker " : pngSticker,
1874
+ " tgs_sticker " : tgsSticker,
1776
1875
" emojis " : emojis,
1777
1876
" mask_position " : maskPosition] )
1778
1877
}
1779
1878
1780
1879
func addStickerToSetAsync(
1781
1880
userId: Int ,
1782
1881
name: String ,
1783
- pngSticker: FileInfo ,
1882
+ pngSticker: FileInfo ? = nil ,
1883
+ tgsSticker: InputFile ? = nil ,
1784
1884
emojis: String ,
1785
1885
maskPosition: MaskPosition ? = nil ,
1786
1886
_ parameters: [ String : Encodable ? ] = [ : ] ,
@@ -1790,6 +1890,7 @@ public extension TelegramBot {
1790
1890
" user_id " : userId,
1791
1891
" name " : name,
1792
1892
" png_sticker " : pngSticker,
1893
+ " tgs_sticker " : tgsSticker,
1793
1894
" emojis " : emojis,
1794
1895
" mask_position " : maskPosition] ,
1795
1896
queue: queue, completion: completion)
@@ -1836,6 +1937,33 @@ public extension TelegramBot {
1836
1937
" sticker " : sticker] ,
1837
1938
queue: queue, completion: completion)
1838
1939
}
1940
+ typealias SetStickerSetThumbCompletion = ( _ result: Bool ? , _ error: DataTaskError ? ) -> ( )
1941
+
1942
+ @discardableResult
1943
+ func setStickerSetThumbSync(
1944
+ name: String ,
1945
+ userId: Int ,
1946
+ thumb: FileInfo ? = nil ,
1947
+ _ parameters: [ String : Encodable ? ] = [ : ] ) -> Bool ? {
1948
+ return requestSync ( " setStickerSetThumb " , defaultParameters [ " setStickerSetThumb " ] , parameters, [
1949
+ " name " : name,
1950
+ " user_id " : userId,
1951
+ " thumb " : thumb] )
1952
+ }
1953
+
1954
+ func setStickerSetThumbAsync(
1955
+ name: String ,
1956
+ userId: Int ,
1957
+ thumb: FileInfo ? = nil ,
1958
+ _ parameters: [ String : Encodable ? ] = [ : ] ,
1959
+ queue: DispatchQueue = . main,
1960
+ completion: SetStickerSetThumbCompletion ? = nil ) {
1961
+ return requestAsync ( " setStickerSetThumb " , defaultParameters [ " setStickerSetThumb " ] , parameters, [
1962
+ " name " : name,
1963
+ " user_id " : userId,
1964
+ " thumb " : thumb] ,
1965
+ queue: queue, completion: completion)
1966
+ }
1839
1967
typealias AnswerInlineQueryCompletion = ( _ result: Bool ? , _ error: DataTaskError ? ) -> ( )
1840
1968
1841
1969
@discardableResult
0 commit comments