Giter VIP home page Giter VIP logo

hobot's Introduction

Hobot(an abbreviation of Homunculus Bot)

Build Status

A bot framework working on Erlang VM(BEAM). Plugins for Hobot are just :gen_server so you can meke a plugin with any language working on Erlang VM (e.g. Erlang, Elixir, LFE, Alpaca).

You can see an adapter sample and a handler sample.

Usage

% git clone https://github.com/niku/hobot
% cd hobot
% mix deps.get
% iex -S mix
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.6.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> bot_name = "EchoBot"
iex(2)> adapter_conf = %{module: Hobot.Plugin.Adapter.Shell, args: [Process.group_leader()]}
iex(3)> handlers_conf = [%{module: Hobot.Plugin.Handler.Echo, args: [["on_message"]]}]
iex(4)> {:ok, echo_bot} = Hobot.create(bot_name, adapter_conf, handlers_conf)
iex(5)> context = Hobot.context(echo_bot)
iex(6)> adapter_pid = Hobot.pid(context.adapter)
iex(7)> Hobot.Plugin.Adapter.Shell.gets("> ", adapter_pid)
> hello
"hello"
> hi
"hi"
> quit
nil
iex(8)>

Also, a sample application which works is eloido.

Installation

If available in Hex, the package can be installed by adding hobot to your list of dependencies in mix.exs:

def deps do
  [
    {:hobot, "~> 0.3.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/hobot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.