     state = receive do
       {:internal, msg} ->
         case msg do
-          {:add_hook, id, hook, opts} ->
-            state_add_hook(state, id, hook, opts)
+          {:add_hook, id, f, opts} ->
+            state_add_hook(state, id, f, opts)
           {:remove_hook, id} ->
             state_remove_hook(state, id)
           other ->

end

defmodule PingHook do
  def run(text) do
    if String.downcase(text) == "ping" do
      {:msg, "pong"}
    end
  end
end

          "!eval " <> expr ->
            IO.puts "Eval expr #{expr}"
            {:reply, Evaluator.eval(expr)}
          _ -> {:msg, sender, msg}
        end
      'PING' ->
        :pong
