Skip to content

Instantly share code, notes, and snippets.

@nicholasf
Created February 18, 2014 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicholasf/9063470 to your computer and use it in GitHub Desktop.
Save nicholasf/9063470 to your computer and use it in GitHub Desktop.
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