Skip to content
pubscout

dart_telegram_bot

1.0.0, released 4 years ago by an unverified publisher

A Dart wrapper for the Telegram Bot API to send and receive messages.

WASM-ready
$ flutter pub add dart_telegram_bot
Source repository

What it does

Provides a Bot class to interact with Telegram Bot API, handling updates, sending messages, and configuring allowed update types. Works on native, Flutter, and JavaScript platforms.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a quick way to integrate a Telegram bot into a Dart or Flutter app
  • You prefer a lightweight wrapper without heavy dependencies

Skip it when

  • You require advanced features like built‑in state management or code generation
  • You need a highly opinionated architecture for bot handling

Strengths

  • Simple API mirroring Telegram methods
  • Supports both functional and OOP usage styles
  • Works across multiple platforms (android, ios, web, desktop)

Weaknesses

  • Limited to Telegram; no multi‑service support
  • Relies on manual error handling for network issues
  • No built‑in code generation or advanced abstractions

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:dart_telegram_bot/dart_telegram_bot.dart';
import 'package:dart_telegram_bot/telegram_entities.dart';

void main() {
  Bot(
    token: 'BOT_TOKEN',
    onReady: (bot) => bot.start(clean: true),
  ).onUpdate((bot, update) async {
    bot.sendMessage(ChatID(update.message!.chat.id), update.message!.text!);
  });
}

Alternatives

Packages that do the same job and could replace dart_telegram_bot.

  • dio

    Offers more features like interceptors and advanced request handling for custom Telegram integrations

Works with

Packages commonly used together with dart_telegram_bot: ones it builds on, ones built on it, and its own family.