exirc v2.0.0 ExIRC.Utils

Link to this section Summary

Functions

Get CTCP formatted time from a tuple representing the current calendar time

Parse RPL_ISUPPORT message.

Parse an IRC message

Link to this section Functions

Link to this function

ctcp_time(datetime)

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"
Link to this function

isup(list, state)

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.

Link to this function

parse(raw_data)

Specs

parse(raw_data :: charlist()) :: ExIRC.Message.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