dart_telegram_bot 0.1.7

  • Readme
  • Changelog
  • Installing
  • 69

dart-telegram-bot #

A very basic Telegram bot API wrapper

Take a look at the example and tests folders.

0.0.1 #

  • Initial version: setting up skeleton

0.0.2 #

  • Fixed http package version

0.0.3 #

  • Minor improvements to stability

0.0.4 #

  • Implemented ChatAction.fromString

0.0.5 #

  • Improvements to ChatMember object

0.0.6 #

  • Improvements to Telegram API Client

0.0.7 #

  • Minor fixes on start() function

0.0.8 #

  • Fixed event loop, now it's not using sleep anymore

0.0.9 #

  • Improved bot loop, now it's not blocking and it's a correct Future

0.0.9+1 #

  • Small improvement for previous version

0.0.9+2 #

  • Added the possibility to chose if the http client should be only closed or restarted

0.0.9+3 #

  • Bug fix for event loop

0.1.0 #

  • Added functions to download files
  • Fixed File size from String to int
  • Added small test

0.1.1 #

  • Fixed tests
  • Implemented some inline stuff

0.1.2 #

  • added editMessageText

0.1.3 #

  • Critical bug fixes on update

0.1.4 #

  • Fixed onUpdate getting executed when a command was executed first
  • Improved command callback error checking

0.1.4+1 #

  • Fixed an issues with command and updates

0.1.4+2 #

  • Fixed an issues with command and updates

0.1.4+3 #

  • Fixed issue in api client for chat member list mapping

0.1.4+4 #

  • Added some more logs on APIException

0.1.4+5 #

  • Added some more logs on APIException

0.1.4+6 #

  • Fixed wrong type in APIException

0.1.5 #

  • Added bot command utilities
  • Improved bot command handling

0.1.5+1 #

  • Fixed minor issue

0.1.6 #

  • Added setMyCommands
  • Added getMyCommands

0.1.7 #

  • Minor fixes to InputMedia classes

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_telegram_bot: ^0.1.7

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_telegram_bot/tgapi/bot.dart';
import 'package:dart_telegram_bot/tgapi/entities/animation.dart';
import 'package:dart_telegram_bot/tgapi/entities/audio.dart';
import 'package:dart_telegram_bot/tgapi/entities/bot_command.dart';
import 'package:dart_telegram_bot/tgapi/entities/callback_game.dart';
import 'package:dart_telegram_bot/tgapi/entities/callback_query.dart';
import 'package:dart_telegram_bot/tgapi/entities/chat.dart';
import 'package:dart_telegram_bot/tgapi/entities/chat_member.dart';
import 'package:dart_telegram_bot/tgapi/entities/chat_permissions.dart';
import 'package:dart_telegram_bot/tgapi/entities/chat_photo.dart';
import 'package:dart_telegram_bot/tgapi/entities/chosen_inline_result.dart';
import 'package:dart_telegram_bot/tgapi/entities/contact.dart';
import 'package:dart_telegram_bot/tgapi/entities/document.dart';
import 'package:dart_telegram_bot/tgapi/entities/file.dart';
import 'package:dart_telegram_bot/tgapi/entities/force_reply.dart';
import 'package:dart_telegram_bot/tgapi/entities/game.dart';
import 'package:dart_telegram_bot/tgapi/entities/inline/inline_query_result.dart';
import 'package:dart_telegram_bot/tgapi/entities/inline/inline_query_result_article.dart';
import 'package:dart_telegram_bot/tgapi/entities/inline_keyboard_button.dart';
import 'package:dart_telegram_bot/tgapi/entities/inline_keyboard_markup.dart';
import 'package:dart_telegram_bot/tgapi/entities/inline_query.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media_animation.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media_audio.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media_document.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media_photo.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_media_video.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_message_content.dart';
import 'package:dart_telegram_bot/tgapi/entities/input_text_message_content.dart';
import 'package:dart_telegram_bot/tgapi/entities/internal/bot_command.dart';
import 'package:dart_telegram_bot/tgapi/entities/internal/chat_id.dart';
import 'package:dart_telegram_bot/tgapi/entities/internal/http_file.dart';
import 'package:dart_telegram_bot/tgapi/entities/invoice.dart';
import 'package:dart_telegram_bot/tgapi/entities/keyboard_button.dart';
import 'package:dart_telegram_bot/tgapi/entities/keyboard_button_poll_type.dart';
import 'package:dart_telegram_bot/tgapi/entities/labeled_price.dart';
import 'package:dart_telegram_bot/tgapi/entities/location.dart';
import 'package:dart_telegram_bot/tgapi/entities/login_url.dart';
import 'package:dart_telegram_bot/tgapi/entities/mask_position.dart';
import 'package:dart_telegram_bot/tgapi/entities/message.dart';
import 'package:dart_telegram_bot/tgapi/entities/message_entity.dart';
import 'package:dart_telegram_bot/tgapi/entities/order_info.dart';
import 'package:dart_telegram_bot/tgapi/entities/passport_data.dart';
import 'package:dart_telegram_bot/tgapi/entities/photo_size.dart';
import 'package:dart_telegram_bot/tgapi/entities/poll.dart';
import 'package:dart_telegram_bot/tgapi/entities/poll_answer.dart';
import 'package:dart_telegram_bot/tgapi/entities/poll_option.dart';
import 'package:dart_telegram_bot/tgapi/entities/pre_checkout_query.dart';
import 'package:dart_telegram_bot/tgapi/entities/reply_keyboard_markup.dart';
import 'package:dart_telegram_bot/tgapi/entities/reply_keyboard_remove.dart';
import 'package:dart_telegram_bot/tgapi/entities/reply_markup.dart';
import 'package:dart_telegram_bot/tgapi/entities/response_parameters.dart';
import 'package:dart_telegram_bot/tgapi/entities/shipping_address.dart';
import 'package:dart_telegram_bot/tgapi/entities/shipping_option.dart';
import 'package:dart_telegram_bot/tgapi/entities/shipping_query.dart';
import 'package:dart_telegram_bot/tgapi/entities/sticker.dart';
import 'package:dart_telegram_bot/tgapi/entities/sticker_set.dart';
import 'package:dart_telegram_bot/tgapi/entities/successful_payment.dart';
import 'package:dart_telegram_bot/tgapi/entities/update.dart';
import 'package:dart_telegram_bot/tgapi/entities/user.dart';
import 'package:dart_telegram_bot/tgapi/entities/user_profile_photos.dart';
import 'package:dart_telegram_bot/tgapi/entities/venue.dart';
import 'package:dart_telegram_bot/tgapi/entities/video.dart';
import 'package:dart_telegram_bot/tgapi/entities/video_note.dart';
import 'package:dart_telegram_bot/tgapi/entities/voice.dart';
import 'package:dart_telegram_bot/tgapi/enums/chat_action.dart';
import 'package:dart_telegram_bot/tgapi/enums/parse_mode.dart';
import 'package:dart_telegram_bot/tgapi/enums/poll_type.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/api_exception.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/invalid_bot_state_exception.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/malformed_api_call_exception.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/unknown_api_method.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/unsupported_api_type.dart';
import 'package:dart_telegram_bot/tgapi/exceptions/unsupported_type_exception.dart';
import 'package:dart_telegram_bot/tgapi/tgapi_client.dart';
import 'package:dart_telegram_bot/tgapi/tgapi_methods.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jun 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health issues and suggestions

Document public APIs. (-0.97 points)

1143 out of 1144 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/tgapi/entities/chat_member.dart. (-1.49 points)

Analysis of lib/tgapi/entities/chat_member.dart reported 3 hints:

line 50 col 9: The value of the local variable 'isKicked' isn't used.

line 52 col 9: The value of the local variable 'isRestricted' isn't used.

line 53 col 9: The value of the local variable 'hasLeft' isn't used.

Fix lib/tgapi/entities/input_message_content.dart. (-1 points)

Analysis of lib/tgapi/entities/input_message_content.dart reported 2 hints:

line 3 col 3: This function has a return type of 'InputMessageContent', but doesn't end with a return statement.

line 3 col 66: Use ; instead of {} for empty constructor bodies.

Format lib/tgapi/bot.dart.

Run dartfmt to format lib/tgapi/bot.dart.

Fix additional 40 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/tgapi/entities/callback_query.dart (Run dartfmt to format lib/tgapi/entities/callback_query.dart.)
  • lib/tgapi/entities/chat_photo.dart (Run dartfmt to format lib/tgapi/entities/chat_photo.dart.)
  • lib/tgapi/entities/chosen_inline_result.dart (Run dartfmt to format lib/tgapi/entities/chosen_inline_result.dart.)
  • lib/tgapi/entities/contact.dart (Run dartfmt to format lib/tgapi/entities/contact.dart.)
  • lib/tgapi/entities/document.dart (Run dartfmt to format lib/tgapi/entities/document.dart.)
  • lib/tgapi/entities/force_reply.dart (Run dartfmt to format lib/tgapi/entities/force_reply.dart.)
  • lib/tgapi/entities/game.dart (Run dartfmt to format lib/tgapi/entities/game.dart.)
  • lib/tgapi/entities/inline/inline_query_result.dart (Run dartfmt to format lib/tgapi/entities/inline/inline_query_result.dart.)
  • lib/tgapi/entities/inline/inline_query_result_article.dart (Run dartfmt to format lib/tgapi/entities/inline/inline_query_result_article.dart.)
  • lib/tgapi/entities/inline_keyboard_button.dart (Run dartfmt to format lib/tgapi/entities/inline_keyboard_button.dart.)
  • lib/tgapi/entities/inline_keyboard_markup.dart (Run dartfmt to format lib/tgapi/entities/inline_keyboard_markup.dart.)
  • lib/tgapi/entities/input_media_animation.dart (Run dartfmt to format lib/tgapi/entities/input_media_animation.dart.)
  • lib/tgapi/entities/input_media_audio.dart (Run dartfmt to format lib/tgapi/entities/input_media_audio.dart.)
  • lib/tgapi/entities/input_media_document.dart (Run dartfmt to format lib/tgapi/entities/input_media_document.dart.)
  • lib/tgapi/entities/input_media_photo.dart (Run dartfmt to format lib/tgapi/entities/input_media_photo.dart.)
  • lib/tgapi/entities/input_text_message_content.dart (Run dartfmt to format lib/tgapi/entities/input_text_message_content.dart.)
  • lib/tgapi/entities/internal/bot_command.dart (Run dartfmt to format lib/tgapi/entities/internal/bot_command.dart.)
  • lib/tgapi/entities/internal/http_file.dart (Run dartfmt to format lib/tgapi/entities/internal/http_file.dart.)
  • lib/tgapi/entities/invoice.dart (Run dartfmt to format lib/tgapi/entities/invoice.dart.)
  • lib/tgapi/entities/keyboard_button.dart (Run dartfmt to format lib/tgapi/entities/keyboard_button.dart.)
  • lib/tgapi/entities/login_url.dart (Run dartfmt to format lib/tgapi/entities/login_url.dart.)
  • lib/tgapi/entities/message.dart (Run dartfmt to format lib/tgapi/entities/message.dart.)
  • lib/tgapi/entities/message_entity.dart (Run dartfmt to format lib/tgapi/entities/message_entity.dart.)
  • lib/tgapi/entities/photo_size.dart (Run dartfmt to format lib/tgapi/entities/photo_size.dart.)
  • lib/tgapi/entities/poll_answer.dart (Run dartfmt to format lib/tgapi/entities/poll_answer.dart.)
  • lib/tgapi/entities/reply_keyboard_markup.dart (Run dartfmt to format lib/tgapi/entities/reply_keyboard_markup.dart.)
  • lib/tgapi/entities/reply_keyboard_remove.dart (Run dartfmt to format lib/tgapi/entities/reply_keyboard_remove.dart.)
  • lib/tgapi/entities/response_parameters.dart (Run dartfmt to format lib/tgapi/entities/response_parameters.dart.)
  • lib/tgapi/entities/shipping_address.dart (Run dartfmt to format lib/tgapi/entities/shipping_address.dart.)
  • lib/tgapi/entities/shipping_option.dart (Run dartfmt to format lib/tgapi/entities/shipping_option.dart.)
  • lib/tgapi/entities/shipping_query.dart (Run dartfmt to format lib/tgapi/entities/shipping_query.dart.)
  • lib/tgapi/entities/sticker_set.dart (Run dartfmt to format lib/tgapi/entities/sticker_set.dart.)
  • lib/tgapi/entities/update.dart (Run dartfmt to format lib/tgapi/entities/update.dart.)
  • lib/tgapi/entities/user_profile_photos.dart (Run dartfmt to format lib/tgapi/entities/user_profile_photos.dart.)
  • lib/tgapi/entities/venue.dart (Run dartfmt to format lib/tgapi/entities/venue.dart.)
  • lib/tgapi/entities/video_note.dart (Run dartfmt to format lib/tgapi/entities/video_note.dart.)
  • lib/tgapi/entities/voice.dart (Run dartfmt to format lib/tgapi/entities/voice.dart.)
  • lib/tgapi/exceptions/api_exception.dart (Run dartfmt to format lib/tgapi/exceptions/api_exception.dart.)
  • lib/tgapi/tgapi_client.dart (Run dartfmt to format lib/tgapi/tgapi_client.dart.)
  • lib/tgapi/tgapi_methods.dart (Run dartfmt to format lib/tgapi/tgapi_methods.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and dart_telegram_bot.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
http ^0.12.0+4 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.12
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.8.0 1.9.0
test ^1.6.0