@iletai/nzb 1.2.5 → 1.2.6

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.
@@ -1,3 +1,4 @@
1
+ import { autoRetry } from "@grammyjs/auto-retry";
1
2
  import { Bot, InlineKeyboard } from "grammy";
2
3
  import { Agent as HttpsAgent } from "https";
3
4
  import { config, persistEnvVar, persistModel } from "../config.js";
@@ -42,6 +43,8 @@ export function createBot() {
42
43
  });
43
44
  console.log("[nzb] Telegram bot using direct HTTPS agent (proxy bypass)");
44
45
  initLogChannel(bot);
46
+ // Auto-retry on rate limit (429) and server errors (500+)
47
+ bot.api.config.use(autoRetry({ maxRetryAttempts: 3, maxDelaySeconds: 10 }));
45
48
  // Auth middleware — only allow the authorized user
46
49
  bot.use(async (ctx, next) => {
47
50
  if (config.authorizedUserId !== undefined && ctx.from?.id !== config.authorizedUserId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iletai/nzb",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "NZB — a personal AI assistant for developers, built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "nzb": "dist/cli.js"
@@ -47,6 +47,7 @@
47
47
  "type": "module",
48
48
  "dependencies": {
49
49
  "@github/copilot-sdk": "^0.1.26",
50
+ "@grammyjs/auto-retry": "^2.0.2",
50
51
  "better-sqlite3": "^12.6.2",
51
52
  "dotenv": "^17.3.1",
52
53
  "express": "^5.2.1",