telegram-bot-api-nodejs 1.2.2 → 1.2.4
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 +20 -15
- package/index.js +5 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -686,8 +686,12 @@ export interface ChatPermissions {
|
|
|
686
686
|
}
|
|
687
687
|
export interface Sticker {
|
|
688
688
|
file_id: string;
|
|
689
|
+
file_unique_id: string;
|
|
690
|
+
type: "regular" | "mask" | "custom_emoji";
|
|
689
691
|
width: number;
|
|
690
692
|
height: number;
|
|
693
|
+
is_animated: boolean;
|
|
694
|
+
is_video: boolean;
|
|
691
695
|
thumbnail?: PhotoSize;
|
|
692
696
|
/** @deprecated */
|
|
693
697
|
thumb?: PhotoSize;
|
|
@@ -1162,21 +1166,22 @@ export declare class TelegramError extends Error {
|
|
|
1162
1166
|
*/
|
|
1163
1167
|
export declare function fetch(url: string, param?: RequestInit): Promise<Response>;
|
|
1164
1168
|
export declare const SUPPORTED_REACTION_EMOJI: string[];
|
|
1165
|
-
export declare function isUnauthorizedError(err: unknown):
|
|
1166
|
-
export declare function isBotBlockedByUserError(err: unknown):
|
|
1167
|
-
export declare function isChatNotFoundError(err: unknown):
|
|
1168
|
-
export declare function isUserDeactivatedError(err: unknown):
|
|
1169
|
-
export declare function isBotKickedFromSupergroupError(err: unknown):
|
|
1170
|
-
export declare function
|
|
1171
|
-
export declare function
|
|
1172
|
-
export declare function
|
|
1173
|
-
export declare function
|
|
1174
|
-
export declare function
|
|
1175
|
-
export declare function
|
|
1176
|
-
export declare function
|
|
1177
|
-
export declare function
|
|
1178
|
-
export declare function
|
|
1179
|
-
export declare function
|
|
1169
|
+
export declare function isUnauthorizedError(err: unknown): err is Error;
|
|
1170
|
+
export declare function isBotBlockedByUserError(err: unknown): err is Error;
|
|
1171
|
+
export declare function isChatNotFoundError(err: unknown): err is Error;
|
|
1172
|
+
export declare function isUserDeactivatedError(err: unknown): err is Error;
|
|
1173
|
+
export declare function isBotKickedFromSupergroupError(err: unknown): err is Error;
|
|
1174
|
+
export declare function isBotKickedFromGroupError(err: unknown): err is Error;
|
|
1175
|
+
export declare function isNotEnoughRightsError(err: unknown): err is Error;
|
|
1176
|
+
export declare function isUpgradeToSupergroupChatError(err: unknown): err is Error;
|
|
1177
|
+
export declare function isTextMustBeNonEmptyError(err: unknown): err is Error;
|
|
1178
|
+
export declare function isTooManyRequestsError(err: unknown): err is Error;
|
|
1179
|
+
export declare function isMessageTooLongError(err: unknown): err is Error;
|
|
1180
|
+
export declare function isMessageCaptionTooLongError(err: unknown): err is Error;
|
|
1181
|
+
export declare function isWebpageCurlFailedError(err: unknown): err is Error;
|
|
1182
|
+
export declare function isWrongFileUrlError(err: unknown): err is Error;
|
|
1183
|
+
export declare function isBadGatewayError(err: unknown): err is Error;
|
|
1184
|
+
export declare function isMessageToEditNotFoundError(err: unknown): err is Error;
|
|
1180
1185
|
export declare function isMessageToDeleteNotFoundError(err: unknown): boolean;
|
|
1181
1186
|
export declare function isMessageNotModifiedError(err: unknown): boolean;
|
|
1182
1187
|
export declare function isWrongTypeOfTheWebPageContentError(err: unknown): boolean;
|
package/index.js
CHANGED
|
@@ -302,14 +302,7 @@ function parsePhotoSize(p) {
|
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
304
|
function parseSticker(v) {
|
|
305
|
-
return
|
|
306
|
-
file_id: String(v.file_id),
|
|
307
|
-
width: Number(v.width),
|
|
308
|
-
height: Number(v.height),
|
|
309
|
-
thumb: v.thumb ? parsePhotoSize(v.thumb) : void 0,
|
|
310
|
-
thumbnail: v.thumbnail ? parsePhotoSize(v.thumbnail) : void 0,
|
|
311
|
-
emoji: String(v.emoji),
|
|
312
|
-
};
|
|
305
|
+
return v;
|
|
313
306
|
}
|
|
314
307
|
function parseVideo(v) {
|
|
315
308
|
return {
|
|
@@ -576,7 +569,10 @@ export function isUserDeactivatedError(err) {
|
|
|
576
569
|
return err instanceof Error && err.message.includes("Forbidden: user is deactivated");
|
|
577
570
|
}
|
|
578
571
|
export function isBotKickedFromSupergroupError(err) {
|
|
579
|
-
return err instanceof Error && err.message
|
|
572
|
+
return err instanceof Error && err.message === "Forbidden: bot was kicked from the supergroup chat";
|
|
573
|
+
}
|
|
574
|
+
export function isBotKickedFromGroupError(err) {
|
|
575
|
+
return err instanceof Error && err.message === "Forbidden: bot was kicked from the group chat";
|
|
580
576
|
}
|
|
581
577
|
export function isNotEnoughRightsError(err) {
|
|
582
578
|
return err instanceof Error && err.message.includes("Bad Request: not enough rights to send text messages to the chat");
|