telegram-bot-api-nodejs 1.0.4 → 1.0.7

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 +3 -3
  2. package/index.js +5 -5
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -617,9 +617,9 @@ export declare function parsePollOption(v: PollOption): {
617
617
  export declare function parseCallbackQuery(v?: CallbackQuery): CallbackQuery | undefined;
618
618
  export declare function parseResponse<T>(response: Response): Promise<T>;
619
619
  export declare class TelegramError extends Error {
620
- error_code: number;
621
- parameters: Record<string, any>;
622
- constructor(message: string, error_code: number, parameters?: Record<string, any>);
620
+ status: number;
621
+ data: Record<string, any>;
622
+ constructor(message: string, status: number, data?: Record<string, any>);
623
623
  }
624
624
  /**
625
625
  * Helpers
package/index.js CHANGED
@@ -467,12 +467,12 @@ export function parseResponse(response) {
467
467
  });
468
468
  }
469
469
  export class TelegramError extends Error {
470
- error_code;
471
- parameters;
472
- constructor(message, error_code, parameters = {}) {
470
+ status;
471
+ data;
472
+ constructor(message, status, data = {}) {
473
473
  super(message);
474
- this.error_code = error_code;
475
- this.parameters = parameters;
474
+ this.status = status;
475
+ this.data = data;
476
476
  }
477
477
  }
478
478
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telegram-bot-api-nodejs",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "Telegram Bot API client for nodejs",
5
5
  "type": "module",
6
6
  "main": "index.js",