exirc v0.11.0 ExIrc.Utils
Summary
Functions
Get CTCP formatted time from a tuple representing the current calendar time
Parse RPL_ISUPPORT message
Parse an IRC message
Functions
Specs
ctcp_time(datetime :: {{integer, integer, integer}, {integer, integer, integer}}) :: binary
Get CTCP formatted time from a tuple representing the current calendar time:
Example:
iex> local_time = {{2013,12,6},{14,5,0}}
{{2013,12,6},{14,5,0}}
iex> ExIrc.Utils.ctcp_time local_time
"Fri Dec 06 14:05:00 2013"
Specs
isup(parameters :: [binary], state :: ExIrc.Client.ClientState.t) :: ExIrc.Client.ClientState.t
Parse RPL_ISUPPORT message.
If an empty list is provided, do nothing, otherwise parse CHANTYPES, NETWORK, and PREFIX parameters for relevant data.
Specs
parse(raw_data :: char_list) :: IrcMessage.t
Parse an IRC message
Example:
data = ':irc.example.org 005 nick NETWORK=Freenode PREFIX=(ov)@+ CHANTYPES=#&'
message = ExIrc.Utils.parse data
assert "irc.example.org" = message.server