telegram-bot-api-nodejs 1.2.1 → 1.2.3

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 +5 -0
  2. package/index.js +5 -8
  3. package/package.json +3 -3
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;
@@ -1183,6 +1187,7 @@ export declare function isWrongTypeOfTheWebPageContentError(err: unknown): boole
1183
1187
  export declare function isFailToGetHTTPURLContentError(err: unknown): boolean;
1184
1188
  export declare function isWrongFileIdentifierError(err: unknown): boolean;
1185
1189
  export declare function isInvalidFileUrlSpecifiedError(err: unknown): boolean;
1190
+ export declare function isMessageDeleteError(err: unknown): boolean;
1186
1191
  export declare function parseRetryAfterTime(err: unknown): number;
1187
1192
  export declare function resolveNameFromMessageOrigin(messageOrigin: MessageOrigin): string;
1188
1193
  export declare function resolveChatName(chat: any): string;
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 {
@@ -632,6 +625,10 @@ export function isWrongFileIdentifierError(err) {
632
625
  export function isInvalidFileUrlSpecifiedError(err) {
633
626
  return err instanceof Error && err.message.includes("invalid file HTTP URL specified: Unsupported URL protocol");
634
627
  }
628
+ // Bad Request: message can't be deleted
629
+ export function isMessageDeleteError(err) {
630
+ return err instanceof Error && err.message.includes("message can't be deleted");
631
+ }
635
632
  export function parseRetryAfterTime(err) {
636
633
  if (!(err instanceof Error)) {
637
634
  throw new RangeError("`err` needs to be an Error");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-bot-api-nodejs",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Telegram Bot API client for nodejs",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -25,9 +25,9 @@
25
25
  "author": "",
26
26
  "license": "ISC",
27
27
  "devDependencies": {
28
- "@types/node": "^22.15.17"
28
+ "@types/node": "^24.10.0"
29
29
  },
30
30
  "dependencies": {
31
- "@typescript/native-preview": "^7.0.0-dev.20251013.1"
31
+ "@typescript/native-preview": "^7.0.0-dev.20251104.1"
32
32
  }
33
33
  }