auto_retry 1.1.0 copy "auto_retry: ^1.1.0" to clipboard
auto_retry: ^1.1.0 copied to clipboard

The AutoRetry plugin for Televerse automatically retries failed API requests, handling rate limits and server errors to improve your bot's reliability and uptime.

example/auto_retry_example.dart

import 'dart:io';
import 'package:televerse/televerse.dart';
import 'package:auto_retry/auto_retry.dart';

void main(List<String> args) async {
  // Create aan API instance or a Bot Instance passing the bot token
  final bot = Bot(
    Platform.environment["BOT_TOKEN"]!,
  );

  // Take an instance of the Auto Retry, feel free to check the different options
  const autoRetry = AutoRetry(
    enableLogs: true,
  );

  // Attach the auto retry plugin to the Bot - that's it. You're all set.
  bot.use(autoRetry);

  bot.command("start", (ctx) {
    // Just spam the Bot API Server (and hit some limits)
    // (You don't have to do this - this part is just to illustrate it works 🤖)
    for (var i = 0; i < 150; i++) {
      ctx.reply("Hello $i").ignore();
    }
  });

  // Start the bot
  await bot.start();
}
1
likes
160
pub points
43%
popularity

Publisher

verified publisherxooniverse.com

The AutoRetry plugin for Televerse automatically retries failed API requests, handling rate limits and server errors to improve your bot's reliability and uptime.

Homepage
Repository (GitHub)
View/report issues

Topics

#televerse #telegram-bot #plugin #telegram

Documentation

API reference

Funding

Consider supporting this project:

buymeacoffee.com

License

MIT (license)

Dependencies

televerse

More

Packages that depend on auto_retry