telegram-bot-api-nodejs 1.2.3 → 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.
Files changed (3) hide show
  1. package/index.d.ts +16 -15
  2. package/index.js +4 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1166,21 +1166,22 @@ export declare class TelegramError extends Error {
1166
1166
  */
1167
1167
  export declare function fetch(url: string, param?: RequestInit): Promise<Response>;
1168
1168
  export declare const SUPPORTED_REACTION_EMOJI: string[];
1169
- export declare function isUnauthorizedError(err: unknown): boolean;
1170
- export declare function isBotBlockedByUserError(err: unknown): boolean;
1171
- export declare function isChatNotFoundError(err: unknown): boolean;
1172
- export declare function isUserDeactivatedError(err: unknown): boolean;
1173
- export declare function isBotKickedFromSupergroupError(err: unknown): boolean;
1174
- export declare function isNotEnoughRightsError(err: unknown): boolean;
1175
- export declare function isUpgradeToSupergroupChatError(err: unknown): boolean;
1176
- export declare function isTextMustBeNonEmptyError(err: unknown): boolean;
1177
- export declare function isTooManyRequestsError(err: unknown): boolean;
1178
- export declare function isMessageTooLongError(err: unknown): boolean;
1179
- export declare function isMessageCaptionTooLongError(err: unknown): boolean;
1180
- export declare function isWebpageCurlFailedError(err: unknown): boolean;
1181
- export declare function isWrongFileUrlError(err: unknown): boolean;
1182
- export declare function isBadGatewayError(err: unknown): boolean;
1183
- export declare function isMessageToEditNotFoundError(err: unknown): boolean;
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;
1184
1185
  export declare function isMessageToDeleteNotFoundError(err: unknown): boolean;
1185
1186
  export declare function isMessageNotModifiedError(err: unknown): boolean;
1186
1187
  export declare function isWrongTypeOfTheWebPageContentError(err: unknown): boolean;
package/index.js CHANGED
@@ -569,7 +569,10 @@ export function isUserDeactivatedError(err) {
569
569
  return err instanceof Error && err.message.includes("Forbidden: user is deactivated");
570
570
  }
571
571
  export function isBotKickedFromSupergroupError(err) {
572
- return err instanceof Error && err.message.includes("Forbidden: bot was kicked from the supergroup chat");
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";
573
576
  }
574
577
  export function isNotEnoughRightsError(err) {
575
578
  return err instanceof Error && err.message.includes("Bad Request: not enough rights to send text messages to the chat");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-bot-api-nodejs",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Telegram Bot API client for nodejs",
5
5
  "type": "module",
6
6
  "main": "index.js",