telegram-bot-api-nodejs 1.0.41 → 1.0.43
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 +10 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -208,6 +208,11 @@ export interface Chat {
|
|
|
208
208
|
can_set_sticker_set?: boolean;
|
|
209
209
|
sticker_set_name?: string;
|
|
210
210
|
}
|
|
211
|
+
export interface WriteAccessAllowed {
|
|
212
|
+
from_request?: boolean;
|
|
213
|
+
web_app_name?: string;
|
|
214
|
+
from_attachment_menu?: boolean;
|
|
215
|
+
}
|
|
211
216
|
export interface ChatBoostAdded {
|
|
212
217
|
boost_count: number;
|
|
213
218
|
}
|
|
@@ -302,6 +307,7 @@ export interface Message {
|
|
|
302
307
|
passport_data?: PassportData;
|
|
303
308
|
reply_markup?: InlineKeyboardMarkup;
|
|
304
309
|
sender_chat?: Chat;
|
|
310
|
+
write_access_allowed: WriteAccessAllowed;
|
|
305
311
|
boost_added?: ChatBoostAdded;
|
|
306
312
|
forum_topic_created?: ForumTopicCreated;
|
|
307
313
|
forum_topic_edited?: ForumTopicEdited;
|
|
@@ -1025,6 +1031,10 @@ export declare function getWebhookInfo(token: string, signal: AbortSignal): Prom
|
|
|
1025
1031
|
export declare function getMe(token: string, signal: AbortSignal): Promise<User>;
|
|
1026
1032
|
export declare function sendMessage(token: string, payload: SendMessageOptions, signal: AbortSignal): Promise<Message>;
|
|
1027
1033
|
export declare function editMessageText(token: string, payload: EditMessageTextOptions, signal: AbortSignal): Promise<Message>;
|
|
1034
|
+
export declare function deleteMessage(token: string, payload: {
|
|
1035
|
+
chat_id: string | number;
|
|
1036
|
+
message_id: number;
|
|
1037
|
+
}, signal: AbortSignal): Promise<{}>;
|
|
1028
1038
|
export declare function sendPhoto(token: string, payload: SendBasicOptions & {
|
|
1029
1039
|
photo: string;
|
|
1030
1040
|
caption?: string;
|
package/index.js
CHANGED
|
@@ -55,6 +55,14 @@ export function editMessageText(token, payload, signal) {
|
|
|
55
55
|
signal
|
|
56
56
|
}).then((parseResponse));
|
|
57
57
|
}
|
|
58
|
+
export function deleteMessage(token, payload, signal) {
|
|
59
|
+
return fetch(`https://api.telegram.org/bot${token}/deleteMessage`, {
|
|
60
|
+
method: "POST",
|
|
61
|
+
body: JSON.stringify(payload),
|
|
62
|
+
headers,
|
|
63
|
+
signal
|
|
64
|
+
}).then((parseResponse));
|
|
65
|
+
}
|
|
58
66
|
export function sendPhoto(token, payload, signal) {
|
|
59
67
|
return fetch(`https://api.telegram.org/bot${token}/sendPhoto`, {
|
|
60
68
|
method: "POST",
|