   use Hedwig.Handler
 
   def init_keepalive do
-    Enum.each Application.get_env(:hedwig, :clients), fn(%{jid: jid}) ->
+    Enum.each clients, fn(%{jid: jid}) ->
       %{event_manager: pid} = jid |> String.to_atom |> Process.whereis |> :sys.get_state
       GenEvent.notify(pid, :init_keepalive)
     end

    stanza = Hedwig.Stanza.join(hd(client.rooms), client.nickname)
    Hedwig.Client.reply(pid, stanza)

    delay = Application.get_env(:fomobot, :keepalive_delay)
    :erlang.send_after(delay, self, :send_keepalive)
    {:ok, opts}
  end

  def handle_info(_msg, opts) do
    {:ok, opts}
  end
end

  def handle_info({_from, {:send_reply, message, reply}}, opts) do
    # Default behavior is to reply in the same room.
    # This writes to the FOMO room instead.
    message = put_in(message.from.user, notify_room)
    Hedwig.Handler.reply(message, Stanza.body(reply))
    {:ok, opts}
  end
