Skip to content

Commit

Permalink
chore: enable autoRetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Jun 29, 2024
1 parent 9ba80ee commit 0b90ecf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"type": "module",
"dependencies": {
"@grammyjs/auto-retry": "^2.0.1",
"@roziscoding/grammy-autoquote": "^2.0.6",
"fast-xml-parser": "^4.3.6",
"grammy": "^1.21.1",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/lib/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BiliArchiver } from "./api.js";
import * as MARKUP from "./markup.js";
import { env } from "$env/dynamic/private";
import { autoQuote } from "@roziscoding/grammy-autoquote";
import { autoRetry } from "@grammyjs/auto-retry";
import { handleBiliLink } from "./utils.js";

const token = env.BILIARCHIVER_BOT;
Expand All @@ -11,6 +12,7 @@ if (!token) {
}
const bot = new Bot(token!);
bot.use(autoQuote());
bot.api.config.use(autoRetry());
const apiBase = env.BILIARCHIVER_API;
if (!apiBase) {
throw new Error("\x1b[31mBILIARCHIVER_API must be provided!\x1b[0m");
Expand Down

0 comments on commit 0b90ecf

Please sign in to comment.