crystalcord

Version, currently master branch1 version
  • master branchlatestNov 13, 2016

github.com/zatherz/crystalcord

Fork of discordcr aimed at ease of use.

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  crystalcord:
    github: zatherz/crystalcord
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Authors
meew0, zatherz

Dependencies

This version declares no dependencies.

README

docs

CrystalCord

CrystalCord is a fork of discordcr.
It aims to be an easy to use Discord library for Crystal. Very high performance is not a goal, although the library should be faster than discordrb which it tries to somewhat imitate.

If you want to trade higher performance for less ease of use, use discordcr. CrystalCord does not officially (at least yet) support selfbots (user accounts), but it's possible that it may work.

Installation

Add this to your application's shard.yml:

dependencies:
  crystalcord:
    github: zatherz/crystalcord

Usage

An example bot can be found here. More examples can be found here.

A short overview of library structure: the Client class includes the REST module, which handles the REST parts of Discord's API; the Client itself handles the gateway, i. e. the interactive parts such as receiving messages. It is possible to use only the REST parts by never calling the #run method on a Client, which is what does the actual gateway connection.

CrystalCord wraps JSON response structs in special wrappers that give access to simple shortcut methods. For example, the Basic::Message JSON response struct is wrapped by the Message struct to include the respond method (and more).

As opposed to discordcr, CrystalCord creates the cache automatically for you.

API documentation is available at https://zatherz.github.io/crystalcord/doc/master/.

Contributing

  1. Fork it (https://github.com/zatherz/crystalcord/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • meew0 - creator and maintainer of discordcr
  • RX14 - Crystal expert, maintainer of discordcr
  • zatherz - creator and maintainer of CrystalCord