@yaebal/contexts 0.0.3 → 0.0.5

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 (122) hide show
  1. package/lib/generated/business-connection.d.ts +48 -0
  2. package/lib/generated/business-connection.d.ts.map +1 -1
  3. package/lib/generated/business-connection.js +96 -0
  4. package/lib/generated/business-connection.js.map +1 -1
  5. package/lib/generated/business-message.d.ts +83 -41
  6. package/lib/generated/business-message.d.ts.map +1 -1
  7. package/lib/generated/business-message.js +125 -41
  8. package/lib/generated/business-message.js.map +1 -1
  9. package/lib/generated/callback-query.d.ts +40 -40
  10. package/lib/generated/callback-query.d.ts.map +1 -1
  11. package/lib/generated/callback-query.js +40 -40
  12. package/lib/generated/callback-query.js.map +1 -1
  13. package/lib/generated/channel-post.d.ts +33 -35
  14. package/lib/generated/channel-post.d.ts.map +1 -1
  15. package/lib/generated/channel-post.js +37 -41
  16. package/lib/generated/channel-post.js.map +1 -1
  17. package/lib/generated/chat-boost.d.ts +0 -12
  18. package/lib/generated/chat-boost.d.ts.map +1 -1
  19. package/lib/generated/chat-boost.js +0 -24
  20. package/lib/generated/chat-boost.js.map +1 -1
  21. package/lib/generated/chat-join-request.d.ts +0 -12
  22. package/lib/generated/chat-join-request.d.ts.map +1 -1
  23. package/lib/generated/chat-join-request.js +0 -24
  24. package/lib/generated/chat-join-request.js.map +1 -1
  25. package/lib/generated/chat-member.d.ts +0 -12
  26. package/lib/generated/chat-member.d.ts.map +1 -1
  27. package/lib/generated/chat-member.js +0 -24
  28. package/lib/generated/chat-member.js.map +1 -1
  29. package/lib/generated/deleted-business-messages.d.ts +68 -38
  30. package/lib/generated/deleted-business-messages.d.ts.map +1 -1
  31. package/lib/generated/deleted-business-messages.js +108 -48
  32. package/lib/generated/deleted-business-messages.js.map +1 -1
  33. package/lib/generated/edited-business-message.d.ts +83 -41
  34. package/lib/generated/edited-business-message.d.ts.map +1 -1
  35. package/lib/generated/edited-business-message.js +125 -41
  36. package/lib/generated/edited-business-message.js.map +1 -1
  37. package/lib/generated/edited-channel-post.d.ts +33 -35
  38. package/lib/generated/edited-channel-post.d.ts.map +1 -1
  39. package/lib/generated/edited-channel-post.js +37 -41
  40. package/lib/generated/edited-channel-post.js.map +1 -1
  41. package/lib/generated/edited-message.d.ts +33 -35
  42. package/lib/generated/edited-message.d.ts.map +1 -1
  43. package/lib/generated/edited-message.js +37 -41
  44. package/lib/generated/edited-message.js.map +1 -1
  45. package/lib/generated/guest-message.d.ts +37 -37
  46. package/lib/generated/guest-message.d.ts.map +1 -1
  47. package/lib/generated/guest-message.js +42 -42
  48. package/lib/generated/guest-message.js.map +1 -1
  49. package/lib/generated/index.d.ts +3 -2
  50. package/lib/generated/index.d.ts.map +1 -1
  51. package/lib/generated/index.js +3 -2
  52. package/lib/generated/index.js.map +1 -1
  53. package/lib/generated/message-reaction-count.d.ts +0 -16
  54. package/lib/generated/message-reaction-count.d.ts.map +1 -1
  55. package/lib/generated/message-reaction-count.js +0 -32
  56. package/lib/generated/message-reaction-count.js.map +1 -1
  57. package/lib/generated/message-reaction.d.ts +0 -16
  58. package/lib/generated/message-reaction.d.ts.map +1 -1
  59. package/lib/generated/message-reaction.js +0 -32
  60. package/lib/generated/message-reaction.js.map +1 -1
  61. package/lib/generated/message.d.ts +33 -35
  62. package/lib/generated/message.d.ts.map +1 -1
  63. package/lib/generated/message.js +37 -41
  64. package/lib/generated/message.js.map +1 -1
  65. package/lib/generated/my-chat-member.d.ts +0 -12
  66. package/lib/generated/my-chat-member.d.ts.map +1 -1
  67. package/lib/generated/my-chat-member.js +0 -24
  68. package/lib/generated/my-chat-member.js.map +1 -1
  69. package/lib/generated/removed-chat-boost.d.ts +0 -12
  70. package/lib/generated/removed-chat-boost.d.ts.map +1 -1
  71. package/lib/generated/removed-chat-boost.js +0 -24
  72. package/lib/generated/removed-chat-boost.js.map +1 -1
  73. package/lib/index.test.js +203 -1
  74. package/lib/index.test.js.map +1 -1
  75. package/lib/sugar/business-message.d.ts +12 -3
  76. package/lib/sugar/business-message.d.ts.map +1 -1
  77. package/lib/sugar/business-message.js +12 -1
  78. package/lib/sugar/business-message.js.map +1 -1
  79. package/lib/sugar/channel-post.d.ts +5 -2
  80. package/lib/sugar/channel-post.d.ts.map +1 -1
  81. package/lib/sugar/edited-business-message.d.ts +12 -3
  82. package/lib/sugar/edited-business-message.d.ts.map +1 -1
  83. package/lib/sugar/edited-business-message.js +12 -1
  84. package/lib/sugar/edited-business-message.js.map +1 -1
  85. package/lib/sugar/edited-channel-post.d.ts +5 -2
  86. package/lib/sugar/edited-channel-post.d.ts.map +1 -1
  87. package/lib/sugar/edited-message.d.ts +5 -2
  88. package/lib/sugar/edited-message.d.ts.map +1 -1
  89. package/lib/sugar/guest-message.d.ts +13 -0
  90. package/lib/sugar/guest-message.d.ts.map +1 -0
  91. package/lib/sugar/guest-message.js +13 -0
  92. package/lib/sugar/guest-message.js.map +1 -0
  93. package/lib/sugar/message-mixin.d.ts +6 -0
  94. package/lib/sugar/message-mixin.d.ts.map +1 -1
  95. package/lib/sugar/message-mixin.js +32 -1
  96. package/lib/sugar/message-mixin.js.map +1 -1
  97. package/lib/sugar/message.d.ts +5 -2
  98. package/lib/sugar/message.d.ts.map +1 -1
  99. package/package.json +2 -2
  100. package/src/generated/business-connection.ts +96 -0
  101. package/src/generated/business-message.ts +166 -82
  102. package/src/generated/callback-query.ts +80 -80
  103. package/src/generated/channel-post.ts +66 -70
  104. package/src/generated/chat-boost.ts +0 -24
  105. package/src/generated/chat-join-request.ts +0 -24
  106. package/src/generated/chat-member.ts +0 -24
  107. package/src/generated/deleted-business-messages.ts +136 -76
  108. package/src/generated/edited-business-message.ts +166 -82
  109. package/src/generated/edited-channel-post.ts +66 -70
  110. package/src/generated/edited-message.ts +66 -70
  111. package/src/generated/guest-message.ts +72 -72
  112. package/src/generated/index.ts +3 -2
  113. package/src/generated/message-reaction-count.ts +0 -32
  114. package/src/generated/message-reaction.ts +0 -32
  115. package/src/generated/message.ts +66 -70
  116. package/src/generated/my-chat-member.ts +0 -24
  117. package/src/generated/removed-chat-boost.ts +0 -24
  118. package/src/index.test.ts +227 -0
  119. package/src/sugar/business-message.ts +14 -2
  120. package/src/sugar/edited-business-message.ts +14 -2
  121. package/src/sugar/guest-message.ts +20 -0
  122. package/src/sugar/message-mixin.ts +41 -1
@@ -35,85 +35,93 @@ export class BusinessMessageContextBase {
35
35
  get messageId(): number {
36
36
  return this.message_id;
37
37
  }
38
+ /** camel-case alias for `business_connection_id`. */
39
+ get businessConnectionId(): string | undefined {
40
+ return this.business_connection_id;
41
+ }
42
+ /** camel-case alias for `message_thread_id` (the forum topic this message is in, if any). */
43
+ get messageThreadId(): number | undefined {
44
+ return this.message_thread_id;
45
+ }
38
46
  /** reply to this message. */
39
- reply(params: Omit<t.SendMessageParams, "chat_id">) {
40
- return this.api.call<t.Message>("sendMessage", { chat_id: this.chat.id, reply_parameters: { message_id: this.message_id }, ...params });
47
+ reply(params: Omit<t.SendMessageParams, "chat_id" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id">) {
48
+ return this.api.call<t.Message>("sendMessage", { chat_id: this.chat.id, reply_parameters: { message_id: this.message_id }, ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
41
49
  }
42
50
  /** Use this method to send text messages. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
43
- send(params: Omit<t.SendMessageParams, "chat_id">) {
44
- return this.api.call<t.Message>("sendMessage", { chat_id: this.chat.id, ...params });
51
+ send(params: Omit<t.SendMessageParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
52
+ return this.api.call<t.Message>("sendMessage", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
45
53
  }
46
54
  /** Use this method to send photos. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
47
- sendPhoto(params: Omit<t.SendPhotoParams, "chat_id">) {
48
- return this.api.call<t.Message>("sendPhoto", { chat_id: this.chat.id, ...params });
55
+ sendPhoto(params: Omit<t.SendPhotoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
56
+ return this.api.call<t.Message>("sendPhoto", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
49
57
  }
50
58
  /** Use this method to send live photos. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
51
- sendLivePhoto(params: Omit<t.SendLivePhotoParams, "chat_id">) {
52
- return this.api.call<t.Message>("sendLivePhoto", { chat_id: this.chat.id, ...params });
59
+ sendLivePhoto(params: Omit<t.SendLivePhotoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
60
+ return this.api.call<t.Message>("sendLivePhoto", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
53
61
  }
54
62
  /** Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the [sendVoice](https://core.telegram.org/bots/api/#sendvoice) method instead. */
55
- sendAudio(params: Omit<t.SendAudioParams, "chat_id">) {
56
- return this.api.call<t.Message>("sendAudio", { chat_id: this.chat.id, ...params });
63
+ sendAudio(params: Omit<t.SendAudioParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
64
+ return this.api.call<t.Message>("sendAudio", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
57
65
  }
58
66
  /** Use this method to send general files. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. */
59
- sendDocument(params: Omit<t.SendDocumentParams, "chat_id">) {
60
- return this.api.call<t.Message>("sendDocument", { chat_id: this.chat.id, ...params });
67
+ sendDocument(params: Omit<t.SendDocumentParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
68
+ return this.api.call<t.Message>("sendDocument", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
61
69
  }
62
70
  /** Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as [Document](https://core.telegram.org/bots/api/#document)). On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. */
63
- sendVideo(params: Omit<t.SendVideoParams, "chat_id">) {
64
- return this.api.call<t.Message>("sendVideo", { chat_id: this.chat.id, ...params });
71
+ sendVideo(params: Omit<t.SendVideoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
72
+ return this.api.call<t.Message>("sendVideo", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
65
73
  }
66
74
  /** Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. */
67
- sendAnimation(params: Omit<t.SendAnimationParams, "chat_id">) {
68
- return this.api.call<t.Message>("sendAnimation", { chat_id: this.chat.id, ...params });
75
+ sendAnimation(params: Omit<t.SendAnimationParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
76
+ return this.api.call<t.Message>("sendAnimation", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
69
77
  }
70
78
  /** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as [Audio](https://core.telegram.org/bots/api/#audio) or [Document](https://core.telegram.org/bots/api/#document)). On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
71
- sendVoice(params: Omit<t.SendVoiceParams, "chat_id">) {
72
- return this.api.call<t.Message>("sendVoice", { chat_id: this.chat.id, ...params });
79
+ sendVoice(params: Omit<t.SendVoiceParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
80
+ return this.api.call<t.Message>("sendVoice", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
73
81
  }
74
82
  /** As of [v.4.0](https://telegram.org/blog/video-messages-and-telescope), Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
75
- sendVideoNote(params: Omit<t.SendVideoNoteParams, "chat_id">) {
76
- return this.api.call<t.Message>("sendVideoNote", { chat_id: this.chat.id, ...params });
83
+ sendVideoNote(params: Omit<t.SendVideoNoteParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
84
+ return this.api.call<t.Message>("sendVideoNote", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
77
85
  }
78
86
  /** Use this method to send paid media. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
79
- sendPaidMedia(params: Omit<t.SendPaidMediaParams, "chat_id">) {
80
- return this.api.call<t.Message>("sendPaidMedia", { chat_id: this.chat.id, ...params });
87
+ sendPaidMedia(params: Omit<t.SendPaidMediaParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
88
+ return this.api.call<t.Message>("sendPaidMedia", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
81
89
  }
82
90
  /** Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [Message](https://core.telegram.org/bots/api/#message) objects that were sent is returned. */
83
- sendMediaGroup(params: Omit<t.SendMediaGroupParams, "chat_id">) {
84
- return this.api.call<t.Message[]>("sendMediaGroup", { chat_id: this.chat.id, ...params });
91
+ sendMediaGroup(params: Omit<t.SendMediaGroupParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
92
+ return this.api.call<t.Message[]>("sendMediaGroup", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
85
93
  }
86
94
  /** Use this method to send point on the map. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
87
- sendLocation(params: Omit<t.SendLocationParams, "chat_id">) {
88
- return this.api.call<t.Message>("sendLocation", { chat_id: this.chat.id, ...params });
95
+ sendLocation(params: Omit<t.SendLocationParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
96
+ return this.api.call<t.Message>("sendLocation", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
89
97
  }
90
98
  /** Use this method to send information about a venue. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
91
- sendVenue(params: Omit<t.SendVenueParams, "chat_id">) {
92
- return this.api.call<t.Message>("sendVenue", { chat_id: this.chat.id, ...params });
99
+ sendVenue(params: Omit<t.SendVenueParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
100
+ return this.api.call<t.Message>("sendVenue", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
93
101
  }
94
102
  /** Use this method to send phone contacts. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
95
- sendContact(params: Omit<t.SendContactParams, "chat_id">) {
96
- return this.api.call<t.Message>("sendContact", { chat_id: this.chat.id, ...params });
103
+ sendContact(params: Omit<t.SendContactParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
104
+ return this.api.call<t.Message>("sendContact", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
97
105
  }
98
106
  /** Use this method to send a native poll. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
99
- sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
100
- return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...params });
107
+ sendPoll(params: Omit<t.SendPollParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
108
+ return this.api.call<t.Message>("sendPoll", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
101
109
  }
102
110
  /** Use this method to send a checklist on behalf of a connected business account. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
103
- sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
104
- return this.api.call<t.Message>("sendChecklist", { chat_id: this.chat.id, ...params });
111
+ sendChecklist(params: Omit<t.SendChecklistParams, "business_connection_id" | "chat_id">) {
112
+ return this.api.call<t.Message>("sendChecklist", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...params });
105
113
  }
106
114
  /** Use this method to send an animated emoji that will display a random value. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
107
- sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
108
- return this.api.call<t.Message>("sendDice", { chat_id: this.chat.id, ...params });
115
+ sendDice(params: Omit<t.SendDiceParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
116
+ return this.api.call<t.Message>("sendDice", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
109
117
  }
110
118
  /** Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you **must** call [sendMessage](https://core.telegram.org/bots/api/#sendmessage) with the complete message to persist it in the user's chat. Returns *True* on success. */
111
- sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id">) {
112
- return this.api.call<boolean>("sendMessageDraft", { chat_id: this.chat.id, ...params });
119
+ sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id" | "message_thread_id">) {
120
+ return this.api.call<boolean>("sendMessageDraft", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
113
121
  }
114
122
  /** Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns *True* on success. Example: The [ImageBot](https://t.me/imagebot) needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use [sendChatAction](https://core.telegram.org/bots/api/#sendchataction) with *action* = *upload\_photo*. The user will see a “sending photo” status for the bot. We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive. */
115
- sendChatAction(params: Omit<t.SendChatActionParams, "chat_id">) {
116
- return this.api.call<boolean>("sendChatAction", { chat_id: this.chat.id, ...params });
123
+ sendChatAction(params: Omit<t.SendChatActionParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
124
+ return this.api.call<boolean>("sendChatAction", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
117
125
  }
118
126
  /** Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns *True* on success. */
119
127
  react(params: Omit<t.SetMessageReactionParams, "chat_id" | "message_id">) {
@@ -216,12 +224,12 @@ export class BusinessMessageContextBase {
216
224
  return this.api.call<boolean>("setChatDescription", { chat_id: this.chat.id, ...params });
217
225
  }
218
226
  /** 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. */
219
- pin(params: Omit<t.PinChatMessageParams, "chat_id" | "message_id">) {
220
- return this.api.call<boolean>("pinChatMessage", { chat_id: this.chat.id, message_id: this.message_id, ...params });
227
+ pin(params: Omit<t.PinChatMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
228
+ return this.api.call<boolean>("pinChatMessage", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
221
229
  }
222
230
  /** 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. */
223
- unpin(params: Omit<t.UnpinChatMessageParams, "chat_id" | "message_id">) {
224
- return this.api.call<boolean>("unpinChatMessage", { chat_id: this.chat.id, message_id: this.message_id, ...params });
231
+ unpin(params?: Omit<t.UnpinChatMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
232
+ return this.api.call<boolean>("unpinChatMessage", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
225
233
  }
226
234
  /** 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. */
227
235
  unpinAllChatMessages(params?: Omit<t.UnpinAllChatMessagesParams, "chat_id">) {
@@ -264,24 +272,24 @@ export class BusinessMessageContextBase {
264
272
  return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
265
273
  }
266
274
  /** Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_manage\_topics* administrator rights, unless it is the creator of the topic. Returns *True* on success. */
267
- editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
268
- return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...params });
275
+ editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id" | "message_thread_id">) {
276
+ return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
269
277
  }
270
278
  /** Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can\_manage\_topics* administrator rights, unless it is the creator of the topic. Returns *True* on success. */
271
- closeForumTopic(params: Omit<t.CloseForumTopicParams, "chat_id">) {
272
- return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...params });
279
+ closeForumTopic(params?: Omit<t.CloseForumTopicParams, "chat_id" | "message_thread_id">) {
280
+ return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
273
281
  }
274
282
  /** Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can\_manage\_topics* administrator rights, unless it is the creator of the topic. Returns *True* on success. */
275
- reopenForumTopic(params: Omit<t.ReopenForumTopicParams, "chat_id">) {
276
- return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
283
+ reopenForumTopic(params?: Omit<t.ReopenForumTopicParams, "chat_id" | "message_thread_id">) {
284
+ return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
277
285
  }
278
286
  /** Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_delete\_messages* administrator rights. Returns *True* on success. */
279
- deleteForumTopic(params: Omit<t.DeleteForumTopicParams, "chat_id">) {
280
- return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
287
+ deleteForumTopic(params?: Omit<t.DeleteForumTopicParams, "chat_id" | "message_thread_id">) {
288
+ return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
281
289
  }
282
290
  /** Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_pin\_messages* administrator right in the supergroup. Returns *True* on success. */
283
- unpinAllForumTopicMessages(params: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id">) {
284
- return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
291
+ unpinAllForumTopicMessages(params?: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id" | "message_thread_id">) {
292
+ return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
285
293
  }
286
294
  /** Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can\_manage\_topics* administrator rights. Returns *True* on success. */
287
295
  editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
@@ -311,6 +319,10 @@ export class BusinessMessageContextBase {
311
319
  getUserChatBoosts(params?: Omit<t.GetUserChatBoostsParams, "chat_id" | "user_id">) {
312
320
  return this.api.call<t.UserChatBoosts>("getUserChatBoosts", { chat_id: this.chat.id, user_id: this.from?.id, ...params });
313
321
  }
322
+ /** Use this method to get information about the connection of the bot with a business account. Returns a [BusinessConnection](https://core.telegram.org/bots/api/#businessconnection) object on success. */
323
+ getBusinessConnection(params?: Omit<t.GetBusinessConnectionParams, "business_connection_id">) {
324
+ return this.api.call<t.BusinessConnection>("getBusinessConnection", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
325
+ }
314
326
  /** Use this method to get the token of a managed bot. Returns the token as *String* on success. */
315
327
  getManagedBotToken(params?: Omit<t.GetManagedBotTokenParams, "user_id">) {
316
328
  return this.api.call<string>("getManagedBotToken", { user_id: this.from?.id, ...params });
@@ -360,8 +372,48 @@ export class BusinessMessageContextBase {
360
372
  return this.api.call<boolean>("removeChatVerification", { chat_id: this.chat.id, ...params });
361
373
  }
362
374
  /** Marks incoming message as read on behalf of a business account. Requires the *can\_read\_messages* business bot right. Returns *True* on success. */
363
- readBusinessMessage(params: Omit<t.ReadBusinessMessageParams, "chat_id" | "message_id">) {
364
- return this.api.call<boolean>("readBusinessMessage", { chat_id: this.chat.id, message_id: this.message_id, ...params });
375
+ readBusinessMessage(params?: Omit<t.ReadBusinessMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
376
+ return this.api.call<boolean>("readBusinessMessage", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
377
+ }
378
+ /** Delete messages on behalf of a business account. Requires the *can\_delete\_sent\_messages* business bot right to delete messages sent by the bot itself, or the *can\_delete\_all\_messages* business bot right to delete any message. Returns *True* on success. */
379
+ deleteBusinessMessages(params: Omit<t.DeleteBusinessMessagesParams, "business_connection_id">) {
380
+ return this.api.call<boolean>("deleteBusinessMessages", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
381
+ }
382
+ /** Changes the first and last name of a managed business account. Requires the *can\_change\_name* business bot right. Returns *True* on success. */
383
+ setBusinessAccountName(params: Omit<t.SetBusinessAccountNameParams, "business_connection_id">) {
384
+ return this.api.call<boolean>("setBusinessAccountName", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
385
+ }
386
+ /** Changes the username of a managed business account. Requires the *can\_change\_username* business bot right. Returns *True* on success. */
387
+ setBusinessAccountUsername(params: Omit<t.SetBusinessAccountUsernameParams, "business_connection_id">) {
388
+ return this.api.call<boolean>("setBusinessAccountUsername", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
389
+ }
390
+ /** Changes the bio of a managed business account. Requires the *can\_change\_bio* business bot right. Returns *True* on success. */
391
+ setBusinessAccountBio(params: Omit<t.SetBusinessAccountBioParams, "business_connection_id">) {
392
+ return this.api.call<boolean>("setBusinessAccountBio", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
393
+ }
394
+ /** Changes the profile photo of a managed business account. Requires the *can\_edit\_profile\_photo* business bot right. Returns *True* on success. */
395
+ setBusinessAccountProfilePhoto(params: Omit<t.SetBusinessAccountProfilePhotoParams, "business_connection_id">) {
396
+ return this.api.call<boolean>("setBusinessAccountProfilePhoto", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
397
+ }
398
+ /** Removes the current profile photo of a managed business account. Requires the *can\_edit\_profile\_photo* business bot right. Returns *True* on success. */
399
+ removeBusinessAccountProfilePhoto(params: Omit<t.RemoveBusinessAccountProfilePhotoParams, "business_connection_id">) {
400
+ return this.api.call<boolean>("removeBusinessAccountProfilePhoto", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
401
+ }
402
+ /** Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can\_change\_gift\_settings* business bot right. Returns *True* on success. */
403
+ setBusinessAccountGiftSettings(params: Omit<t.SetBusinessAccountGiftSettingsParams, "business_connection_id">) {
404
+ return this.api.call<boolean>("setBusinessAccountGiftSettings", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
405
+ }
406
+ /** Returns the amount of Telegram Stars owned by a managed business account. Requires the *can\_view\_gifts\_and\_stars* business bot right. Returns [StarAmount](https://core.telegram.org/bots/api/#staramount) on success. */
407
+ getBusinessAccountStarBalance(params?: Omit<t.GetBusinessAccountStarBalanceParams, "business_connection_id">) {
408
+ return this.api.call<t.StarAmount>("getBusinessAccountStarBalance", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
409
+ }
410
+ /** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can\_transfer\_stars* business bot right. Returns *True* on success. */
411
+ transferBusinessAccountStars(params: Omit<t.TransferBusinessAccountStarsParams, "business_connection_id">) {
412
+ return this.api.call<boolean>("transferBusinessAccountStars", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
413
+ }
414
+ /** Returns the gifts received and owned by a managed business account. Requires the *can\_view\_gifts\_and\_stars* business bot right. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
415
+ getBusinessAccountGifts(params: Omit<t.GetBusinessAccountGiftsParams, "business_connection_id">) {
416
+ return this.api.call<t.OwnedGifts>("getBusinessAccountGifts", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
365
417
  }
366
418
  /** Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
367
419
  getUserGifts(params: Omit<t.GetUserGiftsParams, "user_id">) {
@@ -371,6 +423,34 @@ export class BusinessMessageContextBase {
371
423
  getChatGifts(params: Omit<t.GetChatGiftsParams, "chat_id">) {
372
424
  return this.api.call<t.OwnedGifts>("getChatGifts", { chat_id: this.chat.id, ...params });
373
425
  }
426
+ /** Converts a given regular gift to Telegram Stars. Requires the *can\_convert\_gifts\_to\_stars* business bot right. Returns *True* on success. */
427
+ convertGiftToStars(params: Omit<t.ConvertGiftToStarsParams, "business_connection_id">) {
428
+ return this.api.call<boolean>("convertGiftToStars", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
429
+ }
430
+ /** Upgrades a given regular gift to a unique gift. Requires the *can\_transfer\_and\_upgrade\_gifts* business bot right. Additionally requires the *can\_transfer\_stars* business bot right if the upgrade is paid. Returns *True* on success. */
431
+ upgradeGift(params: Omit<t.UpgradeGiftParams, "business_connection_id">) {
432
+ return this.api.call<boolean>("upgradeGift", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
433
+ }
434
+ /** Transfers an owned unique gift to another user. Requires the *can\_transfer\_and\_upgrade\_gifts* business bot right. Requires *can\_transfer\_stars* business bot right if the transfer is paid. Returns *True* on success. */
435
+ transferGift(params: Omit<t.TransferGiftParams, "business_connection_id">) {
436
+ return this.api.call<boolean>("transferGift", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
437
+ }
438
+ /** Posts a story on behalf of a managed business account. Requires the *can\_manage\_stories* business bot right. Returns [Story](https://core.telegram.org/bots/api/#story) on success. */
439
+ postStory(params: Omit<t.PostStoryParams, "business_connection_id">) {
440
+ return this.api.call<t.Story>("postStory", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
441
+ }
442
+ /** Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the *can\_manage\_stories* business bot right for both business accounts. Returns [Story](https://core.telegram.org/bots/api/#story) on success. */
443
+ repostStory(params: Omit<t.RepostStoryParams, "business_connection_id" | "from_chat_id">) {
444
+ return this.api.call<t.Story>("repostStory", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), from_chat_id: this.chat.id, ...params });
445
+ }
446
+ /** Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can\_manage\_stories* business bot right. Returns [Story](https://core.telegram.org/bots/api/#story) on success. */
447
+ editStory(params: Omit<t.EditStoryParams, "business_connection_id">) {
448
+ return this.api.call<t.Story>("editStory", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
449
+ }
450
+ /** Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can\_manage\_stories* business bot right. Returns *True* on success. */
451
+ deleteStory(params: Omit<t.DeleteStoryParams, "business_connection_id">) {
452
+ return this.api.call<boolean>("deleteStory", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
453
+ }
374
454
  /** Stores a message that can be sent by a user of a Mini App. Returns a [PreparedInlineMessage](https://core.telegram.org/bots/api/#preparedinlinemessage) object. */
375
455
  savePreparedInlineMessage(params: Omit<t.SavePreparedInlineMessageParams, "user_id">) {
376
456
  return this.api.call<t.PreparedInlineMessage>("savePreparedInlineMessage", { user_id: this.from?.id, ...params });
@@ -380,36 +460,36 @@ export class BusinessMessageContextBase {
380
460
  return this.api.call<t.PreparedKeyboardButton>("savePreparedKeyboardButton", { user_id: this.from?.id, ...params });
381
461
  }
382
462
  /** Use this method to edit text, rich and [game](https://core.telegram.org/bots/api/#games) messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
383
- editText(params: Omit<t.EditMessageTextParams, "chat_id" | "message_id">) {
384
- return this.api.call<t.Message | boolean>("editMessageText", { chat_id: this.chat.id, message_id: this.message_id, ...params });
463
+ editText(params: Omit<t.EditMessageTextParams, "business_connection_id" | "chat_id" | "message_id">) {
464
+ return this.api.call<t.Message | boolean>("editMessageText", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
385
465
  }
386
466
  /** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
387
- editCaption(params: Omit<t.EditMessageCaptionParams, "chat_id" | "message_id">) {
388
- return this.api.call<t.Message | boolean>("editMessageCaption", { chat_id: this.chat.id, message_id: this.message_id, ...params });
467
+ editCaption(params: Omit<t.EditMessageCaptionParams, "business_connection_id" | "chat_id" | "message_id">) {
468
+ return this.api.call<t.Message | boolean>("editMessageCaption", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
389
469
  }
390
470
  /** Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
391
- editMedia(params: Omit<t.EditMessageMediaParams, "chat_id" | "message_id">) {
392
- return this.api.call<t.Message | boolean>("editMessageMedia", { chat_id: this.chat.id, message_id: this.message_id, ...params });
471
+ editMedia(params: Omit<t.EditMessageMediaParams, "business_connection_id" | "chat_id" | "message_id">) {
472
+ return this.api.call<t.Message | boolean>("editMessageMedia", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
393
473
  }
394
474
  /** Use this method to edit live location messages. A location can be edited until its *live\_period* expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api/#stopmessagelivelocation). On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. */
395
- editLiveLocation(params: Omit<t.EditMessageLiveLocationParams, "chat_id" | "message_id">) {
396
- return this.api.call<t.Message | boolean>("editMessageLiveLocation", { chat_id: this.chat.id, message_id: this.message_id, ...params });
475
+ editLiveLocation(params: Omit<t.EditMessageLiveLocationParams, "business_connection_id" | "chat_id" | "message_id">) {
476
+ return this.api.call<t.Message | boolean>("editMessageLiveLocation", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
397
477
  }
398
478
  /** Use this method to stop updating a live location message before *live\_period* expires. On success, if the message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. */
399
- stopMessageLiveLocation(params: Omit<t.StopMessageLiveLocationParams, "chat_id" | "message_id">) {
400
- return this.api.call<t.Message | boolean>("stopMessageLiveLocation", { chat_id: this.chat.id, message_id: this.message_id, ...params });
479
+ stopMessageLiveLocation(params: Omit<t.StopMessageLiveLocationParams, "business_connection_id" | "chat_id" | "message_id">) {
480
+ return this.api.call<t.Message | boolean>("stopMessageLiveLocation", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
401
481
  }
402
482
  /** Use this method to edit a checklist on behalf of a connected business account. On success, the edited [Message](https://core.telegram.org/bots/api/#message) is returned. */
403
- editMessageChecklist(params: Omit<t.EditMessageChecklistParams, "chat_id" | "message_id">) {
404
- return this.api.call<t.Message>("editMessageChecklist", { chat_id: this.chat.id, message_id: this.message_id, ...params });
483
+ editMessageChecklist(params: Omit<t.EditMessageChecklistParams, "business_connection_id" | "chat_id" | "message_id">) {
484
+ return this.api.call<t.Message>("editMessageChecklist", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
405
485
  }
406
486
  /** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
407
- editReplyMarkup(params: Omit<t.EditMessageReplyMarkupParams, "chat_id" | "message_id">) {
408
- return this.api.call<t.Message | boolean>("editMessageReplyMarkup", { chat_id: this.chat.id, message_id: this.message_id, ...params });
487
+ editReplyMarkup(params: Omit<t.EditMessageReplyMarkupParams, "business_connection_id" | "chat_id" | "message_id">) {
488
+ return this.api.call<t.Message | boolean>("editMessageReplyMarkup", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
409
489
  }
410
490
  /** Use this method to stop a poll which was sent by the bot. On success, the stopped [Poll](https://core.telegram.org/bots/api/#poll) is returned. */
411
- stopPoll(params: Omit<t.StopPollParams, "chat_id" | "message_id">) {
412
- return this.api.call<t.Poll>("stopPoll", { chat_id: this.chat.id, message_id: this.message_id, ...params });
491
+ stopPoll(params: Omit<t.StopPollParams, "business_connection_id" | "chat_id" | "message_id">) {
492
+ return this.api.call<t.Poll>("stopPoll", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, message_id: this.message_id, ...params });
413
493
  }
414
494
  /** 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. */
415
495
  approveSuggestedPost(params: Omit<t.ApproveSuggestedPostParams, "chat_id" | "message_id">) {
@@ -436,8 +516,8 @@ export class BusinessMessageContextBase {
436
516
  return this.api.call<boolean>("deleteAllMessageReactions", { chat_id: this.chat.id, user_id: this.from?.id, ...params });
437
517
  }
438
518
  /** Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS, or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
439
- sendSticker(params: Omit<t.SendStickerParams, "chat_id">) {
440
- return this.api.call<t.Message>("sendSticker", { chat_id: this.chat.id, ...params });
519
+ sendSticker(params: Omit<t.SendStickerParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
520
+ return this.api.call<t.Message>("sendSticker", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
441
521
  }
442
522
  /** Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api/#createnewstickerset), [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), or [replaceStickerInSet](https://core.telegram.org/bots/api/#replacestickerinset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api/#file) on success. */
443
523
  uploadStickerFile(params: Omit<t.UploadStickerFileParams, "user_id">) {
@@ -460,16 +540,20 @@ export class BusinessMessageContextBase {
460
540
  return this.api.call<boolean>("setStickerSetThumbnail", { user_id: this.from?.id, ...params });
461
541
  }
462
542
  /** Use this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
463
- sendRichMessage(params: Omit<t.SendRichMessageParams, "chat_id">) {
464
- return this.api.call<t.Message>("sendRichMessage", { chat_id: this.chat.id, ...params });
543
+ sendRichMessage(params: Omit<t.SendRichMessageParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
544
+ return this.api.call<t.Message>("sendRichMessage", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
465
545
  }
466
546
  /** Use this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you **must** call [sendRichMessage](https://core.telegram.org/bots/api/#sendrichmessage) with the complete message to persist it in the user's chat. Returns *True* on success. */
467
- sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id">) {
468
- return this.api.call<boolean>("sendRichMessageDraft", { chat_id: this.chat.id, ...params });
547
+ sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id" | "message_thread_id">) {
548
+ return this.api.call<boolean>("sendRichMessageDraft", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
469
549
  }
470
550
  /** Use this method to send invoices. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
471
- sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id">) {
472
- return this.api.call<t.Message>("sendInvoice", { chat_id: this.chat.id, ...params });
551
+ sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
552
+ return this.api.call<t.Message>("sendInvoice", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...((this.direct_messages_topic?.topic_id) === undefined ? {} : { direct_messages_topic_id: this.direct_messages_topic?.topic_id }), ...params });
553
+ }
554
+ /** Use this method to create a link for an invoice. Returns the created invoice link as *String* on success. */
555
+ createInvoiceLink(params: Omit<t.CreateInvoiceLinkParams, "business_connection_id">) {
556
+ return this.api.call<string>("createInvoiceLink", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), ...params });
473
557
  }
474
558
  /** Refunds a successful payment in [Telegram Stars](https://t.me/BotNews/90). Returns *True* on success. */
475
559
  refundStarPayment(params: Omit<t.RefundStarPaymentParams, "user_id">) {
@@ -484,8 +568,8 @@ export class BusinessMessageContextBase {
484
568
  return this.api.call<boolean>("setPassportDataErrors", { user_id: this.from?.id, ...params });
485
569
  }
486
570
  /** Use this method to send a game. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
487
- sendGame(params: Omit<t.SendGameParams, "chat_id">) {
488
- return this.api.call<t.Message>("sendGame", { chat_id: this.chat.id, ...params });
571
+ sendGame(params: Omit<t.SendGameParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
572
+ return this.api.call<t.Message>("sendGame", { ...((this.business_connection_id) === undefined ? {} : { business_connection_id: this.business_connection_id }), chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
489
573
  }
490
574
  /** Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is *False*. */
491
575
  setGameScore(params: Omit<t.SetGameScoreParams, "user_id" | "chat_id" | "message_id">) {