grammy 1.37.1 → 1.38.0

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.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  <!-- deno-fmt-ignore-start -->
12
12
 
13
- [![Bot API](https://img.shields.io/badge/Bot%20API-9.1-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
13
+ [![Bot API](https://img.shields.io/badge/Bot%20API-9.2-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
14
14
  [![Deno](https://shield.deno.dev/x/grammy)](https://deno.land/x/grammy)
15
15
  [![npm](https://img.shields.io/npm/v/grammy?logo=npm&style=flat&labelColor=000&color=3b82f6)](https://www.npmjs.org/package/grammy)
16
16
  [![All Contributors](https://img.shields.io/github/all-contributors/grammyjs/grammy?style=flat&labelColor=000&color=3b82f6)](#contributors-)
package/out/context.d.ts CHANGED
@@ -974,6 +974,24 @@ export declare class Context implements RenamedUpdate {
974
974
  * **Official reference:** https://core.telegram.org/bots/api#declinechatjoinrequest
975
975
  */
976
976
  declineChatJoinRequest(user_id: number, signal?: AbortSignal): Promise<true>;
977
+ /**
978
+ * Context-aware alias for `api.approveSuggestedPost`. 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.
979
+ *
980
+ * @param other Optional remaining parameters, confer the official reference below
981
+ * @param signal Optional `AbortSignal` to cancel the request
982
+ *
983
+ * **Official reference:** https://core.telegram.org/bots/api#approvesuggestedpost
984
+ */
985
+ approveSuggestedPost(other?: Other<"approveSuggestedPost", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
986
+ /**
987
+ * Context-aware alias for `api.declineSuggestedPost`. 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.
988
+ *
989
+ * @param other Optional remaining parameters, confer the official reference below
990
+ * @param signal Optional `AbortSignal` to cancel the request
991
+ *
992
+ * **Official reference:** https://core.telegram.org/bots/api#declinesuggestedpost
993
+ */
994
+ declineSuggestedPost(other?: Other<"declineSuggestedPost", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
977
995
  /**
978
996
  * Context-aware alias for `api.setChatPhoto`. 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.
979
997
  *
@@ -1010,7 +1028,7 @@ export declare class Context implements RenamedUpdate {
1010
1028
  */
1011
1029
  setChatDescription(description: string | undefined, signal?: AbortSignal): Promise<true>;
1012
1030
  /**
1013
- * Context-aware alias for `api.pinChatMessage`. Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1031
+ * Context-aware alias for `api.pinChatMessage`. 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.
1014
1032
  *
1015
1033
  * @param message_id Identifier of a message to pin
1016
1034
  * @param other Optional remaining parameters, confer the official reference below
@@ -1020,7 +1038,7 @@ export declare class Context implements RenamedUpdate {
1020
1038
  */
1021
1039
  pinChatMessage(message_id: number, other?: Other<"pinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
1022
1040
  /**
1023
- * Context-aware alias for `api.unpinChatMessage`. Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1041
+ * Context-aware alias for `api.unpinChatMessage`. 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.
1024
1042
  *
1025
1043
  * @param message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
1026
1044
  * @param other Optional remaining parameters, confer the official reference below
@@ -1030,7 +1048,7 @@ export declare class Context implements RenamedUpdate {
1030
1048
  */
1031
1049
  unpinChatMessage(message_id?: number, other?: Other<"unpinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
1032
1050
  /**
1033
- * Context-aware alias for `api.unpinAllChatMessages`. Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1051
+ * Context-aware alias for `api.unpinAllChatMessages`. 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.
1034
1052
  *
1035
1053
  * @param signal Optional `AbortSignal` to cancel the request
1036
1054
  *
@@ -1307,7 +1325,8 @@ export declare class Context implements RenamedUpdate {
1307
1325
  * - Bots can delete incoming messages in private chats.
1308
1326
  * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
1309
1327
  * - If the bot is an administrator of a group, it can delete any message there.
1310
- * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
1328
+ * - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
1329
+ * - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
1311
1330
  * Returns True on success.
1312
1331
  *
1313
1332
  * @param signal Optional `AbortSignal` to cancel the request
package/out/context.js CHANGED
@@ -666,10 +666,11 @@ class Context {
666
666
  * **Official reference:** https://core.telegram.org/bots/api#sendmessage
667
667
  */
668
668
  reply(text, other, signal) {
669
- var _a;
669
+ var _a, _b, _c;
670
670
  return this.api.sendMessage(orThrow(this.chatId, "sendMessage"), text, {
671
671
  business_connection_id: this.businessConnectionId,
672
672
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
673
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
673
674
  ...other,
674
675
  }, signal);
675
676
  }
@@ -683,8 +684,12 @@ class Context {
683
684
  * **Official reference:** https://core.telegram.org/bots/api#forwardmessage
684
685
  */
685
686
  forwardMessage(chat_id, other, signal) {
686
- var _a;
687
- return this.api.forwardMessage(chat_id, orThrow(this.chatId, "forwardMessage"), orThrow(this.msgId, "forwardMessage"), { message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id, ...other }, signal);
687
+ var _a, _b, _c;
688
+ return this.api.forwardMessage(chat_id, orThrow(this.chatId, "forwardMessage"), orThrow(this.msgId, "forwardMessage"), {
689
+ message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
690
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
691
+ ...other,
692
+ }, signal);
688
693
  }
689
694
  /**
690
695
  * Context-aware alias for `api.forwardMessages`. 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.
@@ -697,8 +702,12 @@ class Context {
697
702
  * **Official reference:** https://core.telegram.org/bots/api#forwardmessages
698
703
  */
699
704
  forwardMessages(chat_id, message_ids, other, signal) {
700
- var _a;
701
- return this.api.forwardMessages(chat_id, orThrow(this.chatId, "forwardMessages"), message_ids, { message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id, ...other }, signal);
705
+ var _a, _b, _c;
706
+ return this.api.forwardMessages(chat_id, orThrow(this.chatId, "forwardMessages"), message_ids, {
707
+ message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
708
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
709
+ ...other,
710
+ }, signal);
702
711
  }
703
712
  /**
704
713
  * Context-aware alias for `api.copyMessage`. 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.
@@ -710,8 +719,12 @@ class Context {
710
719
  * **Official reference:** https://core.telegram.org/bots/api#copymessage
711
720
  */
712
721
  copyMessage(chat_id, other, signal) {
713
- var _a;
714
- return this.api.copyMessage(chat_id, orThrow(this.chatId, "copyMessage"), orThrow(this.msgId, "copyMessage"), { message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id, ...other }, signal);
722
+ var _a, _b, _c;
723
+ return this.api.copyMessage(chat_id, orThrow(this.chatId, "copyMessage"), orThrow(this.msgId, "copyMessage"), {
724
+ message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
725
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
726
+ ...other,
727
+ }, signal);
715
728
  }
716
729
  /**
717
730
  * Context-aware alias for `api.copyMessages`. 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.
@@ -724,8 +737,12 @@ class Context {
724
737
  * **Official reference:** https://core.telegram.org/bots/api#copymessages
725
738
  */
726
739
  copyMessages(chat_id, message_ids, other, signal) {
727
- var _a;
728
- return this.api.copyMessages(chat_id, orThrow(this.chatId, "copyMessages"), message_ids, { message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id, ...other }, signal);
740
+ var _a, _b, _c;
741
+ return this.api.copyMessages(chat_id, orThrow(this.chatId, "copyMessages"), message_ids, {
742
+ message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
743
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
744
+ ...other,
745
+ }, signal);
729
746
  }
730
747
  /**
731
748
  * Context-aware alias for `api.sendPhoto`. Use this method to send photos. On success, the sent Message is returned.
@@ -737,10 +754,11 @@ class Context {
737
754
  * **Official reference:** https://core.telegram.org/bots/api#sendphoto
738
755
  */
739
756
  replyWithPhoto(photo, other, signal) {
740
- var _a;
757
+ var _a, _b, _c;
741
758
  return this.api.sendPhoto(orThrow(this.chatId, "sendPhoto"), photo, {
742
759
  business_connection_id: this.businessConnectionId,
743
760
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
761
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
744
762
  ...other,
745
763
  }, signal);
746
764
  }
@@ -756,10 +774,11 @@ class Context {
756
774
  * **Official reference:** https://core.telegram.org/bots/api#sendaudio
757
775
  */
758
776
  replyWithAudio(audio, other, signal) {
759
- var _a;
777
+ var _a, _b, _c;
760
778
  return this.api.sendAudio(orThrow(this.chatId, "sendAudio"), audio, {
761
779
  business_connection_id: this.businessConnectionId,
762
780
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
781
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
763
782
  ...other,
764
783
  }, signal);
765
784
  }
@@ -773,10 +792,11 @@ class Context {
773
792
  * **Official reference:** https://core.telegram.org/bots/api#senddocument
774
793
  */
775
794
  replyWithDocument(document, other, signal) {
776
- var _a;
795
+ var _a, _b, _c;
777
796
  return this.api.sendDocument(orThrow(this.chatId, "sendDocument"), document, {
778
797
  business_connection_id: this.businessConnectionId,
779
798
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
799
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
780
800
  ...other,
781
801
  }, signal);
782
802
  }
@@ -790,10 +810,11 @@ class Context {
790
810
  * **Official reference:** https://core.telegram.org/bots/api#sendvideo
791
811
  */
792
812
  replyWithVideo(video, other, signal) {
793
- var _a;
813
+ var _a, _b, _c;
794
814
  return this.api.sendVideo(orThrow(this.chatId, "sendVideo"), video, {
795
815
  business_connection_id: this.businessConnectionId,
796
816
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
817
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
797
818
  ...other,
798
819
  }, signal);
799
820
  }
@@ -807,10 +828,11 @@ class Context {
807
828
  * **Official reference:** https://core.telegram.org/bots/api#sendanimation
808
829
  */
809
830
  replyWithAnimation(animation, other, signal) {
810
- var _a;
831
+ var _a, _b, _c;
811
832
  return this.api.sendAnimation(orThrow(this.chatId, "sendAnimation"), animation, {
812
833
  business_connection_id: this.businessConnectionId,
813
834
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
835
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
814
836
  ...other,
815
837
  }, signal);
816
838
  }
@@ -824,10 +846,11 @@ class Context {
824
846
  * **Official reference:** https://core.telegram.org/bots/api#sendvoice
825
847
  */
826
848
  replyWithVoice(voice, other, signal) {
827
- var _a;
849
+ var _a, _b, _c;
828
850
  return this.api.sendVoice(orThrow(this.chatId, "sendVoice"), voice, {
829
851
  business_connection_id: this.businessConnectionId,
830
852
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
853
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
831
854
  ...other,
832
855
  }, signal);
833
856
  }
@@ -842,10 +865,11 @@ class Context {
842
865
  * **Official reference:** https://core.telegram.org/bots/api#sendvideonote
843
866
  */
844
867
  replyWithVideoNote(video_note, other, signal) {
845
- var _a;
868
+ var _a, _b, _c;
846
869
  return this.api.sendVideoNote(orThrow(this.chatId, "sendVideoNote"), video_note, {
847
870
  business_connection_id: this.businessConnectionId,
848
871
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
872
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
849
873
  ...other,
850
874
  }, signal);
851
875
  }
@@ -859,10 +883,11 @@ class Context {
859
883
  * **Official reference:** https://core.telegram.org/bots/api#sendmediagroup
860
884
  */
861
885
  replyWithMediaGroup(media, other, signal) {
862
- var _a;
886
+ var _a, _b, _c;
863
887
  return this.api.sendMediaGroup(orThrow(this.chatId, "sendMediaGroup"), media, {
864
888
  business_connection_id: this.businessConnectionId,
865
889
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
890
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
866
891
  ...other,
867
892
  }, signal);
868
893
  }
@@ -877,10 +902,11 @@ class Context {
877
902
  * **Official reference:** https://core.telegram.org/bots/api#sendlocation
878
903
  */
879
904
  replyWithLocation(latitude, longitude, other, signal) {
880
- var _a;
905
+ var _a, _b, _c;
881
906
  return this.api.sendLocation(orThrow(this.chatId, "sendLocation"), latitude, longitude, {
882
907
  business_connection_id: this.businessConnectionId,
883
908
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
909
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
884
910
  ...other,
885
911
  }, signal);
886
912
  }
@@ -925,7 +951,12 @@ class Context {
925
951
  * **Official reference:** https://core.telegram.org/bots/api#sendpaidmedia
926
952
  */
927
953
  sendPaidMedia(star_count, media, other, signal) {
928
- return this.api.sendPaidMedia(orThrow(this.chatId, "sendPaidMedia"), star_count, media, { business_connection_id: this.businessConnectionId, ...other }, signal);
954
+ var _a, _b;
955
+ return this.api.sendPaidMedia(orThrow(this.chatId, "sendPaidMedia"), star_count, media, {
956
+ business_connection_id: this.businessConnectionId,
957
+ direct_messages_topic_id: (_b = (_a = this.msg) === null || _a === void 0 ? void 0 : _a.direct_messages_topic) === null || _b === void 0 ? void 0 : _b.topic_id,
958
+ ...other,
959
+ }, signal);
929
960
  }
930
961
  /**
931
962
  * Context-aware alias for `api.sendVenue`. Use this method to send information about a venue. On success, the sent Message is returned.
@@ -940,10 +971,11 @@ class Context {
940
971
  * **Official reference:** https://core.telegram.org/bots/api#sendvenue
941
972
  */
942
973
  replyWithVenue(latitude, longitude, title, address, other, signal) {
943
- var _a;
974
+ var _a, _b, _c;
944
975
  return this.api.sendVenue(orThrow(this.chatId, "sendVenue"), latitude, longitude, title, address, {
945
976
  business_connection_id: this.businessConnectionId,
946
977
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
978
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
947
979
  ...other,
948
980
  }, signal);
949
981
  }
@@ -958,10 +990,11 @@ class Context {
958
990
  * **Official reference:** https://core.telegram.org/bots/api#sendcontact
959
991
  */
960
992
  replyWithContact(phone_number, first_name, other, signal) {
961
- var _a;
993
+ var _a, _b, _c;
962
994
  return this.api.sendContact(orThrow(this.chatId, "sendContact"), phone_number, first_name, {
963
995
  business_connection_id: this.businessConnectionId,
964
996
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
997
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
965
998
  ...other,
966
999
  }, signal);
967
1000
  }
@@ -1020,10 +1053,11 @@ class Context {
1020
1053
  * **Official reference:** https://core.telegram.org/bots/api#senddice
1021
1054
  */
1022
1055
  replyWithDice(emoji, other, signal) {
1023
- var _a;
1056
+ var _a, _b, _c;
1024
1057
  return this.api.sendDice(orThrow(this.chatId, "sendDice"), emoji, {
1025
1058
  business_connection_id: this.businessConnectionId,
1026
1059
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
1060
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
1027
1061
  ...other,
1028
1062
  }, signal);
1029
1063
  }
@@ -1366,6 +1400,28 @@ class Context {
1366
1400
  declineChatJoinRequest(user_id, signal) {
1367
1401
  return this.api.declineChatJoinRequest(orThrow(this.chatId, "declineChatJoinRequest"), user_id, signal);
1368
1402
  }
1403
+ /**
1404
+ * Context-aware alias for `api.approveSuggestedPost`. 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.
1405
+ *
1406
+ * @param other Optional remaining parameters, confer the official reference below
1407
+ * @param signal Optional `AbortSignal` to cancel the request
1408
+ *
1409
+ * **Official reference:** https://core.telegram.org/bots/api#approvesuggestedpost
1410
+ */
1411
+ approveSuggestedPost(other, signal) {
1412
+ return this.api.approveSuggestedPost(orThrow(this.chatId, "approveSuggestedPost"), orThrow(this.msgId, "approveSuggestedPost"), other, signal);
1413
+ }
1414
+ /**
1415
+ * Context-aware alias for `api.declineSuggestedPost`. 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.
1416
+ *
1417
+ * @param other Optional remaining parameters, confer the official reference below
1418
+ * @param signal Optional `AbortSignal` to cancel the request
1419
+ *
1420
+ * **Official reference:** https://core.telegram.org/bots/api#declinesuggestedpost
1421
+ */
1422
+ declineSuggestedPost(other, signal) {
1423
+ return this.api.declineSuggestedPost(orThrow(this.chatId, "declineSuggestedPost"), orThrow(this.msgId, "declineSuggestedPost"), other, signal);
1424
+ }
1369
1425
  /**
1370
1426
  * Context-aware alias for `api.setChatPhoto`. 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.
1371
1427
  *
@@ -1410,7 +1466,7 @@ class Context {
1410
1466
  return this.api.setChatDescription(orThrow(this.chatId, "setChatDescription"), description, signal);
1411
1467
  }
1412
1468
  /**
1413
- * Context-aware alias for `api.pinChatMessage`. Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1469
+ * Context-aware alias for `api.pinChatMessage`. 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.
1414
1470
  *
1415
1471
  * @param message_id Identifier of a message to pin
1416
1472
  * @param other Optional remaining parameters, confer the official reference below
@@ -1422,7 +1478,7 @@ class Context {
1422
1478
  return this.api.pinChatMessage(orThrow(this.chatId, "pinChatMessage"), message_id, { business_connection_id: this.businessConnectionId, ...other }, signal);
1423
1479
  }
1424
1480
  /**
1425
- * Context-aware alias for `api.unpinChatMessage`. Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1481
+ * Context-aware alias for `api.unpinChatMessage`. 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.
1426
1482
  *
1427
1483
  * @param message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
1428
1484
  * @param other Optional remaining parameters, confer the official reference below
@@ -1434,7 +1490,7 @@ class Context {
1434
1490
  return this.api.unpinChatMessage(orThrow(this.chatId, "unpinChatMessage"), message_id, { business_connection_id: this.businessConnectionId, ...other }, signal);
1435
1491
  }
1436
1492
  /**
1437
- * Context-aware alias for `api.unpinAllChatMessages`. Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
1493
+ * Context-aware alias for `api.unpinAllChatMessages`. 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.
1438
1494
  *
1439
1495
  * @param signal Optional `AbortSignal` to cancel the request
1440
1496
  *
@@ -1800,7 +1856,8 @@ class Context {
1800
1856
  * - Bots can delete incoming messages in private chats.
1801
1857
  * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
1802
1858
  * - If the bot is an administrator of a group, it can delete any message there.
1803
- * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
1859
+ * - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
1860
+ * - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
1804
1861
  * Returns True on success.
1805
1862
  *
1806
1863
  * @param signal Optional `AbortSignal` to cancel the request
@@ -2018,10 +2075,11 @@ class Context {
2018
2075
  * **Official reference:** https://core.telegram.org/bots/api#sendsticker
2019
2076
  */
2020
2077
  replyWithSticker(sticker, other, signal) {
2021
- var _a;
2078
+ var _a, _b, _c;
2022
2079
  return this.api.sendSticker(orThrow(this.chatId, "sendSticker"), sticker, {
2023
2080
  business_connection_id: this.businessConnectionId,
2024
2081
  message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
2082
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
2025
2083
  ...other,
2026
2084
  }, signal);
2027
2085
  }
@@ -2117,8 +2175,12 @@ class Context {
2117
2175
  * **Official reference:** https://core.telegram.org/bots/api#sendinvoice
2118
2176
  */
2119
2177
  replyWithInvoice(title, description, payload, currency, prices, other, signal) {
2120
- var _a;
2121
- return this.api.sendInvoice(orThrow(this.chatId, "sendInvoice"), title, description, payload, currency, prices, { message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id, ...other }, signal);
2178
+ var _a, _b, _c;
2179
+ return this.api.sendInvoice(orThrow(this.chatId, "sendInvoice"), title, description, payload, currency, prices, {
2180
+ message_thread_id: (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_thread_id,
2181
+ direct_messages_topic_id: (_c = (_b = this.msg) === null || _b === void 0 ? void 0 : _b.direct_messages_topic) === null || _c === void 0 ? void 0 : _c.topic_id,
2182
+ ...other,
2183
+ }, signal);
2122
2184
  }
2123
2185
  /**
2124
2186
  * Context-aware alias for `api.answerShippingQuery`. 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.
package/out/core/api.d.ts CHANGED
@@ -464,7 +464,7 @@ export declare class Api<R extends RawApi = RawApi> {
464
464
  *
465
465
  * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
466
466
  *
467
- * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
467
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported.
468
468
  * @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
469
469
  * @param other Optional remaining parameters, confer the official reference below
470
470
  * @param signal Optional `AbortSignal` to cancel the request
@@ -696,6 +696,28 @@ export declare class Api<R extends RawApi = RawApi> {
696
696
  * **Official reference:** https://core.telegram.org/bots/api#declinechatjoinrequest
697
697
  */
698
698
  declineChatJoinRequest(chat_id: number | string, user_id: number, signal?: AbortSignal): Promise<true>;
699
+ /**
700
+ * 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.
701
+ *
702
+ * @param chat_id Unique identifier for the target direct messages chat
703
+ * @param message_id Identifier of a suggested post message to approve
704
+ * @param other Optional remaining parameters, confer the official reference below
705
+ * @param signal Optional `AbortSignal` to cancel the request
706
+ *
707
+ * **Official reference:** https://core.telegram.org/bots/api#approvesuggestedpost
708
+ */
709
+ approveSuggestedPost(chat_id: number, message_id: number, other?: Other<R, "approveSuggestedPost", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
710
+ /**
711
+ * 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.
712
+ *
713
+ * @param chat_id Unique identifier for the target direct messages chat
714
+ * @param message_id Identifier of a suggested post message to decline
715
+ * @param other Optional remaining parameters, confer the official reference below
716
+ * @param signal Optional `AbortSignal` to cancel the request
717
+ *
718
+ * **Official reference:** https://core.telegram.org/bots/api#declinesuggestedpost
719
+ */
720
+ declineSuggestedPost(chat_id: number, message_id: number, other?: Other<R, "declineSuggestedPost", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
699
721
  /**
700
722
  * 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.
701
723
  *
@@ -736,7 +758,7 @@ export declare class Api<R extends RawApi = RawApi> {
736
758
  */
737
759
  setChatDescription(chat_id: number | string, description?: string, signal?: AbortSignal): Promise<true>;
738
760
  /**
739
- * Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
761
+ * 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.
740
762
  *
741
763
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
742
764
  * @param message_id Identifier of a message to pin
@@ -747,7 +769,7 @@ export declare class Api<R extends RawApi = RawApi> {
747
769
  */
748
770
  pinChatMessage(chat_id: number | string, message_id: number, other?: Other<R, "pinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
749
771
  /**
750
- * Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
772
+ * 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.
751
773
  *
752
774
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
753
775
  * @param message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
@@ -758,7 +780,7 @@ export declare class Api<R extends RawApi = RawApi> {
758
780
  */
759
781
  unpinChatMessage(chat_id: number | string, message_id?: number, other?: Other<R, "unpinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
760
782
  /**
761
- * Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
783
+ * 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.
762
784
  *
763
785
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
764
786
  * @param signal Optional `AbortSignal` to cancel the request
@@ -769,7 +791,7 @@ export declare class Api<R extends RawApi = RawApi> {
769
791
  /**
770
792
  * Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
771
793
  *
772
- * @param chat_id Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
794
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername). Channel direct messages chats aren't supported; leave the corresponding channel instead.
773
795
  * @param signal Optional `AbortSignal` to cancel the request
774
796
  *
775
797
  * **Official reference:** https://core.telegram.org/bots/api#leavechat
@@ -1209,7 +1231,8 @@ export declare class Api<R extends RawApi = RawApi> {
1209
1231
  * - Bots can delete incoming messages in private chats.
1210
1232
  * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
1211
1233
  * - If the bot is an administrator of a group, it can delete any message there.
1212
- * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
1234
+ * - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
1235
+ * - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
1213
1236
  * Returns True on success.
1214
1237
  *
1215
1238
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
@@ -1736,7 +1759,7 @@ export declare class Api<R extends RawApi = RawApi> {
1736
1759
  /**
1737
1760
  * Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
1738
1761
  *
1739
- * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1762
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified.
1740
1763
  * @param other Optional remaining parameters, confer the official reference below
1741
1764
  * @param signal Optional `AbortSignal` to cancel the request
1742
1765
  *
@@ -1787,7 +1810,7 @@ export declare class Api<R extends RawApi = RawApi> {
1787
1810
  /**
1788
1811
  * Use this method to send a game. On success, the sent Message is returned.
1789
1812
  *
1790
- * @param chat_id Unique identifier for the target chat
1813
+ * @param chat_id Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats.
1791
1814
  * @param game_short_name Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather.
1792
1815
  * @param other Optional remaining parameters, confer the official reference below
1793
1816
  * @param signal Optional `AbortSignal` to cancel the request
package/out/core/api.js CHANGED
@@ -518,7 +518,7 @@ class Api {
518
518
  *
519
519
  * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
520
520
  *
521
- * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
521
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported.
522
522
  * @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
523
523
  * @param other Optional remaining parameters, confer the official reference below
524
524
  * @param signal Optional `AbortSignal` to cancel the request
@@ -796,6 +796,32 @@ class Api {
796
796
  declineChatJoinRequest(chat_id, user_id, signal) {
797
797
  return this.raw.declineChatJoinRequest({ chat_id, user_id }, signal);
798
798
  }
799
+ /**
800
+ * 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.
801
+ *
802
+ * @param chat_id Unique identifier for the target direct messages chat
803
+ * @param message_id Identifier of a suggested post message to approve
804
+ * @param other Optional remaining parameters, confer the official reference below
805
+ * @param signal Optional `AbortSignal` to cancel the request
806
+ *
807
+ * **Official reference:** https://core.telegram.org/bots/api#approvesuggestedpost
808
+ */
809
+ approveSuggestedPost(chat_id, message_id, other, signal) {
810
+ return this.raw.approveSuggestedPost({ chat_id, message_id, ...other }, signal);
811
+ }
812
+ /**
813
+ * 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.
814
+ *
815
+ * @param chat_id Unique identifier for the target direct messages chat
816
+ * @param message_id Identifier of a suggested post message to decline
817
+ * @param other Optional remaining parameters, confer the official reference below
818
+ * @param signal Optional `AbortSignal` to cancel the request
819
+ *
820
+ * **Official reference:** https://core.telegram.org/bots/api#declinesuggestedpost
821
+ */
822
+ declineSuggestedPost(chat_id, message_id, other, signal) {
823
+ return this.raw.declineSuggestedPost({ chat_id, message_id, ...other }, signal);
824
+ }
799
825
  /**
800
826
  * 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.
801
827
  *
@@ -844,7 +870,7 @@ class Api {
844
870
  return this.raw.setChatDescription({ chat_id, description }, signal);
845
871
  }
846
872
  /**
847
- * Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
873
+ * 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.
848
874
  *
849
875
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
850
876
  * @param message_id Identifier of a message to pin
@@ -857,7 +883,7 @@ class Api {
857
883
  return this.raw.pinChatMessage({ chat_id, message_id, ...other }, signal);
858
884
  }
859
885
  /**
860
- * Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
886
+ * 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.
861
887
  *
862
888
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
863
889
  * @param message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
@@ -870,7 +896,7 @@ class Api {
870
896
  return this.raw.unpinChatMessage({ chat_id, message_id, ...other }, signal);
871
897
  }
872
898
  /**
873
- * Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
899
+ * 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.
874
900
  *
875
901
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
876
902
  * @param signal Optional `AbortSignal` to cancel the request
@@ -883,7 +909,7 @@ class Api {
883
909
  /**
884
910
  * Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
885
911
  *
886
- * @param chat_id Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
912
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername). Channel direct messages chats aren't supported; leave the corresponding channel instead.
887
913
  * @param signal Optional `AbortSignal` to cancel the request
888
914
  *
889
915
  * **Official reference:** https://core.telegram.org/bots/api#leavechat
@@ -1409,7 +1435,8 @@ class Api {
1409
1435
  * - Bots can delete incoming messages in private chats.
1410
1436
  * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
1411
1437
  * - If the bot is an administrator of a group, it can delete any message there.
1412
- * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
1438
+ * - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
1439
+ * - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
1413
1440
  * Returns True on success.
1414
1441
  *
1415
1442
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
@@ -2058,7 +2085,7 @@ class Api {
2058
2085
  /**
2059
2086
  * Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
2060
2087
  *
2061
- * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2088
+ * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified.
2062
2089
  * @param other Optional remaining parameters, confer the official reference below
2063
2090
  * @param signal Optional `AbortSignal` to cancel the request
2064
2091
  *
@@ -2119,7 +2146,7 @@ class Api {
2119
2146
  /**
2120
2147
  * Use this method to send a game. On success, the sent Message is returned.
2121
2148
  *
2122
- * @param chat_id Unique identifier for the target chat
2149
+ * @param chat_id Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats.
2123
2150
  * @param game_short_name Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather.
2124
2151
  * @param other Optional remaining parameters, confer the official reference below
2125
2152
  * @param signal Optional `AbortSignal` to cancel the request
package/out/filter.d.ts CHANGED
@@ -29,6 +29,7 @@ export declare function parse(filter: FilterQuery | FilterQuery[]): string[][];
29
29
  export declare function preprocess(filter: string[]): string[][];
30
30
  declare const UPDATE_KEYS: {
31
31
  readonly message: {
32
+ readonly direct_messages_topic: {};
32
33
  readonly new_chat_members: {
33
34
  readonly me: {};
34
35
  readonly is_bot: {};
@@ -68,6 +69,12 @@ declare const UPDATE_KEYS: {
68
69
  };
69
70
  readonly checklist_tasks_done: {};
70
71
  readonly checklist_tasks_added: {};
72
+ readonly suggested_post_info: {};
73
+ readonly suggested_post_approved: {};
74
+ readonly suggested_post_approval_failed: {};
75
+ readonly suggested_post_declined: {};
76
+ readonly suggested_post_paid: {};
77
+ readonly suggested_post_refunded: {};
71
78
  readonly sender_boost_count: {};
72
79
  readonly forward_origin: {
73
80
  readonly user: {};
@@ -179,6 +186,7 @@ declare const UPDATE_KEYS: {
179
186
  readonly web_app_data: {};
180
187
  };
181
188
  readonly edited_message: {
189
+ readonly direct_messages_topic: {};
182
190
  readonly new_chat_members: {
183
191
  readonly me: {};
184
192
  readonly is_bot: {};
@@ -218,6 +226,12 @@ declare const UPDATE_KEYS: {
218
226
  };
219
227
  readonly checklist_tasks_done: {};
220
228
  readonly checklist_tasks_added: {};
229
+ readonly suggested_post_info: {};
230
+ readonly suggested_post_approved: {};
231
+ readonly suggested_post_approval_failed: {};
232
+ readonly suggested_post_declined: {};
233
+ readonly suggested_post_paid: {};
234
+ readonly suggested_post_refunded: {};
221
235
  readonly sender_boost_count: {};
222
236
  readonly forward_origin: {
223
237
  readonly user: {};
@@ -331,6 +345,7 @@ declare const UPDATE_KEYS: {
331
345
  readonly channel_post: {
332
346
  readonly channel_chat_created: {};
333
347
  readonly direct_message_price_changed: {};
348
+ readonly is_paid_post: {};
334
349
  readonly forward_origin: {
335
350
  readonly user: {};
336
351
  readonly hidden_user: {};
@@ -443,6 +458,7 @@ declare const UPDATE_KEYS: {
443
458
  readonly edited_channel_post: {
444
459
  readonly channel_chat_created: {};
445
460
  readonly direct_message_price_changed: {};
461
+ readonly is_paid_post: {};
446
462
  readonly forward_origin: {
447
463
  readonly user: {};
448
464
  readonly hidden_user: {};
@@ -557,6 +573,7 @@ declare const UPDATE_KEYS: {
557
573
  readonly is_enabled: {};
558
574
  };
559
575
  readonly business_message: {
576
+ readonly direct_messages_topic: {};
560
577
  readonly new_chat_members: {
561
578
  readonly me: {};
562
579
  readonly is_bot: {};
@@ -596,6 +613,12 @@ declare const UPDATE_KEYS: {
596
613
  };
597
614
  readonly checklist_tasks_done: {};
598
615
  readonly checklist_tasks_added: {};
616
+ readonly suggested_post_info: {};
617
+ readonly suggested_post_approved: {};
618
+ readonly suggested_post_approval_failed: {};
619
+ readonly suggested_post_declined: {};
620
+ readonly suggested_post_paid: {};
621
+ readonly suggested_post_refunded: {};
599
622
  readonly sender_boost_count: {};
600
623
  readonly forward_origin: {
601
624
  readonly user: {};
@@ -707,6 +730,7 @@ declare const UPDATE_KEYS: {
707
730
  readonly web_app_data: {};
708
731
  };
709
732
  readonly edited_business_message: {
733
+ readonly direct_messages_topic: {};
710
734
  readonly new_chat_members: {
711
735
  readonly me: {};
712
736
  readonly is_bot: {};
@@ -746,6 +770,12 @@ declare const UPDATE_KEYS: {
746
770
  };
747
771
  readonly checklist_tasks_done: {};
748
772
  readonly checklist_tasks_added: {};
773
+ readonly suggested_post_info: {};
774
+ readonly suggested_post_approved: {};
775
+ readonly suggested_post_approval_failed: {};
776
+ readonly suggested_post_declined: {};
777
+ readonly suggested_post_paid: {};
778
+ readonly suggested_post_refunded: {};
749
779
  readonly sender_boost_count: {};
750
780
  readonly forward_origin: {
751
781
  readonly user: {};
package/out/filter.js CHANGED
@@ -301,6 +301,7 @@ const COMMON_MESSAGE_KEYS = {
301
301
  };
302
302
  const MESSAGE_KEYS = {
303
303
  ...COMMON_MESSAGE_KEYS,
304
+ direct_messages_topic: {},
304
305
  new_chat_members: USER_KEYS,
305
306
  left_chat_member: USER_KEYS,
306
307
  group_chat_created: {},
@@ -324,12 +325,19 @@ const MESSAGE_KEYS = {
324
325
  checklist: { others_can_add_tasks: {}, others_can_mark_tasks_as_done: {} },
325
326
  checklist_tasks_done: {},
326
327
  checklist_tasks_added: {},
328
+ suggested_post_info: {},
329
+ suggested_post_approved: {},
330
+ suggested_post_approval_failed: {},
331
+ suggested_post_declined: {},
332
+ suggested_post_paid: {},
333
+ suggested_post_refunded: {},
327
334
  sender_boost_count: {},
328
335
  };
329
336
  const CHANNEL_POST_KEYS = {
330
337
  ...COMMON_MESSAGE_KEYS,
331
338
  channel_chat_created: {},
332
339
  direct_message_price_changed: {},
340
+ is_paid_post: {},
333
341
  };
334
342
  const BUSINESS_CONNECTION_KEYS = {
335
343
  can_reply: {},
package/out/web.mjs CHANGED
@@ -253,6 +253,7 @@ const COMMON_MESSAGE_KEYS = {
253
253
  };
254
254
  const MESSAGE_KEYS = {
255
255
  ...COMMON_MESSAGE_KEYS,
256
+ direct_messages_topic: {},
256
257
  new_chat_members: USER_KEYS,
257
258
  left_chat_member: USER_KEYS,
258
259
  group_chat_created: {},
@@ -282,12 +283,19 @@ const MESSAGE_KEYS = {
282
283
  },
283
284
  checklist_tasks_done: {},
284
285
  checklist_tasks_added: {},
286
+ suggested_post_info: {},
287
+ suggested_post_approved: {},
288
+ suggested_post_approval_failed: {},
289
+ suggested_post_declined: {},
290
+ suggested_post_paid: {},
291
+ suggested_post_refunded: {},
285
292
  sender_boost_count: {}
286
293
  };
287
294
  const CHANNEL_POST_KEYS = {
288
295
  ...COMMON_MESSAGE_KEYS,
289
296
  channel_chat_created: {},
290
- direct_message_price_changed: {}
297
+ direct_message_price_changed: {},
298
+ is_paid_post: {}
291
299
  };
292
300
  const BUSINESS_CONNECTION_KEYS = {
293
301
  can_reply: {},
@@ -747,30 +755,35 @@ class Context {
747
755
  return this.api.sendMessage(orThrow(this.chatId, "sendMessage"), text, {
748
756
  business_connection_id: this.businessConnectionId,
749
757
  message_thread_id: this.msg?.message_thread_id,
758
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
750
759
  ...other
751
760
  }, signal);
752
761
  }
753
762
  forwardMessage(chat_id, other, signal) {
754
763
  return this.api.forwardMessage(chat_id, orThrow(this.chatId, "forwardMessage"), orThrow(this.msgId, "forwardMessage"), {
755
764
  message_thread_id: this.msg?.message_thread_id,
765
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
756
766
  ...other
757
767
  }, signal);
758
768
  }
759
769
  forwardMessages(chat_id, message_ids, other, signal) {
760
770
  return this.api.forwardMessages(chat_id, orThrow(this.chatId, "forwardMessages"), message_ids, {
761
771
  message_thread_id: this.msg?.message_thread_id,
772
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
762
773
  ...other
763
774
  }, signal);
764
775
  }
765
776
  copyMessage(chat_id, other, signal) {
766
777
  return this.api.copyMessage(chat_id, orThrow(this.chatId, "copyMessage"), orThrow(this.msgId, "copyMessage"), {
767
778
  message_thread_id: this.msg?.message_thread_id,
779
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
768
780
  ...other
769
781
  }, signal);
770
782
  }
771
783
  copyMessages(chat_id, message_ids, other, signal) {
772
784
  return this.api.copyMessages(chat_id, orThrow(this.chatId, "copyMessages"), message_ids, {
773
785
  message_thread_id: this.msg?.message_thread_id,
786
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
774
787
  ...other
775
788
  }, signal);
776
789
  }
@@ -778,6 +791,7 @@ class Context {
778
791
  return this.api.sendPhoto(orThrow(this.chatId, "sendPhoto"), photo, {
779
792
  business_connection_id: this.businessConnectionId,
780
793
  message_thread_id: this.msg?.message_thread_id,
794
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
781
795
  ...other
782
796
  }, signal);
783
797
  }
@@ -785,6 +799,7 @@ class Context {
785
799
  return this.api.sendAudio(orThrow(this.chatId, "sendAudio"), audio, {
786
800
  business_connection_id: this.businessConnectionId,
787
801
  message_thread_id: this.msg?.message_thread_id,
802
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
788
803
  ...other
789
804
  }, signal);
790
805
  }
@@ -792,6 +807,7 @@ class Context {
792
807
  return this.api.sendDocument(orThrow(this.chatId, "sendDocument"), document1, {
793
808
  business_connection_id: this.businessConnectionId,
794
809
  message_thread_id: this.msg?.message_thread_id,
810
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
795
811
  ...other
796
812
  }, signal);
797
813
  }
@@ -799,6 +815,7 @@ class Context {
799
815
  return this.api.sendVideo(orThrow(this.chatId, "sendVideo"), video, {
800
816
  business_connection_id: this.businessConnectionId,
801
817
  message_thread_id: this.msg?.message_thread_id,
818
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
802
819
  ...other
803
820
  }, signal);
804
821
  }
@@ -806,6 +823,7 @@ class Context {
806
823
  return this.api.sendAnimation(orThrow(this.chatId, "sendAnimation"), animation, {
807
824
  business_connection_id: this.businessConnectionId,
808
825
  message_thread_id: this.msg?.message_thread_id,
826
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
809
827
  ...other
810
828
  }, signal);
811
829
  }
@@ -813,6 +831,7 @@ class Context {
813
831
  return this.api.sendVoice(orThrow(this.chatId, "sendVoice"), voice, {
814
832
  business_connection_id: this.businessConnectionId,
815
833
  message_thread_id: this.msg?.message_thread_id,
834
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
816
835
  ...other
817
836
  }, signal);
818
837
  }
@@ -820,6 +839,7 @@ class Context {
820
839
  return this.api.sendVideoNote(orThrow(this.chatId, "sendVideoNote"), video_note, {
821
840
  business_connection_id: this.businessConnectionId,
822
841
  message_thread_id: this.msg?.message_thread_id,
842
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
823
843
  ...other
824
844
  }, signal);
825
845
  }
@@ -827,6 +847,7 @@ class Context {
827
847
  return this.api.sendMediaGroup(orThrow(this.chatId, "sendMediaGroup"), media, {
828
848
  business_connection_id: this.businessConnectionId,
829
849
  message_thread_id: this.msg?.message_thread_id,
850
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
830
851
  ...other
831
852
  }, signal);
832
853
  }
@@ -834,6 +855,7 @@ class Context {
834
855
  return this.api.sendLocation(orThrow(this.chatId, "sendLocation"), latitude, longitude, {
835
856
  business_connection_id: this.businessConnectionId,
836
857
  message_thread_id: this.msg?.message_thread_id,
858
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
837
859
  ...other
838
860
  }, signal);
839
861
  }
@@ -860,6 +882,7 @@ class Context {
860
882
  sendPaidMedia(star_count, media, other, signal) {
861
883
  return this.api.sendPaidMedia(orThrow(this.chatId, "sendPaidMedia"), star_count, media, {
862
884
  business_connection_id: this.businessConnectionId,
885
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
863
886
  ...other
864
887
  }, signal);
865
888
  }
@@ -867,6 +890,7 @@ class Context {
867
890
  return this.api.sendVenue(orThrow(this.chatId, "sendVenue"), latitude, longitude, title, address, {
868
891
  business_connection_id: this.businessConnectionId,
869
892
  message_thread_id: this.msg?.message_thread_id,
893
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
870
894
  ...other
871
895
  }, signal);
872
896
  }
@@ -874,6 +898,7 @@ class Context {
874
898
  return this.api.sendContact(orThrow(this.chatId, "sendContact"), phone_number, first_name, {
875
899
  business_connection_id: this.businessConnectionId,
876
900
  message_thread_id: this.msg?.message_thread_id,
901
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
877
902
  ...other
878
903
  }, signal);
879
904
  }
@@ -896,6 +921,7 @@ class Context {
896
921
  return this.api.sendDice(orThrow(this.chatId, "sendDice"), emoji, {
897
922
  business_connection_id: this.businessConnectionId,
898
923
  message_thread_id: this.msg?.message_thread_id,
924
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
899
925
  ...other
900
926
  }, signal);
901
927
  }
@@ -1002,6 +1028,12 @@ class Context {
1002
1028
  declineChatJoinRequest(user_id, signal) {
1003
1029
  return this.api.declineChatJoinRequest(orThrow(this.chatId, "declineChatJoinRequest"), user_id, signal);
1004
1030
  }
1031
+ approveSuggestedPost(other, signal) {
1032
+ return this.api.approveSuggestedPost(orThrow(this.chatId, "approveSuggestedPost"), orThrow(this.msgId, "approveSuggestedPost"), other, signal);
1033
+ }
1034
+ declineSuggestedPost(other, signal) {
1035
+ return this.api.declineSuggestedPost(orThrow(this.chatId, "declineSuggestedPost"), orThrow(this.msgId, "declineSuggestedPost"), other, signal);
1036
+ }
1005
1037
  setChatPhoto(photo, signal) {
1006
1038
  return this.api.setChatPhoto(orThrow(this.chatId, "setChatPhoto"), photo, signal);
1007
1039
  }
@@ -1223,6 +1255,7 @@ class Context {
1223
1255
  return this.api.sendSticker(orThrow(this.chatId, "sendSticker"), sticker, {
1224
1256
  business_connection_id: this.businessConnectionId,
1225
1257
  message_thread_id: this.msg?.message_thread_id,
1258
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
1226
1259
  ...other
1227
1260
  }, signal);
1228
1261
  }
@@ -1247,6 +1280,7 @@ class Context {
1247
1280
  replyWithInvoice(title, description, payload, currency, prices, other, signal) {
1248
1281
  return this.api.sendInvoice(orThrow(this.chatId, "sendInvoice"), title, description, payload, currency, prices, {
1249
1282
  message_thread_id: this.msg?.message_thread_id,
1283
+ direct_messages_topic_id: this.msg?.direct_messages_topic?.topic_id,
1250
1284
  ...other
1251
1285
  }, signal);
1252
1286
  }
@@ -2990,6 +3024,20 @@ class Api {
2990
3024
  user_id
2991
3025
  }, signal);
2992
3026
  }
3027
+ approveSuggestedPost(chat_id, message_id, other, signal) {
3028
+ return this.raw.approveSuggestedPost({
3029
+ chat_id,
3030
+ message_id,
3031
+ ...other
3032
+ }, signal);
3033
+ }
3034
+ declineSuggestedPost(chat_id, message_id, other, signal) {
3035
+ return this.raw.declineSuggestedPost({
3036
+ chat_id,
3037
+ message_id,
3038
+ ...other
3039
+ }, signal);
3040
+ }
2993
3041
  setChatPhoto(chat_id, photo, signal) {
2994
3042
  return this.raw.setChatPhoto({
2995
3043
  chat_id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "grammy",
3
3
  "description": "The Telegram Bot Framework.",
4
- "version": "1.37.1",
4
+ "version": "1.38.0",
5
5
  "author": "KnorpelSenf",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -17,7 +17,7 @@
17
17
  "backport": "deno2node tsconfig.json"
18
18
  },
19
19
  "dependencies": {
20
- "@grammyjs/types": "3.21.0",
20
+ "@grammyjs/types": "3.22.1",
21
21
  "abort-controller": "^3.0.0",
22
22
  "debug": "^4.3.4",
23
23
  "node-fetch": "^2.7.0"