Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ybot - is a helpful robot which inspired with Github hubot
branch: master

This branch is 224 commits behind OtpChatBot:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
plugins
priv
src
.gitignore
.travis.yml
AUTHORS
Changelog.md
LICENSE
Makefile
Procfile
README.md
rebar
rebar.config
start.sh
ybot.config

README.md

Ybot

Ybot is a customizable bot which was inspired by GitHub's Hubot. Hubot is really cool, but sorry, I don't like JavaScript and I don't know coffescript. Ybot is completely written in Erlang/OTP and you can write plugins in Python, Perl, Ruby, or even in shell.

Build Status

Flattr this git repo

Features

  • Completely written in Erlang;
  • Simultaneously run any number of bots on different transports;
  • Supports plugins in different technology;
    • Python plugins;
    • Ruby plugins;
    • Shell plugins;
    • Perl plugins;
    • Elixir plugins;
  • You don't need to know Erlang to write a plugin;
  • Command history with tunable limit;
  • Dynamic loading of plugins;
  • Very easily extensible;
  • Supports IRC and IRC via SSL;
  • Supports XMPP and XMPP via ssl;
  • Supports Campfire
  • HTTP interface;
  • GTalk supporting;
  • HipChat supporting;

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

Then edit the ybot.config configuration file and you can run your Ybot copy:

./start.sh

Run on heroku

  • Get you ybot and configure it.
  • Download heroku
cd Ybot
heroku create your-application-name -s cedar
heroku config:add BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-erlang.git
git push heroku master

Dependencies

  • lager - A logging framework for Erlang/OTP.
  • reloader - Mochiweb's reloader.
  • ibrowse - Erlang http client.
  • mochijson2 - Erlang json encoder/decoder.
  • cowboy - Small, fast, modular HTTP server written in Erlang.

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:

  • IRC (+ssl supporting, +private messages supporting).
  • XMPP MUC (+single user chat supporting, +private messages supporting, +ssl supporting).
  • Campfire.
  • HTTP.
  • Gtalk.
  • HipChat.

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.

  • You must address messages to the Ybot.

  • After addressing the bot you specify the command to be executed, for example math or ping. Every command consists from one word.

  • After the command you can specify arguments. Ybot sends all arguments in '' and it turns them into one argument.

  • One command = One plugin. Plugins must live in the plugins directory.

  • Each plugin must have the correct extension, for example:

    • .py
    • .rb
    • .shell

Containing Python, Ruby or shell code.

  • The name of the plugin file must be the same name as the command. For example if we have a Ybot ping command, we must have a plugin named ping.py or ping.rb or ping.shell, etc.

  • Plugin can consist of any code but write the results to STDOUT in the end.

Example Ybot:

Ybot math 3 ^ 2

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

Current plugins

  • chuck - Chuck Norris quotes :)
  • decide - Ybot try to help make decisions for you.
  • github_status - Github status state.
  • help - Ybot help.
  • ping - Ybot simple ping/pong.
  • math - Ybot calculate math expressions.
  • date - Ybot show date/time.
  • pugme - Ybot pugme service plugin.
  • erl - Ybot computation of erlang expression using tryerlang.org.
  • today? - Ybot return current day.
  • shorten_url - Ybot url shortener with goo.gl.
  • hacker_news - Ybot download news from https://news.ycombinator.com/
  • wat - Ybot random WAT image
  • check-site - Ybot check site up/down state
  • ruby - Ybot eval simple ruby expression
  • ip - Ybot external ip
  • hacker_help - Ybot search in stackoverflow.

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

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 Yubotu, you can find the file AUTHORS

Something went wrong with that request. Please try again.