telegram-bot-api-nodejs 1.0.15 → 1.0.16
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/index.d.ts +28 -0
- package/index.js +3 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface SetWebHookOptions {
|
|
|
13
13
|
}
|
|
14
14
|
interface SendBasicOptions {
|
|
15
15
|
chat_id: number | string;
|
|
16
|
+
message_thread_id?: number;
|
|
16
17
|
disable_notification?: boolean;
|
|
17
18
|
reply_to_message_id?: number | string;
|
|
18
19
|
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
@@ -129,6 +130,7 @@ export interface Chat {
|
|
|
129
130
|
username?: string;
|
|
130
131
|
first_name?: string;
|
|
131
132
|
last_name?: string;
|
|
133
|
+
is_forum?: boolean;
|
|
132
134
|
photo?: ChatPhoto;
|
|
133
135
|
bio?: string;
|
|
134
136
|
description?: string;
|
|
@@ -138,11 +140,29 @@ export interface Chat {
|
|
|
138
140
|
can_set_sticker_set?: boolean;
|
|
139
141
|
sticker_set_name?: string;
|
|
140
142
|
}
|
|
143
|
+
interface ForumTopicCreated {
|
|
144
|
+
name: string;
|
|
145
|
+
icon_color: number;
|
|
146
|
+
icon_custom_emoji_id?: string;
|
|
147
|
+
}
|
|
148
|
+
interface ForumTopicEdited {
|
|
149
|
+
name?: string;
|
|
150
|
+
icon_custom_emoji_id?: string;
|
|
151
|
+
}
|
|
152
|
+
interface ForumTopicClosed {
|
|
153
|
+
}
|
|
154
|
+
interface ForumTopicReopened {
|
|
155
|
+
}
|
|
156
|
+
interface GeneralForumTopicHidden {
|
|
157
|
+
}
|
|
158
|
+
interface GeneralForumTopicUnhidden {
|
|
159
|
+
}
|
|
141
160
|
/**
|
|
142
161
|
* @docs https://core.telegram.org/bots/api#message
|
|
143
162
|
*/
|
|
144
163
|
export interface Message {
|
|
145
164
|
message_id: number;
|
|
165
|
+
message_thread_id?: number;
|
|
146
166
|
from?: User;
|
|
147
167
|
date: number;
|
|
148
168
|
chat: Chat;
|
|
@@ -152,6 +172,8 @@ export interface Message {
|
|
|
152
172
|
forward_signature?: string;
|
|
153
173
|
forward_sender_name?: string;
|
|
154
174
|
forward_date?: number;
|
|
175
|
+
is_topic_message?: boolean;
|
|
176
|
+
is_automatic_forward?: boolean;
|
|
155
177
|
reply_to_message?: Message;
|
|
156
178
|
edit_date?: number;
|
|
157
179
|
media_group_id?: string;
|
|
@@ -190,6 +212,12 @@ export interface Message {
|
|
|
190
212
|
passport_data?: PassportData;
|
|
191
213
|
reply_markup?: InlineKeyboardMarkup;
|
|
192
214
|
sender_chat?: Chat;
|
|
215
|
+
forum_topic_created?: ForumTopicCreated;
|
|
216
|
+
forum_topic_edited?: ForumTopicEdited;
|
|
217
|
+
forum_topic_closed?: ForumTopicClosed;
|
|
218
|
+
forum_topic_reopened?: ForumTopicReopened;
|
|
219
|
+
general_forum_topic_hidden?: GeneralForumTopicHidden;
|
|
220
|
+
general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
|
|
193
221
|
}
|
|
194
222
|
export interface MessageReactionUpdated {
|
|
195
223
|
chat: Chat;
|
package/index.js
CHANGED
|
@@ -200,6 +200,7 @@ export function parseUpdate(update) {
|
|
|
200
200
|
}
|
|
201
201
|
export function parseMessage(m) {
|
|
202
202
|
return {
|
|
203
|
+
...m,
|
|
203
204
|
message_id: Number(m.message_id),
|
|
204
205
|
from: m.from ? parseUser(m.from) : void 0,
|
|
205
206
|
date: Number(m.date),
|
|
@@ -211,7 +212,8 @@ export function parseMessage(m) {
|
|
|
211
212
|
forward_signature: m.forward_signature ? String(m.forward_signature) : void 0, // string;
|
|
212
213
|
forward_sender_name: m.forward_sender_name ? String(m.forward_sender_name) : void 0, // string;
|
|
213
214
|
forward_date: m.forward_date ? Number(m.forward_date) : void 0, // number;
|
|
214
|
-
|
|
215
|
+
reply_to_message: m.reply_to_message ? parseMessage(m.reply_to_message) : void 0,
|
|
216
|
+
is_automatic_forward: m.is_automatic_forward != null ? Boolean(m.is_automatic_forward) : void 0,
|
|
215
217
|
edit_date: m.edit_date ? Number(m.edit_date) : void 0, // number;
|
|
216
218
|
media_group_id: m.media_group_id ? String(m.media_group_id) : void 0, // string;
|
|
217
219
|
author_signature: m.author_signature ? String(m.author_signature) : void 0, // string;
|