Home

Awesome

Ybot

Ybot is a customizable bot which was inspired by GitHub's Hubot. What can you do with Ybot:

Build Status

Features

Building and Running

First of all you must get your own Ybot:

git clone https://github.com/0xAX/Ybot.git

Or download the source file archive: .tar.gz or .zip

After getting source you need to download dependencies and build the source:

./rebar get-deps && ./rebar compile

Rename configration template ybot.config.template to ybot.config and edit configuration file and you can run your Ybot copy:

Start Ybot node:

./bin/start.sh

Connect to Ybot node console:

./bin/console.sh

Run on heroku

cd Ybot
heroku create your-application-name -s cedar
heroku config:add BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-erlang.git
echo OTP_R15B01 > .preferred_otp_version
git commit "Select R15B01 as preferred OTP version" .preferred_otp_version
git push heroku master

Dependencies

Transport

Ybot's basic transport is a network interface. Ybot is a chat bot and he spends all of his life chatting. Ybot receives chat messages and execute commands depending on those received messages. At that moment Ybot supports:

And also write-only transports:

Plugins

Ybot is a chat bot and it can execute different commands. Commands are simple chat messages. For example, a chat session:

you: Ybot math 1 + 5
Ybot: Answer: 6

Here are a few simple rules for structuring Ybot plugins.

Containing Python, Ruby or shell code.

Example Ybot:

Ybot math 3 ^ 2

Here Ybot calls the math plugin with the argument: '3 ^ 2'

Current plugins

These are Ybot's core plugins. You can find other plugins at ybot-contrib or see at ybot plugins catalog.

Ybot brain REST API

Ybot brain allows to persist data using REST API. It is designed to support multiple storage engines, but the default is based on Mnesia.

REST API endpoint: http://localhost:8090/memories (port and host is configurable). Currently supported Content Type is application/json.

An example JSON memory object:

{
 "id":"88DAF3FFB0419E0A8368036200000553620002B99862000429C1",
 "plugin":"foo",
 "key":"key1",
 "value":"foo1",
 "created":"2013-03-13 23:45:00"
 }

Operations using brain API:

OperationHTTP VerbUrlDescription
Insert newPOST/memoriesPass memory object without id and created field
Update existingPUT/memories/idPass memory object without id and created field
Remove by idDELETE/memories/idDelete field by id
Get allGET/memoriesReturn all fileds
Get by idGET/memories/idReturn field by id
Get by pluginGET/memories/?plugin=fooReturn data by plugin name
Get by keyGET/memories/?key=barReturn field by key
Get by valueGET/memories/?value=foobarReturn field by value

Contribute

Ybot is an open source project under the Erlang public license (see LICENSE file). Issues, questions and patches are welcome.

If you're hacking Ybot core, please, before sending your pull request, pull and merge Ybot master to avoid conflicts.

Author

Creator of Ybot @0xAX.

Thank you all who participating in Ybot developing. Names and contact information of those who helped, you can find the file AUTHORS.