circumstellar 0.1.1 copy "circumstellar: ^0.1.1" to clipboard
circumstellar: ^0.1.1 copied to clipboard

outdatedDart 1 only

A Dart wrapper for the Discord API.

Circumstellar logo
Travis Pub

A Dart wrapper for the Discord API.

The project is currently in an early development stage. Feel free to contribute!

Documentation is available here, and examples can be found in the example directory.

Features #

  • Speedy (built upon the latest versions of the Dart SDK and web APIs)
  • Small dependency tree (only one direct dependency - w_transport, for both WebSocket and REST // five development dependencies)
  • Predictable - robust and well-defined type checks included with all models
  • Multiplatform - runs anywhere Dart VM does

Example #

A quick example of the client in action:

import 'package:circumstellar/circumstellar.dart';
import 'package:circumstellar/src/models/discord_objects/message.dart';

import 'package:w_transport/vm.dart' show vmTransportPlatform;
// Dart for Web: import 'package:w_transport/browser.dart' show browserTransportPlatform;

void main() {
  var client = new DiscordClient(new DiscordAuthSet('MY_TOKEN', TokenType.Bot), vmTransportPlatform /* dart for web: browserTransportPlatform */);
  client.dispatcher.messageCreate.listen((Message msg) async {
    print('Received message with ID ${msg.id} (Channel ID ${msg.channel.id})');
    print('Content: ${msg.content}');
    if (msg.content == '!ping') {
      await client.createMessage(msg.channel.id, 'Pong!');
    }
  });
  client.dispatcher.ready.listen((empty) {
    print('Ready');
  });
  client.start();
}

Dart VM/Dart Web support #

Circumstellar now supports both the VM (Dart SDK) and the web platform. You can import either the web or VM transport platform as shown in the example and use them in the construction of the DiscordClient instance.

Contributing #

Contributing guidelines:

  • Please use dartfmt and follow Dart's standard formatting rules for all your contributions
  • Please follow the naming conventions already laid out in the project
  • The tests haven't been fully written yet, so you can run bin/dev.dart (check file for the environment variables to set) to run a dev instance/test client of Circumstellar.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Dart wrapper for the Discord API.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

w_transport

More

Packages that depend on circumstellar