telegram-bot-api-nodejs 1.0.74 → 1.0.76
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 +12 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -244,6 +244,12 @@ export interface Giveaway {
|
|
|
244
244
|
prize_star_count?: number;
|
|
245
245
|
premium_subscription_month_count?: number;
|
|
246
246
|
}
|
|
247
|
+
export interface GiveawayWinners {
|
|
248
|
+
winner_count?: number;
|
|
249
|
+
prize_star_count?: number;
|
|
250
|
+
prize_description?: string;
|
|
251
|
+
winners_selection_date?: string;
|
|
252
|
+
}
|
|
247
253
|
export interface VideoChatScheduled {
|
|
248
254
|
start_date: number;
|
|
249
255
|
}
|
|
@@ -321,6 +327,7 @@ export interface Message {
|
|
|
321
327
|
general_forum_topic_hidden?: GeneralForumTopicHidden;
|
|
322
328
|
general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
|
|
323
329
|
giveaway?: Giveaway;
|
|
330
|
+
giveaway_winners?: GiveawayWinners;
|
|
324
331
|
video_chat_scheduled?: VideoChatScheduled;
|
|
325
332
|
video_chat_started?: VideoChatStarted;
|
|
326
333
|
video_chat_ended?: VideoChatEnded;
|
|
@@ -1072,6 +1079,11 @@ export declare function sendAnimation(token: string, payload: SendAnimationOptio
|
|
|
1072
1079
|
* sendDocument("token", payload)
|
|
1073
1080
|
*/
|
|
1074
1081
|
export declare function sendDocument(token: string, payload: SendDocumentOptions | FormData, signal: AbortSignal): Promise<Message>;
|
|
1082
|
+
export declare function sendVideo(token: string, payload: SendBasicOptions & {
|
|
1083
|
+
video: string;
|
|
1084
|
+
caption?: string;
|
|
1085
|
+
parse_mode?: ParseMode;
|
|
1086
|
+
}, signal: AbortSignal): Promise<Message>;
|
|
1075
1087
|
export declare function sendVoice(token: string, payload: SendBasicOptions & {
|
|
1076
1088
|
voice: string;
|
|
1077
1089
|
caption?: string;
|
package/index.js
CHANGED
|
@@ -119,6 +119,14 @@ export function sendDocument(token, payload, signal) {
|
|
|
119
119
|
signal
|
|
120
120
|
}).then((parseResponse));
|
|
121
121
|
}
|
|
122
|
+
export function sendVideo(token, payload, signal) {
|
|
123
|
+
return fetch(`https://api.telegram.org/bot${token}/sendVideo`, {
|
|
124
|
+
method: "POST",
|
|
125
|
+
body: JSON.stringify(payload),
|
|
126
|
+
headers,
|
|
127
|
+
signal
|
|
128
|
+
}).then((parseResponse));
|
|
129
|
+
}
|
|
122
130
|
export function sendVoice(token, payload, signal) {
|
|
123
131
|
return fetch(`https://api.telegram.org/bot${token}/sendVoice`, {
|
|
124
132
|
method: "POST",
|