Skip to content

Commit

Permalink
add developer and changelog section
Browse files Browse the repository at this point in the history
  • Loading branch information
gasolin committed Aug 5, 2016
1 parent 5487e42 commit f8b9011
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ Check [Online Demo](https://gasolin.github.io/huohubot/)

## Features

* Chat bot works in your browser without setup a server
* Tiny size (80 lines that contain the core with 3 plugins in init version) that easy to understand and suit for embed in any web site
* Structure is inspired by [hubot](https://github.com/github/hubot/), which is a server side chatbot framework
* Provide plugin architecture that able to expand functions
* Regex based message matching
* Plugin callbacks are extremely flexible, you can control in-page elements, execute local command, fetch remote data, trigger remote actions...
* can extend bot functionality by import addons


## How to Install

Clone the project then include the huohubot.js in your html file with 2 extra tags:
### Method 1

If you just want to try how the bot looks like, Check [Online Demo](https://gasolin.github.io/huohubot/)

### Method 2

If you want to modify it locally, clone the project, then drag index.html to your browser, now you have a working bot!

### Method 3

If you want embed bot into your web site, clone the project then include the `huohubot.js` in your html file with 2 extra tags:

```html
<div id="history"></div>
Expand Down Expand Up @@ -49,6 +61,38 @@ bot: Hello World!

![Imgur](http://i.imgur.com/Ljjf0Fw.png)

## Developer

Open browser's devtool and you can start manipulate `Huohubot` object.
Plugins are located in `Huohubot.rules`, and that is the place all you need to deal with.

### Make an addon

You can extend Huohubot's functionality by import extra `huohubot-[addonName].js`:

```js
'use strict';
if (!Huohubot) {
return
}

Huohubot.prototype.addonName = {
...
};
```

then include the js file after `huohubot.js`.

```html
...
<script defer src="huohubot.js"></script>
<script defer src="huohubot-addonName.js"></script>
```

## License

Huohubot use MIT License

## ChangeLog

* 0.1 2016/8/5 init version
1 change: 0 additions & 1 deletion huohubot.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var HuohuBot = {

onReceive: function() {
var receiveMsg = this.message.value;
//console.log('receiveMsg:' + receiveMsg);
this.chatHistory.push(this.myAlias + ': ' + receiveMsg);
this.processListeners(receiveMsg);
},
Expand Down

0 comments on commit f8b9011

Please sign in to comment.