telegram-bot-api-nodejs 1.0.11 → 1.0.13
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 +7 -17
- package/index.js +4 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ export interface User {
|
|
|
117
117
|
last_name?: string;
|
|
118
118
|
username?: string;
|
|
119
119
|
language_code?: string;
|
|
120
|
-
is_premium
|
|
120
|
+
is_premium: boolean;
|
|
121
121
|
can_join_groups?: boolean;
|
|
122
122
|
supports_inline_queries?: boolean;
|
|
123
123
|
can_read_all_group_messages?: boolean;
|
|
@@ -441,6 +441,8 @@ export interface Sticker {
|
|
|
441
441
|
file_id: string;
|
|
442
442
|
width: number;
|
|
443
443
|
height: number;
|
|
444
|
+
thumbnail?: PhotoSize;
|
|
445
|
+
/** @deprecated */
|
|
444
446
|
thumb?: PhotoSize;
|
|
445
447
|
emoji?: string;
|
|
446
448
|
set_name?: string;
|
|
@@ -524,7 +526,9 @@ export interface Animation extends FileBase {
|
|
|
524
526
|
width: number;
|
|
525
527
|
height: number;
|
|
526
528
|
duration: number;
|
|
529
|
+
/** @deprecated */
|
|
527
530
|
thumb?: PhotoSize;
|
|
531
|
+
thumbnail?: PhotoSize;
|
|
528
532
|
file_name?: string;
|
|
529
533
|
mime_type?: string;
|
|
530
534
|
}
|
|
@@ -579,14 +583,7 @@ export declare function deleteMyCommands(token: string, payload: DeleteMyCommand
|
|
|
579
583
|
*/
|
|
580
584
|
export declare function parseUpdate(update: any): Update;
|
|
581
585
|
export declare function parseMessage(m: any): Message;
|
|
582
|
-
export declare function parseUser(u: User):
|
|
583
|
-
id: string;
|
|
584
|
-
is_bot: boolean;
|
|
585
|
-
first_name: string;
|
|
586
|
-
last_name: string;
|
|
587
|
-
username: string;
|
|
588
|
-
language_code: string;
|
|
589
|
-
};
|
|
586
|
+
export declare function parseUser(u: User): User;
|
|
590
587
|
export declare function parseChat(c: Chat): {
|
|
591
588
|
id: number;
|
|
592
589
|
type: ChatType;
|
|
@@ -616,14 +613,7 @@ export declare function parseVideoNote(v: VideoNote): VideoNote;
|
|
|
616
613
|
export declare function parseEntities(v: MessageEntity[]): MessageEntity[];
|
|
617
614
|
export declare function parseAudio(v: Audio): Audio;
|
|
618
615
|
export declare function parseDocument(v: Document): Document;
|
|
619
|
-
export declare function parseAnimation(v: Animation):
|
|
620
|
-
file_id: string;
|
|
621
|
-
width: number;
|
|
622
|
-
height: number;
|
|
623
|
-
duration: number;
|
|
624
|
-
file_name: string;
|
|
625
|
-
mime_type: string;
|
|
626
|
-
};
|
|
616
|
+
export declare function parseAnimation(v: Animation): Animation;
|
|
627
617
|
export declare function parseContact(v: Contact): {
|
|
628
618
|
phone_number: string;
|
|
629
619
|
first_name: string;
|
package/index.js
CHANGED
|
@@ -234,6 +234,7 @@ export function parseUser(u) {
|
|
|
234
234
|
last_name: String(u.last_name ?? ""),
|
|
235
235
|
username: String(u.username ?? ""),
|
|
236
236
|
language_code: String(u.language_code ?? ""),
|
|
237
|
+
is_premium: Boolean(u.is_premium ?? ""),
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
240
|
export function parseChat(c) {
|
|
@@ -267,6 +268,7 @@ export function parseSticker(v) {
|
|
|
267
268
|
width: Number(v.width),
|
|
268
269
|
height: Number(v.height),
|
|
269
270
|
thumb: v.thumb ? parsePhotoSize(v.thumb) : void 0,
|
|
271
|
+
thumbnail: v.thumbnail ? parsePhotoSize(v.thumbnail) : void 0,
|
|
270
272
|
emoji: String(v.emoji),
|
|
271
273
|
};
|
|
272
274
|
}
|
|
@@ -338,6 +340,8 @@ export function parseAnimation(v) {
|
|
|
338
340
|
duration: Number(v.duration),
|
|
339
341
|
file_name: String(v.file_name),
|
|
340
342
|
mime_type: String(v.mime_type || ""),
|
|
343
|
+
thumb: v.thumb ? parsePhotoSize(v.thumb) : void 0,
|
|
344
|
+
thumbnail: v.thumbnail ? parsePhotoSize(v.thumbnail) : void 0,
|
|
341
345
|
};
|
|
342
346
|
}
|
|
343
347
|
export function parseContact(v) {
|