dbldart 0.1.3 copy "dbldart: ^0.1.3" to clipboard
dbldart: ^0.1.3 copied to clipboard

outdatedDart 1 only

Discord Bot List API for Dart

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);
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Discord Bot List API for Dart

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http

More

Packages that depend on dbldart