paperplane 0.6.5

Dart native
Flutter Android iOS

A Flying Telegram Bot API Wrapper created from Scratch and Paper.

PaperPlane

Just a Telegram Library for Dart. A package to interact with the official

Telegram Bot API.

Dart Version Build Status Bot API Nebulino

Disclaimer #

I'm doing it just for fun, so... use at your own risk.

I hope it will become something great.

^-^

Usage #

First build the .g files for Serializable (if you clone the repo):

pub run build_runner build

A simple usage example:

import 'dart:io' as io;
import 'package:paperplane/paperplane.dart';

void main() {
  var token = 'Just A Token';
  
  var bot = PaperPlane.createBot(token);
  bot.engine();

  bot.startPolling();
  
  // Work with events...
  bot
    .onMessage()
    .where((message) => message.text == 'owo')
    .listen((message) => message.replyText(text: 'uwu'));
 
  // Work with updates and directly with methods...
  var api = bot.api;
  var updater = bot.updater.onUpdate();
  
  updater
    .where((onUpdate) => onUpdate.message.text == 'animate')
    .listen((update) => api.sendAnimation(
      chat_id: message.chat.id,
      animation: Luggage.withFile(file: io.File('./files/gifs/bunny_girl.gif'))));
}

Get PaperPlane #

Add PaperPlane dependency on pubspec.yaml:

From GitHub:

dependencies:
  paperplane:
    git: https://github.com/Nebulino/PaperPlane.git
      ref: branch-name

From pub.dev:

dependencies:
  paperplane: ^0.6.5

Features and bugs #

All API up-to v4.8 are supported #

Implemented a base for a future solid implementation of Long Polling

Still, the Webhook needs more tests.

You can use Long Polling mode for now.

I have created all Telegram API Classes for each Telegram Types.

Please file feature requests and bugs at the issue tracker.

3
likes
95
pub points
23%
popularity

Publisher

nebulino.cloud

A Flying Telegram Bot API Wrapper created from Scratch and Paper.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

dio, json_annotation, logger, meta, path

More

Packages that depend on paperplane