@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
|
@@ -35,85 +35,89 @@ export class ChannelPostContextBase {
|
|
|
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" | "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.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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
52
|
+
return this.api.call<t.Message>("sendMessage", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
56
|
+
return this.api.call<t.Message>("sendPhoto", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
60
|
+
return this.api.call<t.Message>("sendLivePhoto", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
64
|
+
return this.api.call<t.Message>("sendAudio", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
68
|
+
return this.api.call<t.Message>("sendDocument", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
72
|
+
return this.api.call<t.Message>("sendVideo", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
76
|
+
return this.api.call<t.Message>("sendAnimation", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
80
|
+
return this.api.call<t.Message>("sendVoice", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
84
|
+
return this.api.call<t.Message>("sendVideoNote", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
88
|
+
return this.api.call<t.Message>("sendPaidMedia", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
92
|
+
return this.api.call<t.Message[]>("sendMediaGroup", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
96
|
+
return this.api.call<t.Message>("sendLocation", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
100
|
+
return this.api.call<t.Message>("sendVenue", { 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, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
104
|
+
return this.api.call<t.Message>("sendContact", { 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 });
|
|
101
|
-
}
|
|
102
|
-
/** 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 });
|
|
107
|
+
sendPoll(params: Omit<t.SendPollParams, "chat_id" | "message_thread_id">) {
|
|
108
|
+
return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
|
|
105
109
|
}
|
|
106
110
|
/** 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 });
|
|
111
|
+
sendDice(params: Omit<t.SendDiceParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
112
|
+
return this.api.call<t.Message>("sendDice", { 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
113
|
}
|
|
110
114
|
/** 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 });
|
|
115
|
+
sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id" | "message_thread_id">) {
|
|
116
|
+
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
117
|
}
|
|
114
118
|
/** 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 });
|
|
119
|
+
sendChatAction(params: Omit<t.SendChatActionParams, "chat_id" | "message_thread_id">) {
|
|
120
|
+
return this.api.call<boolean>("sendChatAction", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
|
|
117
121
|
}
|
|
118
122
|
/** 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
123
|
react(params: Omit<t.SetMessageReactionParams, "chat_id" | "message_id">) {
|
|
@@ -264,24 +268,24 @@ export class ChannelPostContextBase {
|
|
|
264
268
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
|
|
265
269
|
}
|
|
266
270
|
/** 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 });
|
|
271
|
+
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
272
|
+
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
273
|
}
|
|
270
274
|
/** 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
|
|
272
|
-
return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...params });
|
|
275
|
+
closeForumTopic(params?: Omit<t.CloseForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
276
|
+
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
277
|
}
|
|
274
278
|
/** 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
|
|
276
|
-
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
|
|
279
|
+
reopenForumTopic(params?: Omit<t.ReopenForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
280
|
+
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
281
|
}
|
|
278
282
|
/** 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
|
|
280
|
-
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
|
|
283
|
+
deleteForumTopic(params?: Omit<t.DeleteForumTopicParams, "chat_id" | "message_thread_id">) {
|
|
284
|
+
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
285
|
}
|
|
282
286
|
/** 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
|
|
284
|
-
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
|
|
287
|
+
unpinAllForumTopicMessages(params?: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id" | "message_thread_id">) {
|
|
288
|
+
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
289
|
}
|
|
286
290
|
/** 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
291
|
editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
|
|
@@ -359,10 +363,6 @@ export class ChannelPostContextBase {
|
|
|
359
363
|
removeChatVerification(params?: Omit<t.RemoveChatVerificationParams, "chat_id">) {
|
|
360
364
|
return this.api.call<boolean>("removeChatVerification", { chat_id: this.chat.id, ...params });
|
|
361
365
|
}
|
|
362
|
-
/** 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 });
|
|
365
|
-
}
|
|
366
366
|
/** Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
|
|
367
367
|
getUserGifts(params: Omit<t.GetUserGiftsParams, "user_id">) {
|
|
368
368
|
return this.api.call<t.OwnedGifts>("getUserGifts", { user_id: this.from?.id, ...params });
|
|
@@ -399,10 +399,6 @@ export class ChannelPostContextBase {
|
|
|
399
399
|
stopMessageLiveLocation(params: Omit<t.StopMessageLiveLocationParams, "chat_id" | "message_id">) {
|
|
400
400
|
return this.api.call<t.Message | boolean>("stopMessageLiveLocation", { chat_id: this.chat.id, message_id: this.message_id, ...params });
|
|
401
401
|
}
|
|
402
|
-
/** 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 });
|
|
405
|
-
}
|
|
406
402
|
/** 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
403
|
editReplyMarkup(params: Omit<t.EditMessageReplyMarkupParams, "chat_id" | "message_id">) {
|
|
408
404
|
return this.api.call<t.Message | boolean>("editMessageReplyMarkup", { chat_id: this.chat.id, message_id: this.message_id, ...params });
|
|
@@ -436,8 +432,8 @@ export class ChannelPostContextBase {
|
|
|
436
432
|
return this.api.call<boolean>("deleteAllMessageReactions", { chat_id: this.chat.id, user_id: this.from?.id, ...params });
|
|
437
433
|
}
|
|
438
434
|
/** 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 });
|
|
435
|
+
sendSticker(params: Omit<t.SendStickerParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
436
|
+
return this.api.call<t.Message>("sendSticker", { 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
437
|
}
|
|
442
438
|
/** 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
439
|
uploadStickerFile(params: Omit<t.UploadStickerFileParams, "user_id">) {
|
|
@@ -460,16 +456,16 @@ export class ChannelPostContextBase {
|
|
|
460
456
|
return this.api.call<boolean>("setStickerSetThumbnail", { user_id: this.from?.id, ...params });
|
|
461
457
|
}
|
|
462
458
|
/** 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 });
|
|
459
|
+
sendRichMessage(params: Omit<t.SendRichMessageParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
460
|
+
return this.api.call<t.Message>("sendRichMessage", { 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
461
|
}
|
|
466
462
|
/** 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 });
|
|
463
|
+
sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id" | "message_thread_id">) {
|
|
464
|
+
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
465
|
}
|
|
470
466
|
/** 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 });
|
|
467
|
+
sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id" | "message_thread_id" | "direct_messages_topic_id">) {
|
|
468
|
+
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 });
|
|
473
469
|
}
|
|
474
470
|
/** Refunds a successful payment in [Telegram Stars](https://t.me/BotNews/90). Returns *True* on success. */
|
|
475
471
|
refundStarPayment(params: Omit<t.RefundStarPaymentParams, "user_id">) {
|
|
@@ -484,8 +480,8 @@ export class ChannelPostContextBase {
|
|
|
484
480
|
return this.api.call<boolean>("setPassportDataErrors", { user_id: this.from?.id, ...params });
|
|
485
481
|
}
|
|
486
482
|
/** 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 });
|
|
483
|
+
sendGame(params: Omit<t.SendGameParams, "chat_id" | "message_thread_id">) {
|
|
484
|
+
return this.api.call<t.Message>("sendGame", { chat_id: this.chat.id, ...((this.message_thread_id) === undefined ? {} : { message_thread_id: this.message_thread_id }), ...params });
|
|
489
485
|
}
|
|
490
486
|
/** 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
487
|
setGameScore(params: Omit<t.SetGameScoreParams, "user_id" | "chat_id" | "message_id">) {
|
|
@@ -83,10 +83,6 @@ export class ChatBoostContext {
|
|
|
83
83
|
sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
|
|
84
84
|
return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...params });
|
|
85
85
|
}
|
|
86
|
-
/** 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. */
|
|
87
|
-
sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
|
|
88
|
-
return this.api.call<t.Message>("sendChecklist", { chat_id: this.chat.id, ...params });
|
|
89
|
-
}
|
|
90
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. */
|
|
91
87
|
sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
|
|
92
88
|
return this.api.call<t.Message>("sendDice", { chat_id: this.chat.id, ...params });
|
|
@@ -187,26 +183,6 @@ export class ChatBoostContext {
|
|
|
187
183
|
createForumTopic(params: Omit<t.CreateForumTopicParams, "chat_id">) {
|
|
188
184
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
|
|
189
185
|
}
|
|
190
|
-
/** 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. */
|
|
191
|
-
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
|
|
192
|
-
return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...params });
|
|
193
|
-
}
|
|
194
|
-
/** 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. */
|
|
195
|
-
closeForumTopic(params: Omit<t.CloseForumTopicParams, "chat_id">) {
|
|
196
|
-
return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...params });
|
|
197
|
-
}
|
|
198
|
-
/** 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. */
|
|
199
|
-
reopenForumTopic(params: Omit<t.ReopenForumTopicParams, "chat_id">) {
|
|
200
|
-
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
|
|
201
|
-
}
|
|
202
|
-
/** 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. */
|
|
203
|
-
deleteForumTopic(params: Omit<t.DeleteForumTopicParams, "chat_id">) {
|
|
204
|
-
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
|
|
205
|
-
}
|
|
206
|
-
/** 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. */
|
|
207
|
-
unpinAllForumTopicMessages(params: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id">) {
|
|
208
|
-
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
|
|
209
|
-
}
|
|
210
186
|
/** 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. */
|
|
211
187
|
editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
|
|
212
188
|
return this.api.call<boolean>("editGeneralForumTopic", { chat_id: this.chat.id, ...params });
|
|
@@ -91,10 +91,6 @@ export class ChatJoinRequestContextBase {
|
|
|
91
91
|
sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
|
|
92
92
|
return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...params });
|
|
93
93
|
}
|
|
94
|
-
/** 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. */
|
|
95
|
-
sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
|
|
96
|
-
return this.api.call<t.Message>("sendChecklist", { chat_id: this.chat.id, ...params });
|
|
97
|
-
}
|
|
98
94
|
/** 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. */
|
|
99
95
|
sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
|
|
100
96
|
return this.api.call<t.Message>("sendDice", { chat_id: this.chat.id, ...params });
|
|
@@ -247,26 +243,6 @@ export class ChatJoinRequestContextBase {
|
|
|
247
243
|
createForumTopic(params: Omit<t.CreateForumTopicParams, "chat_id">) {
|
|
248
244
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
|
|
249
245
|
}
|
|
250
|
-
/** 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. */
|
|
251
|
-
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
|
|
252
|
-
return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...params });
|
|
253
|
-
}
|
|
254
|
-
/** 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. */
|
|
255
|
-
closeForumTopic(params: Omit<t.CloseForumTopicParams, "chat_id">) {
|
|
256
|
-
return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...params });
|
|
257
|
-
}
|
|
258
|
-
/** 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. */
|
|
259
|
-
reopenForumTopic(params: Omit<t.ReopenForumTopicParams, "chat_id">) {
|
|
260
|
-
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
|
|
261
|
-
}
|
|
262
|
-
/** 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. */
|
|
263
|
-
deleteForumTopic(params: Omit<t.DeleteForumTopicParams, "chat_id">) {
|
|
264
|
-
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
|
|
265
|
-
}
|
|
266
|
-
/** 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. */
|
|
267
|
-
unpinAllForumTopicMessages(params: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id">) {
|
|
268
|
-
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
|
|
269
|
-
}
|
|
270
246
|
/** 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. */
|
|
271
247
|
editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
|
|
272
248
|
return this.api.call<boolean>("editGeneralForumTopic", { chat_id: this.chat.id, ...params });
|
|
@@ -91,10 +91,6 @@ export class ChatMemberContext {
|
|
|
91
91
|
sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
|
|
92
92
|
return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...params });
|
|
93
93
|
}
|
|
94
|
-
/** 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. */
|
|
95
|
-
sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
|
|
96
|
-
return this.api.call<t.Message>("sendChecklist", { chat_id: this.chat.id, ...params });
|
|
97
|
-
}
|
|
98
94
|
/** 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. */
|
|
99
95
|
sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
|
|
100
96
|
return this.api.call<t.Message>("sendDice", { chat_id: this.chat.id, ...params });
|
|
@@ -247,26 +243,6 @@ export class ChatMemberContext {
|
|
|
247
243
|
createForumTopic(params: Omit<t.CreateForumTopicParams, "chat_id">) {
|
|
248
244
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
|
|
249
245
|
}
|
|
250
|
-
/** 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. */
|
|
251
|
-
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
|
|
252
|
-
return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...params });
|
|
253
|
-
}
|
|
254
|
-
/** 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. */
|
|
255
|
-
closeForumTopic(params: Omit<t.CloseForumTopicParams, "chat_id">) {
|
|
256
|
-
return this.api.call<boolean>("closeForumTopic", { chat_id: this.chat.id, ...params });
|
|
257
|
-
}
|
|
258
|
-
/** 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. */
|
|
259
|
-
reopenForumTopic(params: Omit<t.ReopenForumTopicParams, "chat_id">) {
|
|
260
|
-
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
|
|
261
|
-
}
|
|
262
|
-
/** 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. */
|
|
263
|
-
deleteForumTopic(params: Omit<t.DeleteForumTopicParams, "chat_id">) {
|
|
264
|
-
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
|
|
265
|
-
}
|
|
266
|
-
/** 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. */
|
|
267
|
-
unpinAllForumTopicMessages(params: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id">) {
|
|
268
|
-
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
|
|
269
|
-
}
|
|
270
246
|
/** 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. */
|
|
271
247
|
editGeneralForumTopic(params: Omit<t.EditGeneralForumTopicParams, "chat_id">) {
|
|
272
248
|
return this.api.call<boolean>("editGeneralForumTopic", { chat_id: this.chat.id, ...params });
|