gramio 0.0.7 → 0.0.9

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/README.md CHANGED
@@ -1 +1,7 @@
1
+ # GramIO
2
+
1
3
  Work in progress
4
+
5
+ Currently support Bot API 7.1
6
+
7
+ See [Documentation](https://gramio.netlify.app/)
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/updates.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare class Updates {
11
11
  on<T extends UpdateNames>(updateName: T, handler: THandler<InstanceType<(typeof contextsMappings)[T]>>): this;
12
12
  use(handler: THandler<Context>): this;
13
13
  handleUpdate(data: TelegramUpdate): Promise<void>;
14
- startPolling(): Promise<null>;
14
+ startPolling(): Promise<void>;
15
15
  startFetchLoop(): Promise<void>;
16
16
  stopPolling(): void;
17
17
  }
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() {
@@ -56,7 +56,7 @@ class Updates {
56
56
  throw new Error("[UPDATES] Polling already started!");
57
57
  this.isStarted = true;
58
58
  this.startFetchLoop();
59
- return null;
59
+ return;
60
60
  }
61
61
  async startFetchLoop() {
62
62
  while (this.isStarted) {
package/package.json CHANGED
@@ -1,24 +1,26 @@
1
1
  {
2
2
  "name": "gramio",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "WIP",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
+ "type": "tsc --noEmit",
8
9
  "lint": "bun check ./src",
9
- "lint:fix": "bun lint --apply"
10
+ "lint:fix": "bun lint --apply",
11
+ "prepublishOnly": "tsc"
10
12
  },
11
13
  "author": "kravets",
12
14
  "license": "ISC",
13
15
  "devDependencies": {
14
16
  "@biomejs/biome": "1.5.3",
15
- "@gramio/types": "^7.0.17",
16
- "@types/node": "^20.11.17"
17
+ "@gramio/types": "^7.1.0",
18
+ "@types/node": "^20.11.19"
17
19
  },
18
20
  "dependencies": {
19
- "@gramio/contexts": "^0.0.1",
20
- "@gramio/files": "^0.0.2",
21
- "@gramio/format": "^0.0.2",
21
+ "@gramio/contexts": "^0.0.2",
22
+ "@gramio/files": "^0.0.3",
23
+ "@gramio/format": "^0.0.7",
22
24
  "@gramio/keyboards": "^0.1.6",
23
25
  "form-data-encoder": "^4.0.2",
24
26
  "inspectable": "^2.1.0",