@grammyjs/auto-retry
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Automatically Retry grammY API Requests

Check out the official documentation for this grammY plugin. You might also want to read about broadcasting messages.

Quickstart

An API transformer function lets you modify outgoing HTTP requests on the fly. This grammY plugin can automatically detect if an API requests fails with a retry_after value. It will then intercept the error, wait the specified period of time, and then retry the request.

import { autoRetry } from "@grammyjs/auto-retry";

// Install the plugin
bot.api.config.use(autoRetry());

You can also pass an options object to configure this plugin. Check out the docs to read on.

Package Sidebar

Install

npm i @grammyjs/auto-retry

Weekly Downloads

1,325

Version

2.0.1

License

MIT

Unpacked Size

11 kB

Total Files

7

Last publish

Collaborators

  • knorpelsenf