@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.
- package/lib/generated/business-connection.d.ts +48 -0
- package/lib/generated/business-connection.d.ts.map +1 -1
- package/lib/generated/business-connection.js +96 -0
- package/lib/generated/business-connection.js.map +1 -1
- package/lib/generated/business-message.d.ts +83 -41
- package/lib/generated/business-message.d.ts.map +1 -1
- package/lib/generated/business-message.js +125 -41
- package/lib/generated/business-message.js.map +1 -1
- package/lib/generated/callback-query.d.ts +40 -40
- package/lib/generated/callback-query.d.ts.map +1 -1
- package/lib/generated/callback-query.js +40 -40
- package/lib/generated/callback-query.js.map +1 -1
- package/lib/generated/channel-post.d.ts +33 -35
- package/lib/generated/channel-post.d.ts.map +1 -1
- package/lib/generated/channel-post.js +37 -41
- package/lib/generated/channel-post.js.map +1 -1
- package/lib/generated/chat-boost.d.ts +0 -12
- package/lib/generated/chat-boost.d.ts.map +1 -1
- package/lib/generated/chat-boost.js +0 -24
- package/lib/generated/chat-boost.js.map +1 -1
- package/lib/generated/chat-join-request.d.ts +0 -12
- package/lib/generated/chat-join-request.d.ts.map +1 -1
- package/lib/generated/chat-join-request.js +0 -24
- package/lib/generated/chat-join-request.js.map +1 -1
- package/lib/generated/chat-member.d.ts +0 -12
- package/lib/generated/chat-member.d.ts.map +1 -1
- package/lib/generated/chat-member.js +0 -24
- package/lib/generated/chat-member.js.map +1 -1
- package/lib/generated/deleted-business-messages.d.ts +68 -38
- package/lib/generated/deleted-business-messages.d.ts.map +1 -1
- package/lib/generated/deleted-business-messages.js +108 -48
- package/lib/generated/deleted-business-messages.js.map +1 -1
- package/lib/generated/edited-business-message.d.ts +83 -41
- package/lib/generated/edited-business-message.d.ts.map +1 -1
- package/lib/generated/edited-business-message.js +125 -41
- package/lib/generated/edited-business-message.js.map +1 -1
- package/lib/generated/edited-channel-post.d.ts +33 -35
- package/lib/generated/edited-channel-post.d.ts.map +1 -1
- package/lib/generated/edited-channel-post.js +37 -41
- package/lib/generated/edited-channel-post.js.map +1 -1
- package/lib/generated/edited-message.d.ts +33 -35
- package/lib/generated/edited-message.d.ts.map +1 -1
- package/lib/generated/edited-message.js +37 -41
- package/lib/generated/edited-message.js.map +1 -1
- package/lib/generated/guest-message.d.ts +37 -37
- package/lib/generated/guest-message.d.ts.map +1 -1
- package/lib/generated/guest-message.js +42 -42
- package/lib/generated/guest-message.js.map +1 -1
- package/lib/generated/index.d.ts +3 -2
- package/lib/generated/index.d.ts.map +1 -1
- package/lib/generated/index.js +3 -2
- package/lib/generated/index.js.map +1 -1
- package/lib/generated/message-reaction-count.d.ts +0 -16
- package/lib/generated/message-reaction-count.d.ts.map +1 -1
- package/lib/generated/message-reaction-count.js +0 -32
- package/lib/generated/message-reaction-count.js.map +1 -1
- package/lib/generated/message-reaction.d.ts +0 -16
- package/lib/generated/message-reaction.d.ts.map +1 -1
- package/lib/generated/message-reaction.js +0 -32
- package/lib/generated/message-reaction.js.map +1 -1
- package/lib/generated/message.d.ts +33 -35
- package/lib/generated/message.d.ts.map +1 -1
- package/lib/generated/message.js +37 -41
- package/lib/generated/message.js.map +1 -1
- package/lib/generated/my-chat-member.d.ts +0 -12
- package/lib/generated/my-chat-member.d.ts.map +1 -1
- package/lib/generated/my-chat-member.js +0 -24
- package/lib/generated/my-chat-member.js.map +1 -1
- package/lib/generated/removed-chat-boost.d.ts +0 -12
- package/lib/generated/removed-chat-boost.d.ts.map +1 -1
- package/lib/generated/removed-chat-boost.js +0 -24
- package/lib/generated/removed-chat-boost.js.map +1 -1
- package/lib/index.test.js +203 -1
- package/lib/index.test.js.map +1 -1
- package/lib/sugar/business-message.d.ts +12 -3
- package/lib/sugar/business-message.d.ts.map +1 -1
- package/lib/sugar/business-message.js +12 -1
- package/lib/sugar/business-message.js.map +1 -1
- package/lib/sugar/channel-post.d.ts +5 -2
- package/lib/sugar/channel-post.d.ts.map +1 -1
- package/lib/sugar/edited-business-message.d.ts +12 -3
- package/lib/sugar/edited-business-message.d.ts.map +1 -1
- package/lib/sugar/edited-business-message.js +12 -1
- package/lib/sugar/edited-business-message.js.map +1 -1
- package/lib/sugar/edited-channel-post.d.ts +5 -2
- package/lib/sugar/edited-channel-post.d.ts.map +1 -1
- package/lib/sugar/edited-message.d.ts +5 -2
- package/lib/sugar/edited-message.d.ts.map +1 -1
- package/lib/sugar/guest-message.d.ts +13 -0
- package/lib/sugar/guest-message.d.ts.map +1 -0
- package/lib/sugar/guest-message.js +13 -0
- package/lib/sugar/guest-message.js.map +1 -0
- package/lib/sugar/message-mixin.d.ts +6 -0
- package/lib/sugar/message-mixin.d.ts.map +1 -1
- package/lib/sugar/message-mixin.js +32 -1
- package/lib/sugar/message-mixin.js.map +1 -1
- package/lib/sugar/message.d.ts +5 -2
- package/lib/sugar/message.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/generated/business-connection.ts +96 -0
- package/src/generated/business-message.ts +166 -82
- package/src/generated/callback-query.ts +80 -80
- package/src/generated/channel-post.ts +66 -70
- package/src/generated/chat-boost.ts +0 -24
- package/src/generated/chat-join-request.ts +0 -24
- package/src/generated/chat-member.ts +0 -24
- package/src/generated/deleted-business-messages.ts +136 -76
- package/src/generated/edited-business-message.ts +166 -82
- package/src/generated/edited-channel-post.ts +66 -70
- package/src/generated/edited-message.ts +66 -70
- package/src/generated/guest-message.ts +72 -72
- package/src/generated/index.ts +3 -2
- package/src/generated/message-reaction-count.ts +0 -32
- package/src/generated/message-reaction.ts +0 -32
- package/src/generated/message.ts +66 -70
- package/src/generated/my-chat-member.ts +0 -24
- package/src/generated/removed-chat-boost.ts +0 -24
- package/src/index.test.ts +227 -0
- package/src/sugar/business-message.ts +14 -2
- package/src/sugar/edited-business-message.ts +14 -2
- package/src/sugar/guest-message.ts +20 -0
- package/src/sugar/message-mixin.ts +41 -1
|
@@ -20,80 +20,80 @@ export class CallbackQueryContextBase {
|
|
|
20
20
|
return this.from.first_name;
|
|
21
21
|
}
|
|
22
22
|
/** Use this method to send text messages. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
23
|
-
send(params: Omit<t.SendMessageParams, "chat_id">) {
|
|
24
|
-
return this.api.call<t.Message>("sendMessage", { chat_id: this.message?.chat.id, ...params });
|
|
23
|
+
send(params: Omit<t.SendMessageParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
24
|
+
return this.api.call<t.Message>("sendMessage", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
25
25
|
}
|
|
26
26
|
/** Use this method to send photos. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
27
|
-
sendPhoto(params: Omit<t.SendPhotoParams, "chat_id">) {
|
|
28
|
-
return this.api.call<t.Message>("sendPhoto", { chat_id: this.message?.chat.id, ...params });
|
|
27
|
+
sendPhoto(params: Omit<t.SendPhotoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
28
|
+
return this.api.call<t.Message>("sendPhoto", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
29
29
|
}
|
|
30
30
|
/** Use this method to send live photos. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
31
|
-
sendLivePhoto(params: Omit<t.SendLivePhotoParams, "chat_id">) {
|
|
32
|
-
return this.api.call<t.Message>("sendLivePhoto", { chat_id: this.message?.chat.id, ...params });
|
|
31
|
+
sendLivePhoto(params: Omit<t.SendLivePhotoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
32
|
+
return this.api.call<t.Message>("sendLivePhoto", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
33
33
|
}
|
|
34
34
|
/** 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. */
|
|
35
|
-
sendAudio(params: Omit<t.SendAudioParams, "chat_id">) {
|
|
36
|
-
return this.api.call<t.Message>("sendAudio", { chat_id: this.message?.chat.id, ...params });
|
|
35
|
+
sendAudio(params: Omit<t.SendAudioParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
36
|
+
return this.api.call<t.Message>("sendAudio", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
37
37
|
}
|
|
38
38
|
/** 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. */
|
|
39
|
-
sendDocument(params: Omit<t.SendDocumentParams, "chat_id">) {
|
|
40
|
-
return this.api.call<t.Message>("sendDocument", { chat_id: this.message?.chat.id, ...params });
|
|
39
|
+
sendDocument(params: Omit<t.SendDocumentParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
40
|
+
return this.api.call<t.Message>("sendDocument", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
41
41
|
}
|
|
42
42
|
/** 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. */
|
|
43
|
-
sendVideo(params: Omit<t.SendVideoParams, "chat_id">) {
|
|
44
|
-
return this.api.call<t.Message>("sendVideo", { chat_id: this.message?.chat.id, ...params });
|
|
43
|
+
sendVideo(params: Omit<t.SendVideoParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
44
|
+
return this.api.call<t.Message>("sendVideo", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
45
45
|
}
|
|
46
46
|
/** 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. */
|
|
47
|
-
sendAnimation(params: Omit<t.SendAnimationParams, "chat_id">) {
|
|
48
|
-
return this.api.call<t.Message>("sendAnimation", { chat_id: this.message?.chat.id, ...params });
|
|
47
|
+
sendAnimation(params: Omit<t.SendAnimationParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
48
|
+
return this.api.call<t.Message>("sendAnimation", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
49
49
|
}
|
|
50
50
|
/** 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. */
|
|
51
|
-
sendVoice(params: Omit<t.SendVoiceParams, "chat_id">) {
|
|
52
|
-
return this.api.call<t.Message>("sendVoice", { chat_id: this.message?.chat.id, ...params });
|
|
51
|
+
sendVoice(params: Omit<t.SendVoiceParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
52
|
+
return this.api.call<t.Message>("sendVoice", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
53
53
|
}
|
|
54
54
|
/** 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. */
|
|
55
|
-
sendVideoNote(params: Omit<t.SendVideoNoteParams, "chat_id">) {
|
|
56
|
-
return this.api.call<t.Message>("sendVideoNote", { chat_id: this.message?.chat.id, ...params });
|
|
55
|
+
sendVideoNote(params: Omit<t.SendVideoNoteParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
56
|
+
return this.api.call<t.Message>("sendVideoNote", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
57
57
|
}
|
|
58
58
|
/** Use this method to send paid media. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
59
|
-
sendPaidMedia(params: Omit<t.SendPaidMediaParams, "chat_id">) {
|
|
60
|
-
return this.api.call<t.Message>("sendPaidMedia", { chat_id: this.message?.chat.id, ...params });
|
|
59
|
+
sendPaidMedia(params: Omit<t.SendPaidMediaParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
60
|
+
return this.api.call<t.Message>("sendPaidMedia", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
61
61
|
}
|
|
62
62
|
/** 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. */
|
|
63
|
-
sendMediaGroup(params: Omit<t.SendMediaGroupParams, "chat_id">) {
|
|
64
|
-
return this.api.call<t.Message[]>("sendMediaGroup", { chat_id: this.message?.chat.id, ...params });
|
|
63
|
+
sendMediaGroup(params: Omit<t.SendMediaGroupParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
64
|
+
return this.api.call<t.Message[]>("sendMediaGroup", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
65
65
|
}
|
|
66
66
|
/** Use this method to send point on the map. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
67
|
-
sendLocation(params: Omit<t.SendLocationParams, "chat_id">) {
|
|
68
|
-
return this.api.call<t.Message>("sendLocation", { chat_id: this.message?.chat.id, ...params });
|
|
67
|
+
sendLocation(params: Omit<t.SendLocationParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
68
|
+
return this.api.call<t.Message>("sendLocation", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
69
69
|
}
|
|
70
70
|
/** Use this method to send information about a venue. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
71
|
-
sendVenue(params: Omit<t.SendVenueParams, "chat_id">) {
|
|
72
|
-
return this.api.call<t.Message>("sendVenue", { chat_id: this.message?.chat.id, ...params });
|
|
71
|
+
sendVenue(params: Omit<t.SendVenueParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
72
|
+
return this.api.call<t.Message>("sendVenue", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
73
73
|
}
|
|
74
74
|
/** Use this method to send phone contacts. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
75
|
-
sendContact(params: Omit<t.SendContactParams, "chat_id">) {
|
|
76
|
-
return this.api.call<t.Message>("sendContact", { chat_id: this.message?.chat.id, ...params });
|
|
75
|
+
sendContact(params: Omit<t.SendContactParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
76
|
+
return this.api.call<t.Message>("sendContact", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
77
77
|
}
|
|
78
78
|
/** Use this method to send a native poll. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
79
|
-
sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
|
|
80
|
-
return this.api.call<t.Message>("sendPoll", { chat_id: this.message?.chat.id, ...params });
|
|
79
|
+
sendPoll(params: Omit<t.SendPollParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
|
|
80
|
+
return this.api.call<t.Message>("sendPoll", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
81
81
|
}
|
|
82
82
|
/** 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. */
|
|
83
|
-
sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
|
|
84
|
-
return this.api.call<t.Message>("sendChecklist", { chat_id: this.message?.chat.id, ...params });
|
|
83
|
+
sendChecklist(params: Omit<t.SendChecklistParams, "business_connection_id" | "chat_id">) {
|
|
84
|
+
return this.api.call<t.Message>("sendChecklist", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...params });
|
|
85
85
|
}
|
|
86
86
|
/** 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. */
|
|
87
|
-
sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
|
|
88
|
-
return this.api.call<t.Message>("sendDice", { chat_id: this.message?.chat.id, ...params });
|
|
87
|
+
sendDice(params: Omit<t.SendDiceParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
88
|
+
return this.api.call<t.Message>("sendDice", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
89
89
|
}
|
|
90
90
|
/** 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. */
|
|
91
|
-
sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id">) {
|
|
92
|
-
return this.api.call<boolean>("sendMessageDraft", { chat_id: this.message?.chat.id, ...params });
|
|
91
|
+
sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id" | "message_thread_id">) {
|
|
92
|
+
return this.api.call<boolean>("sendMessageDraft", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
93
93
|
}
|
|
94
94
|
/** 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. */
|
|
95
|
-
sendChatAction(params: Omit<t.SendChatActionParams, "chat_id">) {
|
|
96
|
-
return this.api.call<boolean>("sendChatAction", { chat_id: this.message?.chat.id, ...params });
|
|
95
|
+
sendChatAction(params: Omit<t.SendChatActionParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
|
|
96
|
+
return this.api.call<boolean>("sendChatAction", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
97
97
|
}
|
|
98
98
|
/** 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. */
|
|
99
99
|
react(params: Omit<t.SetMessageReactionParams, "chat_id" | "message_id">) {
|
|
@@ -196,12 +196,12 @@ export class CallbackQueryContextBase {
|
|
|
196
196
|
return this.api.call<boolean>("setChatDescription", { chat_id: this.message?.chat.id, ...params });
|
|
197
197
|
}
|
|
198
198
|
/** 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. */
|
|
199
|
-
pin(params: Omit<t.PinChatMessageParams, "chat_id" | "message_id">) {
|
|
200
|
-
return this.api.call<boolean>("pinChatMessage", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
199
|
+
pin(params: Omit<t.PinChatMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
200
|
+
return this.api.call<boolean>("pinChatMessage", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
201
201
|
}
|
|
202
202
|
/** 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. */
|
|
203
|
-
unpin(params
|
|
204
|
-
return this.api.call<boolean>("unpinChatMessage", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
203
|
+
unpin(params?: Omit<t.UnpinChatMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
204
|
+
return this.api.call<boolean>("unpinChatMessage", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
205
205
|
}
|
|
206
206
|
/** 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. */
|
|
207
207
|
unpinAllChatMessages(params?: Omit<t.UnpinAllChatMessagesParams, "chat_id">) {
|
|
@@ -244,24 +244,24 @@ export class CallbackQueryContextBase {
|
|
|
244
244
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.message?.chat.id, ...params });
|
|
245
245
|
}
|
|
246
246
|
/** 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. */
|
|
247
|
-
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
|
|
248
|
-
return this.api.call<boolean>("editForumTopic", { chat_id: this.message?.chat.id, ...params });
|
|
247
|
+
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
248
|
+
return this.api.call<boolean>("editForumTopic", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
249
249
|
}
|
|
250
250
|
/** 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. */
|
|
251
|
-
closeForumTopic(params
|
|
252
|
-
return this.api.call<boolean>("closeForumTopic", { chat_id: this.message?.chat.id, ...params });
|
|
251
|
+
closeForumTopic(params?: Omit<t.CloseForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
252
|
+
return this.api.call<boolean>("closeForumTopic", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
253
253
|
}
|
|
254
254
|
/** 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. */
|
|
255
|
-
reopenForumTopic(params
|
|
256
|
-
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.message?.chat.id, ...params });
|
|
255
|
+
reopenForumTopic(params?: Omit<t.ReopenForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
256
|
+
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
257
257
|
}
|
|
258
258
|
/** 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. */
|
|
259
|
-
deleteForumTopic(params
|
|
260
|
-
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.message?.chat.id, ...params });
|
|
259
|
+
deleteForumTopic(params?: Omit<t.DeleteForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
260
|
+
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
261
261
|
}
|
|
262
262
|
/** 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. */
|
|
263
|
-
unpinAllForumTopicMessages(params
|
|
264
|
-
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.message?.chat.id, ...params });
|
|
263
|
+
unpinAllForumTopicMessages(params?: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id" | "message_thread_id">) {
|
|
264
|
+
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
265
265
|
}
|
|
266
266
|
/** 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. */
|
|
267
267
|
editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
|
|
@@ -344,8 +344,8 @@ export class CallbackQueryContextBase {
|
|
|
344
344
|
return this.api.call<boolean>("removeChatVerification", { chat_id: this.message?.chat.id, ...params });
|
|
345
345
|
}
|
|
346
346
|
/** Marks incoming message as read on behalf of a business account. Requires the *can\_read\_messages* business bot right. Returns *True* on success. */
|
|
347
|
-
readBusinessMessage(params
|
|
348
|
-
return this.api.call<boolean>("readBusinessMessage", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
347
|
+
readBusinessMessage(params?: Omit<t.ReadBusinessMessageParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
348
|
+
return this.api.call<boolean>("readBusinessMessage", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
349
349
|
}
|
|
350
350
|
/** Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
|
|
351
351
|
getUserGifts(params: Omit<t.GetUserGiftsParams, "user_id">) {
|
|
@@ -364,36 +364,36 @@ export class CallbackQueryContextBase {
|
|
|
364
364
|
return this.api.call<t.PreparedKeyboardButton>("savePreparedKeyboardButton", { user_id: this.from.id, ...params });
|
|
365
365
|
}
|
|
366
366
|
/** 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. */
|
|
367
|
-
editText(params: Omit<t.EditMessageTextParams, "chat_id" | "message_id">) {
|
|
368
|
-
return this.api.call<t.Message | boolean>("editMessageText", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
367
|
+
editText(params: Omit<t.EditMessageTextParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
368
|
+
return this.api.call<t.Message | boolean>("editMessageText", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
369
369
|
}
|
|
370
370
|
/** 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. */
|
|
371
|
-
editCaption(params: Omit<t.EditMessageCaptionParams, "chat_id" | "message_id">) {
|
|
372
|
-
return this.api.call<t.Message | boolean>("editMessageCaption", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
371
|
+
editCaption(params: Omit<t.EditMessageCaptionParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
372
|
+
return this.api.call<t.Message | boolean>("editMessageCaption", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
373
373
|
}
|
|
374
374
|
/** 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. */
|
|
375
|
-
editMedia(params: Omit<t.EditMessageMediaParams, "chat_id" | "message_id">) {
|
|
376
|
-
return this.api.call<t.Message | boolean>("editMessageMedia", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
375
|
+
editMedia(params: Omit<t.EditMessageMediaParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
376
|
+
return this.api.call<t.Message | boolean>("editMessageMedia", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
377
377
|
}
|
|
378
378
|
/** 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. */
|
|
379
|
-
editLiveLocation(params: Omit<t.EditMessageLiveLocationParams, "chat_id" | "message_id">) {
|
|
380
|
-
return this.api.call<t.Message | boolean>("editMessageLiveLocation", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
379
|
+
editLiveLocation(params: Omit<t.EditMessageLiveLocationParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
380
|
+
return this.api.call<t.Message | boolean>("editMessageLiveLocation", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
381
381
|
}
|
|
382
382
|
/** 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. */
|
|
383
|
-
stopMessageLiveLocation(params: Omit<t.StopMessageLiveLocationParams, "chat_id" | "message_id">) {
|
|
384
|
-
return this.api.call<t.Message | boolean>("stopMessageLiveLocation", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
383
|
+
stopMessageLiveLocation(params: Omit<t.StopMessageLiveLocationParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
384
|
+
return this.api.call<t.Message | boolean>("stopMessageLiveLocation", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
385
385
|
}
|
|
386
386
|
/** 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. */
|
|
387
|
-
editMessageChecklist(params: Omit<t.EditMessageChecklistParams, "chat_id" | "message_id">) {
|
|
388
|
-
return this.api.call<t.Message>("editMessageChecklist", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
387
|
+
editMessageChecklist(params: Omit<t.EditMessageChecklistParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
388
|
+
return this.api.call<t.Message>("editMessageChecklist", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
389
389
|
}
|
|
390
390
|
/** 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. */
|
|
391
|
-
editReplyMarkup(params: Omit<t.EditMessageReplyMarkupParams, "chat_id" | "message_id">) {
|
|
392
|
-
return this.api.call<t.Message | boolean>("editMessageReplyMarkup", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
391
|
+
editReplyMarkup(params: Omit<t.EditMessageReplyMarkupParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
392
|
+
return this.api.call<t.Message | boolean>("editMessageReplyMarkup", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
393
393
|
}
|
|
394
394
|
/** 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. */
|
|
395
|
-
stopPoll(params: Omit<t.StopPollParams, "chat_id" | "message_id">) {
|
|
396
|
-
return this.api.call<t.Poll>("stopPoll", { chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
395
|
+
stopPoll(params: Omit<t.StopPollParams, "business_connection_id" | "chat_id" | "message_id">) {
|
|
396
|
+
return this.api.call<t.Poll>("stopPoll", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, message_id: this.message?.message_id, ...params });
|
|
397
397
|
}
|
|
398
398
|
/** 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. */
|
|
399
399
|
approveSuggestedPost(params: Omit<t.ApproveSuggestedPostParams, "chat_id" | "message_id">) {
|
|
@@ -420,8 +420,8 @@ export class CallbackQueryContextBase {
|
|
|
420
420
|
return this.api.call<boolean>("deleteAllMessageReactions", { chat_id: this.message?.chat.id, user_id: this.from.id, ...params });
|
|
421
421
|
}
|
|
422
422
|
/** 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. */
|
|
423
|
-
sendSticker(params: Omit<t.SendStickerParams, "chat_id">) {
|
|
424
|
-
return this.api.call<t.Message>("sendSticker", { chat_id: this.message?.chat.id, ...params });
|
|
423
|
+
sendSticker(params: Omit<t.SendStickerParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
424
|
+
return this.api.call<t.Message>("sendSticker", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
425
425
|
}
|
|
426
426
|
/** 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. */
|
|
427
427
|
uploadStickerFile(params: Omit<t.UploadStickerFileParams, "user_id">) {
|
|
@@ -444,16 +444,16 @@ export class CallbackQueryContextBase {
|
|
|
444
444
|
return this.api.call<boolean>("setStickerSetThumbnail", { user_id: this.from.id, ...params });
|
|
445
445
|
}
|
|
446
446
|
/** 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. */
|
|
447
|
-
sendRichMessage(params: Omit<t.SendRichMessageParams, "chat_id">) {
|
|
448
|
-
return this.api.call<t.Message>("sendRichMessage", { chat_id: this.message?.chat.id, ...params });
|
|
447
|
+
sendRichMessage(params: Omit<t.SendRichMessageParams, "business_connection_id" | "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
448
|
+
return this.api.call<t.Message>("sendRichMessage", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
449
449
|
}
|
|
450
450
|
/** 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. */
|
|
451
|
-
sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id">) {
|
|
452
|
-
return this.api.call<boolean>("sendRichMessageDraft", { chat_id: this.message?.chat.id, ...params });
|
|
451
|
+
sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id" | "message_thread_id">) {
|
|
452
|
+
return this.api.call<boolean>("sendRichMessageDraft", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
453
453
|
}
|
|
454
454
|
/** Use this method to send invoices. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
455
|
-
sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id">) {
|
|
456
|
-
return this.api.call<t.Message>("sendInvoice", { chat_id: this.message?.chat.id, ...params });
|
|
455
|
+
sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
456
|
+
return this.api.call<t.Message>("sendInvoice", { chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...((this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined) === undefined ? {} : { direct_messages_topic_id: this.message && "direct_messages_topic" in this.message ? this.message.direct_messages_topic?.topic_id : undefined }), ...params });
|
|
457
457
|
}
|
|
458
458
|
/** Refunds a successful payment in [Telegram Stars](https://t.me/BotNews/90). Returns *True* on success. */
|
|
459
459
|
refundStarPayment(params: Omit<t.RefundStarPaymentParams, "user_id">) {
|
|
@@ -468,8 +468,8 @@ export class CallbackQueryContextBase {
|
|
|
468
468
|
return this.api.call<boolean>("setPassportDataErrors", { user_id: this.from.id, ...params });
|
|
469
469
|
}
|
|
470
470
|
/** Use this method to send a game. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
471
|
-
sendGame(params: Omit<t.SendGameParams, "chat_id">) {
|
|
472
|
-
return this.api.call<t.Message>("sendGame", { chat_id: this.message?.chat.id, ...params });
|
|
471
|
+
sendGame(params: Omit<t.SendGameParams, "business_connection_id" | "chat_id" | "message_thread_id">) {
|
|
472
|
+
return this.api.call<t.Message>("sendGame", { ...((this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined) === undefined ? {} : { business_connection_id: this.message && "business_connection_id" in this.message ? this.message.business_connection_id : undefined }), chat_id: this.message?.chat.id, ...((this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined) === undefined ? {} : { message_thread_id: this.message && "message_thread_id" in this.message ? this.message.message_thread_id : undefined }), ...params });
|
|
473
473
|
}
|
|
474
474
|
/** 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*. */
|
|
475
475
|
setGameScore(params: Omit<t.SetGameScoreParams, "user_id" | "chat_id" | "message_id">) {
|