https://github.com/nebulino/paperplane
A Flying Telegram Bot API Wrapper created from Scratch and Paper.
https://github.com/nebulino/paperplane
bot-api dart paperplane telegram telegram-bot telegram-bot-api wrapper
Last synced: 4 months ago
JSON representation
A Flying Telegram Bot API Wrapper created from Scratch and Paper.
- Host: GitHub
- URL: https://github.com/nebulino/paperplane
- Owner: Nebulino
- License: other
- Created: 2020-03-15T20:33:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-09T19:36:59.000Z (over 5 years ago)
- Last Synced: 2025-03-30T07:18:31.801Z (7 months ago)
- Topics: bot-api, dart, paperplane, telegram, telegram-bot, telegram-bot-api, wrapper
- Language: Dart
- Homepage: https://pub.dev/packages/paperplane
- Size: 547 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
PaperPlane
Just a Telegram Library for Dart.
A package to interact with the official
[Telegram Bot API](https://core.telegram.org/bots/api).
[](https://dart.dev)
[](https://travis-ci.org/github/Nebulino/PaperPlane)
[](https://core.telegram.org/bots/api)
[](https://t.me/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:
```dart
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:
```yaml
dependencies:
paperplane:
git: https://github.com/Nebulino/PaperPlane.git
ref: branch-name
```
From pub.dev:
```yaml
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][tracker].
##### Copyright © 2020 Nebulino
[tracker]: http://github.com/Nebulino/PaperPlane/issues