telegram-bot-api-nodejs 1.0.48 → 1.0.49
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 +3 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1073,6 +1073,9 @@ export declare function getFile(token: string, payload: {
|
|
|
1073
1073
|
file_id: string;
|
|
1074
1074
|
}, signal: AbortSignal): Promise<File>;
|
|
1075
1075
|
export declare function answerCallbackQuery(token: string, payload: AnswerCallbackQueryOptions, signal: AbortSignal): Promise<File>;
|
|
1076
|
+
export declare function leaveChat(token: string, payload: {
|
|
1077
|
+
chat_id: string;
|
|
1078
|
+
}, signal: AbortSignal): Promise<true>;
|
|
1076
1079
|
export declare function getChat(token: string, payload: {
|
|
1077
1080
|
chat_id: string;
|
|
1078
1081
|
}, signal: AbortSignal): Promise<Chat>;
|
package/index.js
CHANGED
|
@@ -151,6 +151,14 @@ export function answerCallbackQuery(token, payload, signal) {
|
|
|
151
151
|
signal
|
|
152
152
|
}).then((parseResponse));
|
|
153
153
|
}
|
|
154
|
+
export function leaveChat(token, payload, signal) {
|
|
155
|
+
return fetch(`https://api.telegram.org/bot${token}/leaveChat`, {
|
|
156
|
+
method: "POST",
|
|
157
|
+
body: JSON.stringify(payload),
|
|
158
|
+
headers,
|
|
159
|
+
signal
|
|
160
|
+
}).then((parseResponse));
|
|
161
|
+
}
|
|
154
162
|
export function getChat(token, payload, signal) {
|
|
155
163
|
return fetch(`https://api.telegram.org/bot${token}/getChat`, {
|
|
156
164
|
method: "POST",
|