<commit_before># Webbybot

[![Build Status](https://travis-ci.org/gasolin/webby.png)](https://travis-ci.org/gasolin/webbybot) [![codecov.io](https://codecov.io/github/gasolin/webbybot/coverage.svg?branch=master)](https://codecov.io/github/gasolin/webbybot?branch=master) [![Dependency Status](https://david-dm.org/gasolin/webbybot.svg)](https://david-dm.org/gasolin/webbybot) [![npm](https://img.shields.io/npm/v/webbybot.svg)](https://www.npmjs.com/package/webbybot)

Webbybot is ported from [Hubot](https://github.com/github/hubot) project by Github.

The Differences:

* Port hubot from coffeescript to es6 (plain JS) with babel.
* Auto continue integration with Travis CI.
* Auto linting with eslint.

The Same:

* Still support hubot plugins written in coffeescript.
* Can reuse all hubot adapters*

# How to try Webbybot

```
$ git clone https://github.com/gasolin/webby_template.git demo
$ cd demo
$ npm install
$ ./bin/webby
```

# How to replace Hubot to Webbybot

Refer to [Getting Started With Hubot](https://hubot.github.com/docs/),
Install hubot generator first

```
npm install -g yo generator-hubot
```

Then generate your robot with
```
yo hubot
```

1. Enter the folder, edit `bin/hubot` and replace `hubot` to `webby`.

2. install webbybot package

```
npm install --save webbybot
```

3. modify adapter's dependency

Let's take telegram adapter for example. Edit `node_modules/hubot-telegram/src/telegram.coffee` and replace first line `require 'hubot'` to `require 'webbybot'`.

start your bot as normal

```
./bin/hubot
```

Tested with `hubot-telegram` and `hubot-messenger`.

# Development

```
$ npm install -g mocha
```

## Build

run command

```
$ npm run build
```

## Add plugins

```
$ npm install hubot-calculator hubot-diagnostics
```

Add external-scripts.json file which contain:

```
[
  "hubot-diagnostics",
  "hubot-calculator"
]
```

## Run

run command

```
$ node ./bin/webby
webby > ping
webby > PONG
webby > echo hello
webby > hello
webby > webby calc 1 + 1
webby > 2
```

## Test

```
$ npm test
```

## Lint
```
$ npm run lint
```<commit_msg>syntax highlight code and commands<commit_after># Webbybot

[![Build Status](https://travis-ci.org/gasolin/webby.png)](https://travis-ci.org/gasolin/webbybot) [![codecov.io](https://codecov.io/github/gasolin/webbybot/coverage.svg?branch=master)](https://codecov.io/github/gasolin/webbybot?branch=master) [![Dependency Status](https://david-dm.org/gasolin/webbybot.svg)](https://david-dm.org/gasolin/webbybot) [![npm](https://img.shields.io/npm/v/webbybot.svg)](https://www.npmjs.com/package/webbybot)

Webbybot is ported from [Hubot](https://github.com/github/hubot) project by Github.

The Differences:

* Port hubot from coffeescript to es6 (plain JS) with babel.
* Auto continue integration with Travis CI.
* Auto linting with eslint.

The Same:

* Still support hubot plugins written in coffeescript.
* Can reuse all hubot adapters*

# How to try Webbybot

```shell
$ git clone https://github.com/gasolin/webby_template.git demo
$ cd demo
$ npm install
$ ./bin/webby
```

# How to replace Hubot to Webbybot

Refer to [Getting Started With Hubot](https://hubot.github.com/docs/),
Install hubot generator first

```shell
npm install -g yo generator-hubot
```

Then generate your robot with
```shell
yo hubot
```

1. Enter the folder, edit `bin/hubot` and replace `hubot` to `webby`.

2. install webbybot package

```shell
npm install --save webbybot
```

3. modify adapter's dependency

Let's take telegram adapter for example. Edit `node_modules/hubot-telegram/src/telegram.coffee` and replace first line `require 'hubot'` to `require 'webbybot'`.

start your bot as normal

```shell
./bin/hubot
```

Tested with `hubot-telegram` and `hubot-messenger`.

# Development

```shell
$ npm install -g mocha
```

## Build

run command

```shell
$ npm run build
```

## Add plugins

```shell
$ npm install hubot-calculator hubot-diagnostics
```

Add external-scripts.json file which contain:

```javascript
[
  "hubot-diagnostics",
  "hubot-calculator"
]
```

## Run

run command

```shell
$ node ./bin/webby
webby > ping
webby > PONG
webby > echo hello
webby > hello
webby > webby calc 1 + 1
webby > 2
```

## Test

```shell
$ npm test
```

## Lint
```shell
$ npm run lint
```
{'fraction_non_alphanumeric': 0.14983560356975106, 'fraction_numerical': 0.0032879286049788633, 'mean_word_length': 4.264524103831891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, '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': '275692', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1492, 'n_words': 408}