A chat bot framework for Elixir applications
APACHE-2.0 License
Clover is a framework for building chat bots in Elixir. It takes inspiration from Hubot and Hedwig. Like Hubot and Hedwig, Clover:
Like Hedwig, Clover:
Clover adds some features:
Planned features for Clover:
The package can be installed by adding clover
to your list of dependencies in mix.exs
:
def deps do
[
{:clover, "~> 0.1.0"}
]
end
Coming soon. See the Test Robot for an example.
Clover bots always run under a Clover.Robot.Supervisor
process. The supervisor handles crashes in your robot or in its adapter, and restarts processes as needed. However, you have some choice as to who supervises the supervisor.
Let's say you have a Clover bot called Mybot
. To start a robot under Clover's supervision tree, provide a name, your bot's module, and an adapter:
Clover.start_supervised_robot("mybot", Mybot, {Clover.Adapter.Slack, token: "my-slack-bot-token"})
Clover will start your robot under its own supervision tree, and manage it for you.
(The name you provide here will be used to register your robot with Clover. It's not your robot's chat nick.)
To handle supervision yourself:
Clover.start_robot("mybot", Mybot, {Clover.Adapter.Slack, token: "my-slack-bot-token"})
The individual robot and adapter processes will still be supervised by a Clover.Robot.Supervisor
, but you can place this process into your own supervision tree, for greater control over its lifecycle.
Clover is designed to support multiple chat platforms through adapters. Currently, there is a test adapter bundled with Clover, and a Slack adapter (which is also bundled with Clover, but will be pulled out in the future).