defmodule Irc.Client.Command.Chghost do alias Irc.Parser.Line @type t :: {:chghost, old_mask :: Irc.Mask.t, new_mask :: Irc.Mask.t} def init() do {"CHGHOST", nil, "chghost"} end def handle_line(%Line{source: old_mask, args: [new_user, new_host]}, _) do new_mask = %Irc.Mask{old_mask | user: new_user, host: new_host} {:event, {:chghost, old_mask, new_mask}} end end