gramio 0.2.1 → 0.2.2

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/index.cjs CHANGED
@@ -317,6 +317,7 @@ Plugin = __decorateElement$1(_init$1, 0, "Plugin", _Plugin_decorators, Plugin);
317
317
  __runInitializers$1(_init$1, 1, Plugin);
318
318
 
319
319
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
320
+
320
321
  class UpdateQueue {
321
322
  updateQueue = [];
322
323
  pendingUpdates = /* @__PURE__ */ new Set();
@@ -403,7 +404,7 @@ class Updates {
403
404
  }
404
405
  }
405
406
  /** @deprecated use bot.start instead @internal */
406
- async startPolling(params = {}) {
407
+ startPolling(params = {}) {
407
408
  if (this.isStarted) throw new Error("[UPDATES] Polling already started!");
408
409
  this.isStarted = true;
409
410
  this.startFetchLoop(params);
@@ -1103,8 +1104,9 @@ class Bot {
1103
1104
  if (!webhook) {
1104
1105
  await this.api.deleteWebhook({
1105
1106
  drop_pending_updates: dropPendingUpdates
1107
+ // suppress: true,
1106
1108
  });
1107
- await this.updates.startPolling({
1109
+ this.updates.startPolling({
1108
1110
  allowed_updates: allowedUpdates
1109
1111
  });
1110
1112
  this.runImmutableHooks("onStart", {
@@ -1120,6 +1122,7 @@ class Bot {
1120
1122
  ...webhook,
1121
1123
  drop_pending_updates: dropPendingUpdates,
1122
1124
  allowed_updates: allowedUpdates
1125
+ // suppress: true,
1123
1126
  });
1124
1127
  this.runImmutableHooks("onStart", {
1125
1128
  plugins: this.dependencies,
package/dist/index.d.cts CHANGED
@@ -579,7 +579,7 @@ declare class Updates {
579
579
  constructor(bot: AnyBot, onError: CaughtMiddlewareHandler<Context<any>>);
580
580
  handleUpdate(data: TelegramUpdate): Promise<unknown>;
581
581
  /** @deprecated use bot.start instead @internal */
582
- startPolling(params?: APIMethodParams<"getUpdates">): Promise<void>;
582
+ startPolling(params?: APIMethodParams<"getUpdates">): void;
583
583
  startFetchLoop(params?: APIMethodParams<"getUpdates">): Promise<void>;
584
584
  stopPolling(): void;
585
585
  }
@@ -1068,4 +1068,4 @@ declare function webhookHandler<Framework extends keyof typeof frameworks>(bot:
1068
1068
  response: () => any;
1069
1069
  } ? (...args: Parameters<(typeof frameworks)[Framework]>) => ReturnType<ReturnType<(typeof frameworks)[Framework]>["response"]> : (...args: Parameters<(typeof frameworks)[Framework]>) => void;
1070
1070
 
1071
- export { type AnyBot, type AnyPlugin, Bot, type BotOptions, Composer, type DeriveDefinitions, type ErrorDefinitions, ErrorKind, type FilterDefinitions, type Handler, Hooks, type MaybePromise, type MaybeSuppressedParams, Plugin, type Suppress, type SuppressedAPIMethodParams, type SuppressedAPIMethodReturn, type SuppressedAPIMethods, TelegramError, Updates, type WebhookHandlers, webhookHandler };
1071
+ export { type AnyBot, type AnyPlugin, Bot, type BotOptions, Composer, type DeriveDefinitions, type ErrorDefinitions, ErrorKind, type FilterDefinitions, type Handler, Hooks, type MaybePromise, type MaybeSuppressedParams, type MaybeSuppressedReturn, Plugin, type Suppress, type SuppressedAPIMethodParams, type SuppressedAPIMethodReturn, type SuppressedAPIMethods, TelegramError, Updates, type WebhookHandlers, webhookHandler };
package/dist/index.d.ts CHANGED
@@ -579,7 +579,7 @@ declare class Updates {
579
579
  constructor(bot: AnyBot, onError: CaughtMiddlewareHandler<Context<any>>);
580
580
  handleUpdate(data: TelegramUpdate): Promise<unknown>;
581
581
  /** @deprecated use bot.start instead @internal */
582
- startPolling(params?: APIMethodParams<"getUpdates">): Promise<void>;
582
+ startPolling(params?: APIMethodParams<"getUpdates">): void;
583
583
  startFetchLoop(params?: APIMethodParams<"getUpdates">): Promise<void>;
584
584
  stopPolling(): void;
585
585
  }
@@ -1068,4 +1068,4 @@ declare function webhookHandler<Framework extends keyof typeof frameworks>(bot:
1068
1068
  response: () => any;
1069
1069
  } ? (...args: Parameters<(typeof frameworks)[Framework]>) => ReturnType<ReturnType<(typeof frameworks)[Framework]>["response"]> : (...args: Parameters<(typeof frameworks)[Framework]>) => void;
1070
1070
 
1071
- export { type AnyBot, type AnyPlugin, Bot, type BotOptions, Composer, type DeriveDefinitions, type ErrorDefinitions, ErrorKind, type FilterDefinitions, type Handler, Hooks, type MaybePromise, type MaybeSuppressedParams, Plugin, type Suppress, type SuppressedAPIMethodParams, type SuppressedAPIMethodReturn, type SuppressedAPIMethods, TelegramError, Updates, type WebhookHandlers, webhookHandler };
1071
+ export { type AnyBot, type AnyPlugin, Bot, type BotOptions, Composer, type DeriveDefinitions, type ErrorDefinitions, ErrorKind, type FilterDefinitions, type Handler, Hooks, type MaybePromise, type MaybeSuppressedParams, type MaybeSuppressedReturn, Plugin, type Suppress, type SuppressedAPIMethodParams, type SuppressedAPIMethodReturn, type SuppressedAPIMethods, TelegramError, Updates, type WebhookHandlers, webhookHandler };
package/dist/index.js CHANGED
@@ -319,6 +319,7 @@ Plugin = __decorateElement$1(_init$1, 0, "Plugin", _Plugin_decorators, Plugin);
319
319
  __runInitializers$1(_init$1, 1, Plugin);
320
320
 
321
321
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
322
+
322
323
  class UpdateQueue {
323
324
  updateQueue = [];
324
325
  pendingUpdates = /* @__PURE__ */ new Set();
@@ -405,7 +406,7 @@ class Updates {
405
406
  }
406
407
  }
407
408
  /** @deprecated use bot.start instead @internal */
408
- async startPolling(params = {}) {
409
+ startPolling(params = {}) {
409
410
  if (this.isStarted) throw new Error("[UPDATES] Polling already started!");
410
411
  this.isStarted = true;
411
412
  this.startFetchLoop(params);
@@ -1105,8 +1106,9 @@ class Bot {
1105
1106
  if (!webhook) {
1106
1107
  await this.api.deleteWebhook({
1107
1108
  drop_pending_updates: dropPendingUpdates
1109
+ // suppress: true,
1108
1110
  });
1109
- await this.updates.startPolling({
1111
+ this.updates.startPolling({
1110
1112
  allowed_updates: allowedUpdates
1111
1113
  });
1112
1114
  this.runImmutableHooks("onStart", {
@@ -1122,6 +1124,7 @@ class Bot {
1122
1124
  ...webhook,
1123
1125
  drop_pending_updates: dropPendingUpdates,
1124
1126
  allowed_updates: allowedUpdates
1127
+ // suppress: true,
1125
1128
  });
1126
1129
  this.runImmutableHooks("onStart", {
1127
1130
  plugins: this.dependencies,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gramio",
3
3
  "type": "module",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "description": "Powerful, extensible and really type-safe Telegram Bot API framework",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "@biomejs/biome": "1.9.4",
44
44
  "@types/bun": "^1.1.14",
45
45
  "@types/debug": "^4.1.12",
46
- "pkgroll": "^2.5.1",
46
+ "pkgroll": "^2.6.0",
47
47
  "typescript": "^5.7.2"
48
48
  },
49
49
  "dependencies": {
@@ -51,8 +51,8 @@
51
51
  "@gramio/contexts": "^0.1.2",
52
52
  "@gramio/files": "^0.1.2",
53
53
  "@gramio/format": "^0.1.5",
54
- "@gramio/keyboards": "^1.0.2",
55
- "@gramio/types": "^8.1.0",
54
+ "@gramio/keyboards": "^1.1.0",
55
+ "@gramio/types": "^8.2.0",
56
56
  "debug": "^4.4.0",
57
57
  "inspectable": "^3.0.2",
58
58
  "middleware-io": "^2.8.1"