dartcord 0.1.1

  • README.md
  • Installing
  • Versions
  • 58

dartcord

dartcord is an API wrapper and Dart client for the Discord API.
It makes full use of await/async syntax and asynchronous Future.

Installation

Add dartcord to your pubspec:

dependencies:
    dartcord: "^0.1.0"

Example

var client = new dartcord.Client("MyToken");
client.onMessage.listen((e) async {
  var m = e.message;
  if (m.content == "!ping") {
    await m.reply("Pong!");
  }
 });
client.onReady.listen((e) async {
  print("Ready! Logged in as: " + e.client.user.username);
});

await client.start();

Roadmap

  • Embed support Done
  • Overhaul WebSocket & REST(?) system
  • Add more events
  • Replace sharding system
  • Voice support

Contributing

Please use async/await syntax and latest Dart conventions. For testing, the following variables must be set: DISCORD_TOKEN (set to your testing bot's token) and TESTING_CHAN_ID (the tests send messages, so pick a channel that the bot has send, edit and manage messages).

Fork

dartcord is a fork of Nyx (https://github.com/Hackzzila/nyx)

Use this package as a library

1. Depend on it

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


dependencies:
  dartcord: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dartcord/dartcord.dart';
  
Version Uploaded Documentation Archive
0.1.1 Jun 26, 2017 Go to the documentation of dartcord 0.1.1 Download dartcord 0.1.1 archive
0.1.0 Jun 26, 2017 Go to the documentation of dartcord 0.1.0 Download dartcord 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
46
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Aug 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because dartcord depends on colorize >=0.1.0 which requires SDK version <2.0.0, version solving failed.

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Homepage does not exists.

We were unable to access https://github.com/jacksonrakena/dartcord at the time of the analysis.

Add SDK constraint in pubspec.yaml.

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Package is getting outdated.

The package was released 59 weeks ago.

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 of the API.

Format lib/src/Client.dart.

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

Format lib/src/discord_browser.dart.

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

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dartcord.dart.

Fix additional 21 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/errors/ClientNotReadyError.dart (Run dartfmt to format lib/src/errors/ClientNotReadyError.dart.)
  • lib/src/events/GuildCreateEvent.dart (Run dartfmt to format lib/src/events/GuildCreateEvent.dart.)
  • lib/src/internal/_Constants.dart (Run dartfmt to format lib/src/internal/_Constants.dart.)
  • lib/src/internal/_DiscordSocket.dart (Run dartfmt to format lib/src/internal/_DiscordSocket.dart.)
  • lib/src/internal/_RestClient.dart (Run dartfmt to format lib/src/internal/_RestClient.dart.)
  • lib/src/internal/_SnowflakeEntity.dart (Run dartfmt to format lib/src/internal/_SnowflakeEntity.dart.)
  • lib/src/internal/_SocketManager.dart (Run dartfmt to format lib/src/internal/_SocketManager.dart.)
  • lib/src/internal/logging/DiscordLogging.dart (Run dartfmt to format lib/src/internal/logging/DiscordLogging.dart.)
  • lib/src/objects/Attachment.dart (Run dartfmt to format lib/src/objects/Attachment.dart.)
  • lib/src/objects/DMChannel.dart (Run dartfmt to format lib/src/objects/DMChannel.dart.)
  • lib/src/objects/EmbedBuilder.dart (Run dartfmt to format lib/src/objects/EmbedBuilder.dart.)
  • lib/src/objects/GroupDMChannel.dart (Run dartfmt to format lib/src/objects/GroupDMChannel.dart.)
  • lib/src/objects/Guild.dart (Run dartfmt to format lib/src/objects/Guild.dart.)
  • lib/src/objects/GuildAuditLogsContainer.dart (Run dartfmt to format lib/src/objects/GuildAuditLogsContainer.dart.)
  • lib/src/objects/InviteGuild.dart (Run dartfmt to format lib/src/objects/InviteGuild.dart.)
  • lib/src/objects/Message.dart (Run dartfmt to format lib/src/objects/Message.dart.)
  • lib/src/objects/TextChannel.dart (Run dartfmt to format lib/src/objects/TextChannel.dart.)
  • lib/src/objects/User.dart (Run dartfmt to format lib/src/objects/User.dart.)
  • lib/src/objects/VoiceChannel.dart (Run dartfmt to format lib/src/objects/VoiceChannel.dart.)
  • lib/src/objects/VoiceConnection.dart (Run dartfmt to format lib/src/objects/VoiceConnection.dart.)
  • lib/src/objects/Webhook.dart (Run dartfmt to format lib/src/objects/Webhook.dart.)