<commit_before># Ghastly

A framework designed to make it easier to modularize clients built on top of [Discord.js](http://hydrabolt.github.io/discord.js/).

## Quick Start

Work in progress.

## Developing

This framework uses [Babel](https://babeljs.io/) to transpile the source code into the final distributed library. Simply make changes to the source in `src/` then type

```bash
npm run build
```

to transpile the entire `src/` directory into the `lib/` directory. You can also use

```
npm run watch
```

to continuously watch the `src/` directory for changes and transpile on the go.
<commit_msg>Update readme.<commit_after># Ghastly

A library designed to make it easier to modularize clients built on top of [Discord.js](http://hydrabolt.github.io/discord.js/).

## Installation

To install, use

```bash
npm install --save ghastly
```

Discord.js is a peer dependency for this package, so make sure you have it installed as well. The current supported version is **9.2.x**.

## Quick Start

Import the Ghastly client constructor, define some commands, register them and login. That's it!

```js
import Discord from 'discord.js';
import { Command, make } from 'ghastly';

class Ping extends Command {
  get signature() {
    return '!ping'; // responds to messages starting with '!ping'
  }

  handle(message, args) {
    // ignore args for now
    message.reply('pong!');
  }
}

const client = make(Discord.Client).addCommand('ping', Ping);
client.login('token');
```

Usage with `require()` is similar.

```js
const Discord = require('discord.js');
const Ghastly = require('ghastly');

class Ping extends Ghastly.Command {
  get signature() {
    return '!ping'; // responds to messages starting with '!ping'
  }

  handle(message, args) {
    // ignore args for now
    message.reply('pong!');
  }
}

const client = Ghastly.make(Discord.Client).addCommand('ping', Ping);
client.login('token');
```

## Developing

### Linting

Use

```bash
npm run lint
```

to lint the `src/` folder. To fix some linting errors automatically, use

```bash
npm run lint:fix
```

### Testing

Run

```bash
npm run test
```

[Mocha](https://mochajs.org/) and [Chai](http://chaijs.com/) (with the `expect` BDD style) are used for unit testing.

### Building

This library uses [Babel](https://babeljs.io/) to transpile the source code into the final distributed library. Simply make changes to the source in `src/` then type

```bash
npm run build
```

to transpile the entire `src/` directory into the `lib/` directory. You can also use

```
npm run watch
```

to continuously watch the `src/` directory for changes and transpile on the go.

{'fraction_non_alphanumeric': 0.1267071320182094, 'fraction_numerical': 0.0007587253414264037, 'mean_word_length': 3.9943181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5542343', 'n_tokens_mistral': 862, 'n_tokens_neox': 806, 'n_words': 322}