Created
February 18, 2014 02:22
-
-
Save nicholasf/9063470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Spoonbot do | |
use Application.Behaviour | |
def start(_type, _args) do | |
bot_hello = SpoonCommand.new( | |
pattern: ~r/speak/, | |
cmd: fn(data) -> | |
SpoonResponse.new(msg: data) | |
end | |
) | |
vocab = [bot_hello] | |
irc_pid = spawn(Bridge.IRC, :run, [vocab]) | |
http_pid = spawn(Bridge.HTTP, :run, [vocab]) | |
Spoonbot.Supervisor.start_link | |
end | |
end | |
defrecord SpoonCommand, pattern: nil, cmd: nil | |
defrecord SpoonResponse, msg: nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment