telegram-bot-api-nodejs 1.0.55 → 1.0.57

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 (2) hide show
  1. package/index.js +9 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -555,14 +555,19 @@ export class TelegramError extends Error {
555
555
  export function fetch(url, param) {
556
556
  const start = Date.now();
557
557
  return global.fetch(url, param).catch(function (cause) {
558
- const status = 0;
559
- const data = {
558
+ throw new TelegramFetchDebugError(cause.message, { cause }, {
560
559
  url: removeTokenFromUrl(url),
561
560
  duration: Date.now() - start
562
- };
563
- throw new TelegramError(cause.message, status, data, { cause });
561
+ });
564
562
  });
565
563
  }
564
+ class TelegramFetchDebugError extends Error {
565
+ data;
566
+ constructor(message, options, data) {
567
+ super(message, options);
568
+ this.data = data;
569
+ }
570
+ }
566
571
  export const SUPPORTED_REACTION_EMOJI = ["👍", "👎", "\u2764\ufe0f" // red heart
567
572
  ,
568
573
  "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-bot-api-nodejs",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "Telegram Bot API client for nodejs",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -24,7 +24,7 @@
24
24
  "author": "",
25
25
  "license": "ISC",
26
26
  "devDependencies": {
27
- "@types/node": "^22.10.1",
27
+ "@types/node": "^22.10.2",
28
28
  "typescript": "^5.7.2"
29
29
  }
30
30
  }