gramio 0.0.6 → 0.0.8

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/dist/bot.d.ts CHANGED
@@ -9,4 +9,3 @@ export declare class Bot {
9
9
  private _callApi;
10
10
  constructor(token: string, options?: Omit<BotOptions, "token">);
11
11
  }
12
- export * from "@gramio/types";
package/dist/bot.js CHANGED
@@ -31,8 +31,8 @@ let Bot = class Bot {
31
31
  // biome-ignore lint/style/noParameterAssign: mutate formattable
32
32
  if (formattable && params)
33
33
  params = formattable(params);
34
- if ((0, files_1.isMediaUpload)(method, params || {})) {
35
- const formData = await (0, files_1.convertJsonToFormData)(method, params || {});
34
+ if (params && (0, files_1.isMediaUpload)(method, params)) {
35
+ const formData = await (0, files_1.convertJsonToFormData)(method, params);
36
36
  const encoder = new form_data_encoder_1.FormDataEncoder(formData);
37
37
  reqOptions.body = encoder.encode();
38
38
  reqOptions.headers = encoder.headers;
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "@gramio/contexts";
5
5
  export * from "@gramio/files";
6
6
  export * from "@gramio/keyboards";
7
7
  export * from "@gramio/types";
8
+ export * from "@gramio/format";
package/dist/updates.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, contextsMappings } from "@gramio/contexts";
2
2
  import type { TelegramUpdate } from "@gramio/types";
3
- import { Bot } from "./bot";
3
+ import type { Bot } from "./bot";
4
4
  import { THandler, UpdateNames } from "./types";
5
5
  export declare class Updates {
6
6
  private readonly bot;
package/dist/updates.js CHANGED
@@ -48,7 +48,7 @@ class Updates {
48
48
  context, middleware_io_1.noopNext);
49
49
  }
50
50
  catch (error) {
51
- throw new Error(`Update type ${updateType} not supported.`);
51
+ throw new Error(`[UPDATES] Update type ${updateType} not supported.`);
52
52
  }
53
53
  }
54
54
  async startPolling() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gramio",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "WIP",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,9 +17,10 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@gramio/contexts": "^0.0.1",
20
- "@gramio/files": "^0.0.2",
21
- "@gramio/format": "^0.0.2",
20
+ "@gramio/files": "^0.0.3",
21
+ "@gramio/format": "^0.0.7",
22
22
  "@gramio/keyboards": "^0.1.6",
23
+ "common-tags": "^1.8.2",
23
24
  "form-data-encoder": "^4.0.2",
24
25
  "inspectable": "^2.1.0",
25
26
  "middleware-io": "^2.8.1",