defmodule LSG.IRC.AdminHandler do @moduledoc """ # admin !op op; requiert admin """ def irc_doc, do: nil def start_link(client) do GenServer.start_link(__MODULE__, [client]) end def init([client]) do ExIRC.Client.add_handler client, self {:ok, client} end def handle_info({:received, "!op", sender, chan}, client) do if LSG.IRC.admin?(sender) do ExIRC.Client.mode(client, chan, "+o", sender.nick) end {:noreply, client} end def handle_info(msg, client) do IO.inspect(msg) {:noreply, client} end end