dbldart 0.1.5

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new48

dbldart

Pub

A Discord Bot List API binding for Dart

dbldart is a simple Discord Bot List API binding for Dart. It supports statistic updating, resource information fetching, and webhook vote monitoring. It is designed to be easy-to-use and easy to implement.

Usage

Add the library to your pubspec.yaml.

Initializing a bot instance

You can specify a token...

DblBot dbl = new DblBot("<your dbl token goes here>");

or not...

DblBot dbl = new DblBot();

Not specifying a token will only grant access to API methods that don't require authorization.

Updating bot stats

You can update stats with a server count number...

dbl.updateStats(myBot.guilds.length);

or update them with an array of counts representing shards...

dbl.updateShardsStats(myBot.shards.map((s) => s.guilds.length));

Setting up webhooks to handle voting

Just create the webhook within the bot instance...

await dbl.webhook.create(12345, "my password");

dbl.webhook.onUserVote.listen((vote) {
	print("user with id ${vote.userId} voted!")
});

and register the address on DBL accordingly. In this instance, http://yourip:12345 and set the password to my password.

Getting resource information

You can get bot information...

Bot dblBot = dbl.getBot(myBot.currentUser.id);
print(dblBot.monthlyVotes);

or get user information...

User dblUser = dbl.getUser(80047598504783872);
print(dblUser.social.twitterUrl);

Making widgets

You can make a big widget...

LargeWidget widget = new LargeWidget(myBot.id);
String url = widget.uri.toString();

or a small widget...

SmallWidget widget = new SmallWidget(myBot.id, SmallWidgetType.upvotes);
String url = widget.uri.toString();

0.1.5

  • Depend on Git-based http.git
  • Add widget support
  • README examples

0.1.4

  • Fixes
  • Depend on Git-based http

0.1.3

  • README changes

0.1.2

  • Finalize full documentation for existing stuff

0.1.1

  • Add LICENSE
  • Update pubspec
  • Publish to pub

0.1.0

  • Finish basic resource fetching
  • Updating status finished
  • Add webhook server support

0.0.1

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  dbldart: "^0.1.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:dbldart/dbldart.dart';
  
Version Uploaded Documentation Archive
0.1.5 Jun 4, 2018 Go to the documentation of dbldart 0.1.5 Download dbldart 0.1.5 archive
0.1.4 Jun 2, 2018 Go to the documentation of dbldart 0.1.4 Download dbldart 0.1.4 archive
0.1.3 Jun 2, 2018 Go to the documentation of dbldart 0.1.3 Download dbldart 0.1.3 archive
0.1.2 Jun 2, 2018 Go to the documentation of dbldart 0.1.2 Download dbldart 0.1.2 archive
0.1.1 Jun 2, 2018 Go to the documentation of dbldart 0.1.1 Download dbldart 0.1.1 archive

Analysis

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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95 / 100
Overall score:
Weighted score of the above. [more]
48
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:dbldart/dbldart.dart with components: io.

Suggestions

  • Use constrained dependencies.

    The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: http.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 9 hints.

    Run dartfmt to format lib/dbldart.dart.

    Run dartfmt to format lib/src/dblbot.dart.

    Similar analysis of the following files failed:

    • lib/src/event.dart (hint)
    • lib/src/resource/bot.dart (hint)
    • lib/src/resource/user.dart (hint)
    • lib/src/resource/widget.dart (hint)
    • lib/src/route.dart (hint)
    • lib/src/snowflake.dart (hint)
    • lib/src/webhook.dart (hint)
  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dbldart.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
http 0.12.0
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
http_parser 3.1.2
mime 0.9.6+1
path 1.6.0
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test ^0.12.0