telegram-bot-api-nodejs 1.0.38 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +339 -35
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface SetWebHookOptions {
11
11
  max_connections?: number;
12
12
  allowed_updates?: AllowedUpdates[];
13
13
  }
14
- interface SendBasicOptions {
14
+ export interface SendBasicOptions {
15
15
  chat_id: number | string;
16
16
  business_connection_id?: string;
17
17
  message_thread_id?: number;
@@ -25,19 +25,48 @@ export interface SendMessageOptions extends SendBasicOptions {
25
25
  disable_web_page_preview?: boolean;
26
26
  entities?: MessageEntity[];
27
27
  }
28
- interface SendAnimationOptions extends SendBasicOptions {
28
+ export interface SendAnimationOptions extends SendBasicOptions {
29
29
  animation: string;
30
30
  parse_mode?: ParseMode;
31
31
  caption?: string;
32
32
  }
33
- interface SendDocumentOptions extends SendBasicOptions {
33
+ export interface SendDocumentOptions extends SendBasicOptions {
34
34
  document: string;
35
35
  parse_mode?: ParseMode;
36
36
  caption?: string;
37
37
  }
38
- interface SendMediaGroupOptions extends SendBasicOptions {
38
+ export interface SendMediaGroupOptions extends SendBasicOptions {
39
39
  media: Array<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>;
40
40
  }
41
+ export interface SendInvoiceOptions extends SendBasicOptions {
42
+ provider_data?: string;
43
+ photo_url?: string;
44
+ photo_size?: number;
45
+ photo_width?: number;
46
+ photo_height?: number;
47
+ need_name?: boolean;
48
+ need_phone_number?: boolean;
49
+ need_email?: boolean;
50
+ need_shipping_address?: boolean;
51
+ is_flexible?: boolean;
52
+ }
53
+ export interface RestrictChatMemberOptions {
54
+ until_date?: number;
55
+ can_send_messages?: boolean;
56
+ can_send_media_messages?: boolean;
57
+ can_send_other_messages?: boolean;
58
+ can_add_web_page_previews?: boolean;
59
+ }
60
+ export interface PromoteChatMemberOptions {
61
+ can_change_info?: boolean;
62
+ can_post_messages?: boolean;
63
+ can_edit_messages?: boolean;
64
+ can_delete_messages?: boolean;
65
+ can_invite_users?: boolean;
66
+ can_restrict_members?: boolean;
67
+ can_pin_messages?: boolean;
68
+ can_promote_members?: boolean;
69
+ }
41
70
  export interface AnswerCallbackQueryOptions {
42
71
  callback_query_id: string;
43
72
  text?: string;
@@ -45,33 +74,55 @@ export interface AnswerCallbackQueryOptions {
45
74
  url?: string;
46
75
  cache_time?: number;
47
76
  }
48
- interface SetMyCommandsOptions {
77
+ export interface SetMyCommandsOptions {
49
78
  commands: BotCommand[];
50
79
  scope?: BotCommandScope;
51
80
  language_code?: string;
52
81
  }
53
- interface GetMyCommandsOptions {
82
+ export interface GetMyCommandsOptions {
54
83
  scope?: BotCommandScope;
55
84
  language_code?: string;
56
85
  }
57
- interface DeleteMyCommandsOptions {
86
+ export interface DeleteMyCommandsOptions {
58
87
  }
59
- interface EditMessageTextOptions extends EditMessageReplyMarkupOptions {
88
+ export interface EditMessageTextOptions extends EditMessageReplyMarkupOptions {
60
89
  parse_mode?: ParseMode;
61
90
  disable_web_page_preview?: boolean;
62
91
  text: string;
63
92
  }
64
- interface EditMessageReplyMarkupOptions {
93
+ export interface EditMessageCaptionOptions extends EditMessageReplyMarkupOptions {
94
+ reply_markup?: InlineKeyboardMarkup;
95
+ }
96
+ export interface EditMessageReplyMarkupOptions {
65
97
  chat_id?: number | string;
66
98
  message_id?: number | string;
67
99
  inline_message_id?: string;
68
100
  }
69
- interface PassportFile {
101
+ export interface SetGameScoreOptions {
102
+ force?: boolean;
103
+ disable_edit_message?: boolean;
104
+ chat_id?: number;
105
+ message_id?: number;
106
+ inline_message_id?: string;
107
+ }
108
+ export interface GetGameHighScoresOptions {
109
+ chat_id?: number;
110
+ message_id?: number;
111
+ inline_message_id?: string;
112
+ }
113
+ export interface AnswerShippingQueryOptions {
114
+ shipping_options?: ShippingOption[];
115
+ error_message?: string;
116
+ }
117
+ export interface AnswerPreCheckoutQueryOptions {
118
+ error_message?: string;
119
+ }
120
+ export interface PassportFile {
70
121
  file_id: string;
71
122
  file_size: number;
72
123
  file_date: number;
73
124
  }
74
- interface EncryptedPassportElement {
125
+ export interface EncryptedPassportElement {
75
126
  type: string;
76
127
  data?: string;
77
128
  phone_number?: string;
@@ -83,12 +134,12 @@ interface EncryptedPassportElement {
83
134
  translation?: PassportFile[];
84
135
  hash: string;
85
136
  }
86
- interface EncryptedCredentials {
137
+ export interface EncryptedCredentials {
87
138
  data: string;
88
139
  hash: string;
89
140
  secret: string;
90
141
  }
91
- interface PassportData {
142
+ export interface PassportData {
92
143
  data: EncryptedPassportElement[];
93
144
  credentials: EncryptedCredentials;
94
145
  }
@@ -115,6 +166,8 @@ export interface Update {
115
166
  my_chat_member?: ChatMemberUpdated;
116
167
  chat_member?: ChatMemberUpdated;
117
168
  chat_join_request?: ChatJoinRequest;
169
+ chat_boost?: ChatBoostUpdated;
170
+ removed_chat_boost?: ChatBoostRemoved;
118
171
  }
119
172
  export interface WebhookInfo {
120
173
  url: string;
@@ -155,12 +208,15 @@ export interface Chat {
155
208
  can_set_sticker_set?: boolean;
156
209
  sticker_set_name?: string;
157
210
  }
158
- interface ForumTopicCreated {
211
+ export interface ChatBoostAdded {
212
+ boost_count: number;
213
+ }
214
+ export interface ForumTopicCreated {
159
215
  name: string;
160
216
  icon_color: number;
161
217
  icon_custom_emoji_id?: string;
162
218
  }
163
- interface ForumTopicEdited {
219
+ export interface ForumTopicEdited {
164
220
  name?: string;
165
221
  icon_custom_emoji_id?: string;
166
222
  }
@@ -246,6 +302,7 @@ export interface Message {
246
302
  passport_data?: PassportData;
247
303
  reply_markup?: InlineKeyboardMarkup;
248
304
  sender_chat?: Chat;
305
+ boost_added?: ChatBoostAdded;
249
306
  forum_topic_created?: ForumTopicCreated;
250
307
  forum_topic_edited?: ForumTopicEdited;
251
308
  forum_topic_closed?: ForumTopicClosed;
@@ -257,6 +314,37 @@ export interface Message {
257
314
  video_chat_ended: VideoChatEnded;
258
315
  video_chat_participants_invited: VideoChatParticipantsInvited;
259
316
  }
317
+ export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;
318
+ export interface ChatBoostSourcePremium {
319
+ source: "premium";
320
+ user: User;
321
+ }
322
+ export interface ChatBoostSourceGiftCode {
323
+ source: "gift_code";
324
+ user: User;
325
+ }
326
+ export interface ChatBoostSourceGiveaway {
327
+ source: "giveaway";
328
+ giveaway_message_id: number;
329
+ user?: User;
330
+ is_unclaimed?: boolean;
331
+ }
332
+ export interface ChatBoost {
333
+ boost_id: string;
334
+ add_date: number;
335
+ expiration_date: number;
336
+ source: ChatBoostSource;
337
+ }
338
+ export interface ChatBoostUpdated {
339
+ chat: Chat;
340
+ boost: ChatBoost;
341
+ }
342
+ export interface ChatBoostRemoved {
343
+ chat: Chat;
344
+ boost_id: string;
345
+ remove_date: number;
346
+ source: ChatBoostSource;
347
+ }
260
348
  export interface BusinessConnection {
261
349
  id: string;
262
350
  user: User;
@@ -320,7 +408,7 @@ export interface MessageEntity {
320
408
  url?: string;
321
409
  user?: User;
322
410
  }
323
- interface FileBase {
411
+ export interface FileBase {
324
412
  file_id: string;
325
413
  file_size?: number;
326
414
  }
@@ -382,7 +470,7 @@ export interface Voice extends FileBase {
382
470
  duration: number;
383
471
  mime_type?: string;
384
472
  }
385
- interface InputMediaBase {
473
+ export interface InputMediaBase {
386
474
  media: string;
387
475
  caption?: string;
388
476
  parse_mode?: ParseMode;
@@ -464,18 +552,18 @@ export interface UserProfilePhotos {
464
552
  export interface File extends FileBase {
465
553
  file_path?: string;
466
554
  }
467
- interface ReplyKeyboardMarkup {
555
+ export interface ReplyKeyboardMarkup {
468
556
  keyboard: KeyboardButton[][];
469
557
  resize_keyboard?: boolean;
470
558
  one_time_keyboard?: boolean;
471
559
  selective?: boolean;
472
560
  }
473
- interface KeyboardButton {
561
+ export interface KeyboardButton {
474
562
  text: string;
475
563
  request_contact?: boolean;
476
564
  request_location?: boolean;
477
565
  }
478
- interface ReplyKeyboardRemove {
566
+ export interface ReplyKeyboardRemove {
479
567
  remove_keyboard: boolean;
480
568
  selective?: boolean;
481
569
  }
@@ -492,7 +580,7 @@ export interface InlineKeyboardButton {
492
580
  callback_game?: CallbackGame;
493
581
  pay?: boolean;
494
582
  }
495
- interface LoginUrl {
583
+ export interface LoginUrl {
496
584
  url: string;
497
585
  forward_text?: string;
498
586
  bot_username?: string;
@@ -507,17 +595,17 @@ export interface CallbackQuery {
507
595
  data?: string;
508
596
  game_short_name?: string;
509
597
  }
510
- interface ForceReply {
598
+ export interface ForceReply {
511
599
  force_reply: boolean;
512
600
  selective?: boolean;
513
601
  }
514
- interface ChatPhoto {
602
+ export interface ChatPhoto {
515
603
  small_file_id: string;
516
604
  small_file_unique_id: string;
517
605
  big_file_id: string;
518
606
  big_file_unique_id: string;
519
607
  }
520
- interface ChatMember {
608
+ export interface ChatMember {
521
609
  user: User;
522
610
  status: ChatMemberStatus;
523
611
  until_date?: number;
@@ -537,7 +625,7 @@ interface ChatMember {
537
625
  can_send_other_messages?: boolean;
538
626
  can_add_web_page_previews?: boolean;
539
627
  }
540
- interface ChatPermissions {
628
+ export interface ChatPermissions {
541
629
  can_send_messages?: boolean;
542
630
  can_send_media_messages?: boolean;
543
631
  can_send_polls?: boolean;
@@ -559,26 +647,237 @@ export interface Sticker {
559
647
  mask_position?: MaskPosition;
560
648
  file_size?: number;
561
649
  }
562
- interface MaskPosition {
650
+ export interface StickerSet {
651
+ name: string;
652
+ title: string;
653
+ contains_masks: boolean;
654
+ stickers: Sticker[];
655
+ }
656
+ export interface MaskPosition {
563
657
  point: string;
564
658
  x_shift: number;
565
659
  y_shift: number;
566
660
  scale: number;
567
661
  }
568
- interface InlineQuery {
662
+ export interface InlineQuery {
569
663
  id: string;
570
664
  from: User;
571
665
  location?: Location;
572
666
  query: string;
573
667
  offset: string;
574
668
  }
575
- interface ChosenInlineResult {
669
+ export interface InlineQueryResultBase {
670
+ id: string;
671
+ reply_markup?: InlineKeyboardMarkup;
672
+ }
673
+ export interface InlineQueryResultArticle extends InlineQueryResultBase {
674
+ type: "article";
675
+ title: string;
676
+ input_message_content: InputMessageContent;
677
+ url?: string;
678
+ hide_url?: boolean;
679
+ description?: string;
680
+ thumb_url?: string;
681
+ thumb_width?: number;
682
+ thumb_height?: number;
683
+ }
684
+ export interface InlineQueryResultPhoto extends InlineQueryResultBase {
685
+ type: "photo";
686
+ photo_url: string;
687
+ thumb_url: string;
688
+ photo_width?: number;
689
+ photo_height?: number;
690
+ title?: string;
691
+ description?: string;
692
+ caption?: string;
693
+ input_message_content?: InputMessageContent;
694
+ }
695
+ export interface InlineQueryResultGif extends InlineQueryResultBase {
696
+ type: "gif";
697
+ gif_url: string;
698
+ gif_width?: number;
699
+ gif_height?: number;
700
+ gif_duration?: number;
701
+ thumb_url?: string;
702
+ title?: string;
703
+ caption?: string;
704
+ input_message_content?: InputMessageContent;
705
+ }
706
+ export interface InlineQueryResultMpeg4Gif extends InlineQueryResultBase {
707
+ type: "mpeg4_gif";
708
+ mpeg4_url: string;
709
+ mpeg4_width?: number;
710
+ mpeg4_height?: number;
711
+ mpeg4_duration?: number;
712
+ thumb_url?: string;
713
+ title?: string;
714
+ caption?: string;
715
+ input_message_content?: InputMessageContent;
716
+ }
717
+ export interface InlineQueryResultVideo extends InlineQueryResultBase {
718
+ type: "video";
719
+ video_url: string;
720
+ mime_type: string;
721
+ thumb_url: string;
722
+ title: string;
723
+ caption?: string;
724
+ video_width?: number;
725
+ video_height?: number;
726
+ video_duration?: number;
727
+ description?: string;
728
+ input_message_content?: InputMessageContent;
729
+ }
730
+ export interface InlineQueryResultAudio extends InlineQueryResultBase {
731
+ type: "audio";
732
+ audio_url: string;
733
+ title: string;
734
+ caption?: string;
735
+ performer?: string;
736
+ audio_duration?: number;
737
+ input_message_content?: InputMessageContent;
738
+ }
739
+ export interface InlineQueryResultVoice extends InlineQueryResultBase {
740
+ type: "voice";
741
+ voice_url: string;
742
+ title: string;
743
+ caption?: string;
744
+ voice_duration?: number;
745
+ input_message_content?: InputMessageContent;
746
+ }
747
+ export interface InlineQueryResultDocument extends InlineQueryResultBase {
748
+ type: "document";
749
+ title: string;
750
+ caption?: string;
751
+ document_url: string;
752
+ mime_type: string;
753
+ description?: string;
754
+ input_message_content?: InputMessageContent;
755
+ thumb_url?: string;
756
+ thumb_width?: number;
757
+ thumb_height?: number;
758
+ }
759
+ export interface InlineQueryResultLocationBase extends InlineQueryResultBase {
760
+ latitude: number;
761
+ longitude: number;
762
+ title: string;
763
+ input_message_content?: InputMessageContent;
764
+ thumb_url?: string;
765
+ thumb_width?: number;
766
+ thumb_height?: number;
767
+ }
768
+ export interface InlineQueryResultLocation extends InlineQueryResultLocationBase {
769
+ type: "location";
770
+ }
771
+ export interface InlineQueryResultVenue extends InlineQueryResultLocationBase {
772
+ type: "venue";
773
+ address: string;
774
+ foursquare_id?: string;
775
+ }
776
+ export interface InlineQueryResultContact extends InlineQueryResultBase {
777
+ type: "contact";
778
+ phone_number: string;
779
+ first_name: string;
780
+ last_name?: string;
781
+ input_message_content?: InputMessageContent;
782
+ thumb_url?: string;
783
+ thumb_width?: number;
784
+ thumb_height?: number;
785
+ }
786
+ export interface InlineQueryResultGame extends InlineQueryResultBase {
787
+ type: "game";
788
+ game_short_name: string;
789
+ }
790
+ export interface InlineQueryResultCachedPhoto extends InlineQueryResultBase {
791
+ type: "photo";
792
+ photo_file_id: string;
793
+ title?: string;
794
+ description?: string;
795
+ caption?: string;
796
+ input_message_content?: InputMessageContent;
797
+ }
798
+ export interface InlineQueryResultCachedGif extends InlineQueryResultBase {
799
+ type: "gif";
800
+ gif_file_id: string;
801
+ title?: string;
802
+ caption?: string;
803
+ input_message_content?: InputMessageContent;
804
+ }
805
+ export interface InlineQueryResultCachedMpeg4Gif extends InlineQueryResultBase {
806
+ type: "mpeg4_gif";
807
+ mpeg4_file_id: string;
808
+ title?: string;
809
+ caption?: string;
810
+ input_message_content?: InputMessageContent;
811
+ }
812
+ export interface InlineQueryResultCachedSticker extends InlineQueryResultBase {
813
+ type: "sticker";
814
+ sticker_file_id: string;
815
+ input_message_content?: InputMessageContent;
816
+ }
817
+ export interface InlineQueryResultCachedDocument extends InlineQueryResultBase {
818
+ type: "document";
819
+ title: string;
820
+ document_file_id: string;
821
+ description?: string;
822
+ caption?: string;
823
+ input_message_content?: InputMessageContent;
824
+ }
825
+ export interface InlineQueryResultCachedVideo extends InlineQueryResultBase {
826
+ type: "video";
827
+ video_file_id: string;
828
+ title: string;
829
+ description?: string;
830
+ caption?: string;
831
+ input_message_content?: InputMessageContent;
832
+ }
833
+ export interface InlineQueryResultCachedVoice extends InlineQueryResultBase {
834
+ type: "voice";
835
+ voice_file_id: string;
836
+ title: string;
837
+ caption?: string;
838
+ input_message_content?: InputMessageContent;
839
+ }
840
+ export interface InlineQueryResultCachedAudio extends InlineQueryResultBase {
841
+ type: "audio";
842
+ audio_file_id: string;
843
+ caption?: string;
844
+ input_message_content?: InputMessageContent;
845
+ }
846
+ type InputMessageContent = object;
847
+ export interface InputTextMessageContent extends InputMessageContent {
848
+ message_text: string;
849
+ parse_mode?: ParseMode;
850
+ disable_web_page_preview?: boolean;
851
+ }
852
+ export interface InputLocationMessageContent extends InputMessageContent {
853
+ latitude: number;
854
+ longitude: number;
855
+ }
856
+ export interface InputVenueMessageContent extends InputLocationMessageContent {
857
+ title: string;
858
+ address: string;
859
+ foursquare_id?: string;
860
+ }
861
+ export interface InputContactMessageContent extends InputMessageContent {
862
+ phone_number: string;
863
+ first_name: string;
864
+ last_name?: string;
865
+ }
866
+ export interface ChosenInlineResult {
576
867
  result_id: string;
577
868
  from: User;
578
869
  location?: Location;
579
870
  inline_message_id?: string;
580
871
  query: string;
581
872
  }
873
+ export interface ResponseParameters {
874
+ migrate_to_chat_id?: number;
875
+ retry_after?: number;
876
+ }
877
+ export interface LabeledPrice {
878
+ label: string;
879
+ amount: number;
880
+ }
582
881
  export interface Invoice {
583
882
  title: string;
584
883
  description: string;
@@ -586,7 +885,7 @@ export interface Invoice {
586
885
  currency: string;
587
886
  total_amount: number;
588
887
  }
589
- interface ShippingAddress {
888
+ export interface ShippingAddress {
590
889
  country_code: string;
591
890
  state: string;
592
891
  city: string;
@@ -594,16 +893,21 @@ interface ShippingAddress {
594
893
  street_line2: string;
595
894
  post_code: string;
596
895
  }
597
- interface OrderInfo {
896
+ export interface OrderInfo {
598
897
  name?: string;
599
898
  phone_number?: string;
600
899
  email?: string;
601
900
  shipping_address?: ShippingAddress;
602
901
  }
603
- interface MessageAutoDeleteTimerChanged {
902
+ export interface MessageAutoDeleteTimerChanged {
604
903
  message_auto_delete_time: number;
605
904
  }
606
- interface SuccessfulPayment {
905
+ export interface ShippingOption {
906
+ id: string;
907
+ title: string;
908
+ prices: LabeledPrice[];
909
+ }
910
+ export interface SuccessfulPayment {
607
911
  currency: string;
608
912
  total_amount: number;
609
913
  invoice_payload: string;
@@ -612,13 +916,13 @@ interface SuccessfulPayment {
612
916
  telegram_payment_charge_id: string;
613
917
  provider_payment_charge_id: string;
614
918
  }
615
- interface ShippingQuery {
919
+ export interface ShippingQuery {
616
920
  id: string;
617
921
  from: User;
618
922
  invoice_payload: string;
619
923
  shipping_address: ShippingAddress;
620
924
  }
621
- interface PreCheckoutQuery {
925
+ export interface PreCheckoutQuery {
622
926
  id: string;
623
927
  from: User;
624
928
  currency: string;
@@ -627,7 +931,7 @@ interface PreCheckoutQuery {
627
931
  shipping_option_id?: string;
628
932
  order_info?: OrderInfo;
629
933
  }
630
- interface ChatMemberUpdated {
934
+ export interface ChatMemberUpdated {
631
935
  chat: Chat;
632
936
  from: User;
633
937
  date: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-bot-api-nodejs",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Telegram Bot API client for nodejs",
5
5
  "type": "module",
6
6
  "main": "index.js",