dartsicord 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 73

dartsicord

Build Status Pub Discord

dartsicord is a Dart library intending to provide partial to full functionality of Discord's API. This library started out as a fun project, but it has become a serious project that I'd like to finish. This library is not at a stable state quite yet, but I'd love for you to give it a try and throw some issues at my face so I can catch them and fix them.

This library does not support voice. It may in the future, but this is a low-priority feature.

Why

dartsicord intends to be a simple, lightweight, efficient Discord library for building basic to large bots. There's no fuss over basic things you need to get done. The library simplifies the API quite a bit.

Issues

Issues are good! I hope you find some. I'd be more than happy to fix them. Just use the Issues tab (which I regularly maintain) and put your words and issues there.

Examples

A simple ping-pong bot can be located in the example directory, or can be found here.

import "package:dartsicord/dartsicord.dart";

void main() {
    final client = new DiscordClient();

    client.onMessage.listen((event) async {
        if (event.message.content.toLowerCase() == "ping")
            await event.message.reply("pong");
    });

    client.connect("YOUR-TOKEN");
}

Making a big bot

So you're writing a big bot with dartsicord... First off, good luck, have fun. Second off, might want to consider taking a look at my Discord Bots List API library for Dart, dbldart.

If you are writing a cool bot with my library, let me know on Discord in the dartsicord server, or email me at vox@voximity.net.

Contributing

Feel free to fork and contribute. Try to keep my style of code, or else I might get mad. That means double quotes and decent organization. I'll still probably fix any consistency issues after you've made a pull request.

If you are too worried you'll break something, that's alright! I'm looking for those who would write unit tests (in the test directory) and more examples (in the example directory). I'm open to anything!

Changelog

0.1.2

3 June 2018

Development on this project is definitely slowing down, and it may terminate sometime soon-ish. I updated my Dart to Dart 2 finally, and redid some things to work with Dart 2, be more user friendly, and depend on the http library on GitHub.

  • More docs
  • Internalize some classes
  • Redo Routes to work with new http
  • Dart 2 fixes

0.1.1+2

Fix bulk delete messages issue.

0.1.1

12 Mar 2018

This project is not abandoned, I just haven't seen a reason to update it lately. In this update, I focused on touching up the internals of the library quite a lot. More of the internally recognized fields and methods are now private because I've switched to using part and part of. It's becoming unsupported but it works a lot better in my case.

  • Move all events to an internal websocket event map
  • Switch to part and part of
  • Add embed builder methods
  • Finish client.modify avatar features
  • Make many existing constructors/methods internal
  • Add more tests

0.1.0+1,2

Fix critical heartbeat formatting issue.

0.1.0

25 Dec 2017 (Merry Christmas again)

Woohoo! 0.1.0 is the first major pre-1.0 version. This version attempts to complete all events, most REST methods, and adds some missing features I've forgotten to add in the past. I've also reworked the networking system (again), and made everything a bit more user friendly. In some coming updates, I'll be going through documentation and making everything very specific and easy to use.

  • Add author support
  • Add channel overwrites
  • Rework permission system
  • Rework Route system
  • Rework a few update events
  • Finish channel events and methods
  • Finish client events

0.0.13

25 Dec 2017 (Merry Christmas)

In 0.0.13, I added some more core concepts, such as invites, reactions, and more. I've added more events and methods as well. Additionally, I've made a lot of fixes to untested features. Probably the most exciting of all is the new example, giveaway. Check out the example directory for the new example. Comments are included to show how the library works and processes reactions. I plan to soon have most, if not all, events/methods required implemented. From there, I will be adding more unit tests. If you think this is a cool library, tell some of your friends. I need others to help contribute and find bugs!

  • Add reaction support
  • Add invite support
  • Many fixes (like a lot of fixes)
  • internals -> networking

0.0.12

24 Dec 2017

This update focuses on unit testing! (yay) I'm using the generic test library for Dart allowing for simple, straight-forward unit testing. You can find the tests in the test directory. They have been set up to execute often on Travis-CI, so you'll notice a new build badge on the README. Additionally, I've also implemented Resuming, a vital feature for maintaining a connection with the WS.

  • Add test directory
  • Add a message test
  • Add get message from a channel
  • connect -> _establishConnection
  • _reconnect -> _establishConnection with positional parameter reconnect: true
  • Add client.disconnect
  • Use Travis for building/testing (.travis.yml)

0.0.11

24 Dec 2017

This update focuses on more UX changes. I've added an in-depth PROGRESS file showing the progress of the library with its events and methods. I've also focused on completely implementing Websockets as well as trying to make some cacheing systems more efficient. I've also renamed the resources directory to objects because some of the objects were not considered resources. Additionally, I've renamed DiscordObject to simply Resource, as a resource is any object that has a Snowflake. Typically, these objects could be referred to as instantiated classes, while non-resource objects such as Game could be simply referred to as a struct.

  • Abide to more linter preferences
  • Add Webhook support
  • Rename resources to objects
  • Rename DiscordObject to Resource
  • Add Webhook Update event
  • Add Presence Update event
  • Add PROGRESS.md indicating library progress

0.0.10

23 Dec 2017

This update focuses mostly on user experience rather than new features. I have recently been on vacation, so I apologize for the few updates! If you haven't already noticed, I'm going to start adding more detail into the CHANGELOG like this short paragraph as well as a date in which the update was released. Additionally, I'm planning on making dartsicord a little more serious than I planned it to be.

  • Abide to more linter preferences
  • Organize code a bit better
  • Add more guild methods
  • Add more channel methods
  • Add more message methods
  • Add more documentation to most things that don't already have documentation

0.0.9

  • More guild events
  • Kind of just a test update from a different machine

0.0.8

  • Add status updating support
  • Add game class
  • Add enums for status and activity types
  • Change linter preferences and abide by them (for the most part)

0.0.7

  • Add a lot more events
  • Move events from event.dart to events directory
  • Fix up some fromDynamic to _fromMap parameter types
  • More REST methods
  • More work on Snowflake usage

0.0.6

  • Replace int-based id with Snowflake class
  • Add Emoji class
  • Add Emoji events
  • Add Emoji methods
  • Add User banned and unbanned events
  • Use localEndpoint instead of endpoint + id

0.0.5

  • Add more guild events
  • More documentation for events and stuff
  • Move around some client methods for internal organization

0.0.4

  • Rehaul events
  • fromDynamic is now _fromMap
  • More fixes

0.0.3

  • More documentation
  • Fixes

0.0.1-0.0.2

  • See GitHub

Use this package as a library

1. Depend on it

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


dependencies:
  dartsicord: "^0.1.2"

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:dartsicord/dartsicord.dart';
  
Version Uploaded Documentation Archive
0.1.2 Jun 3, 2018 Go to the documentation of dartsicord 0.1.2 Download dartsicord 0.1.2 archive
0.1.1+1 Mar 12, 2018 Go to the documentation of dartsicord 0.1.1+1 Download dartsicord 0.1.1+1 archive
0.1.1 Mar 12, 2018 Go to the documentation of dartsicord 0.1.1 Download dartsicord 0.1.1 archive
0.1.0+2 Dec 28, 2017 Go to the documentation of dartsicord 0.1.0+2 Download dartsicord 0.1.0+2 archive
0.1.0+1 Dec 28, 2017 Go to the documentation of dartsicord 0.1.0+1 Download dartsicord 0.1.0+1 archive
0.1.0 Dec 25, 2017 Go to the documentation of dartsicord 0.1.0 Download dartsicord 0.1.0 archive
0.0.13 Dec 25, 2017 Go to the documentation of dartsicord 0.0.13 Download dartsicord 0.0.13 archive
0.0.12 Dec 25, 2017 Go to the documentation of dartsicord 0.0.12 Download dartsicord 0.0.12 archive
0.0.11 Dec 24, 2017 Go to the documentation of dartsicord 0.0.11 Download dartsicord 0.0.11 archive
0.0.10 Dec 24, 2017 Go to the documentation of dartsicord 0.0.10 Download dartsicord 0.0.10 archive

All 18 versions...

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]
49 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94 / 100
Overall score:
Weighted score of the above. [more]
73
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:dartsicord/dartsicord.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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 21 hints.

    Run dartfmt to format lib/dartsicord.dart.

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

    Similar analysis of the following files failed:

    • lib/src/enums.dart (hint)
    • lib/src/event.dart (hint)
    • lib/src/events/channel.dart (hint)
    • lib/src/events/guild.dart (hint)
    • lib/src/events/message.dart (hint)
    • lib/src/exception.dart (hint)
    • lib/src/networking.dart (hint)
    • lib/src/object.dart (hint)
    • lib/src/objects/channel.dart (hint)
    • lib/src/objects/embed.dart (hint)
    • lib/src/objects/emoji.dart (hint)
    • lib/src/objects/game.dart (hint)
    • lib/src/objects/guild.dart (hint)
    • lib/src/objects/invite.dart (hint)
    • lib/src/objects/message.dart (hint)
    • lib/src/objects/overwrite.dart (hint)
    • lib/src/objects/role.dart (hint)
    • lib/src/objects/user.dart (hint)
    • lib/src/objects/webhook.dart (hint)
  • 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.

  • 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 dartsicord.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