https://github.com/niku/hobot
A bot framework working on Erlang VM(BEAM)
https://github.com/niku/hobot
beam bot-framework elixir erlang-vm
Last synced: 22 days ago
JSON representation
A bot framework working on Erlang VM(BEAM)
- Host: GitHub
- URL: https://github.com/niku/hobot
- Owner: niku
- License: mit
- Created: 2016-07-07T11:12:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T11:21:43.000Z (about 7 years ago)
- Last Synced: 2025-09-15T09:02:00.792Z (22 days ago)
- Topics: beam, bot-framework, elixir, erlang-vm
- Language: Elixir
- Homepage:
- Size: 88.9 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hobot(an abbreviation of Homunculus Bot)
[](https://travis-ci.org/niku/hobot)
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](https://github.com/erlang/otp), [Elixir](https://github.com/elixir-lang/elixir), [LFE](https://github.com/rvirding/lfe/), [Alpaca](https://github.com/alpaca-lang/alpaca)).
You can see [an adapter sample](https://github.com/niku/hobot/tree/v0.2.0/lib/hobot/adapters/shell.ex) and [a handler sample](https://github.com/niku/hobot/tree/v0.2.0/lib/hobot/handlers/echo.ex).
## Usage
```console
% 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](https://github.com/niku/eloido).
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `hobot` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:hobot, "~> 0.3.0"}
]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/hobot](https://hexdocs.pm/hobot).