Blur v0.2.1-beta3 Blur.IRC View Source

Shortcuts for IRC options to auto join channels

client is a process of ExIRC.Client.start_link

Link to this section Summary

Functions

Request the CAP (capability) on the server

Connect to the IRC server.

Join an IRC channel.

Join many channels.

Login to the server.

Parse oauth token

Part from IRC channel.

Quit the IRC server with no message.

Quit the IRC server.

Request twitch for capabilities

Send a message to the channel

Stop the IRC client process

Link to this section Functions

Link to this function

cap_request(client, cap)

View Source

Specs

cap_request(client :: pid() | atom(), cap :: binary()) :: :ok | {:error, atom()}

Request the CAP (capability) on the server

Example

Blur.IRC.cap_request client, ':twitch.tv/membership'
:ok
Link to this function

connect!(client, host, port)

View Source

Specs

connect!(client :: pid() | atom(), host :: binary(), port :: non_neg_integer()) ::
  :ok

Connect to the IRC server.

Example

Blur.IRC.connect client, "irc.twitch.tv", 6667
:ok

Specs

join(client :: pid() | atom(), channel :: binary()) :: :ok | {:error, atom()}

Join an IRC channel.

Example

Blur.IRC.join client, "#rockerboo"
:ok
Link to this function

join_many(client, channels)

View Source

Specs

join_many(client :: pid() | atom() | atom(), list()) :: :ok | {:error, atom()}

Join many channels.

Example

Blur.IRC.join_many client, ["#rockerboo", "#adattape"]
:ok
Link to this function

login(client, nick, pass)

View Source

Specs

login(client :: pid() | atom(), nick :: binary(), pass :: binary()) ::
  :ok | {:error, :not_connected}

Login to the server.

Example

Blur.IRC.login client, "rockerBOO", "oauth:oauthhashherewithlettersandnumbers"
:ok

Parse oauth token

Example

iex> Blur.IRC.parse_token "oauthhashherewithlettersandnumbers"
"oauth:oauthhashherewithlettersandnumbers"

Specs

part(client :: pid() | atom(), channel :: binary()) :: :ok | {:error, atom()}

Part from IRC channel.

Example

Blur.IRC.part client, "#rockerboo"
:ok

Specs

quit(client :: pid() | atom()) :: :ok | {:error, atom()}

Quit the IRC server with no message.

Example

Blur.IRC.quit client
:ok

Specs

quit(client :: pid() | atom(), msg :: nil | binary()) :: :ok | {:error, atom()}

Quit the IRC server.

Example

Blur.IRC.quit client, "Goodbye!"
:ok
Link to this function

request_twitch_capabilities(client)

View Source

Specs

request_twitch_capabilities(client :: pid() | atom()) :: :ok | {:error, atom()}

Request twitch for capabilities

Example

Blur.IRC.request_twitch_capabilities client
:ok
Link to this function

say(client, channel, msg)

View Source

Specs

say(client :: pid() | atom(), channel :: binary(), msg :: binary()) ::
  :ok | {:error, atom()}

Send a message to the channel

Example

Blur.IRC.say client, "#rockerboo", "Hello"
:ok

Specs

stop!(client :: pid() | atom()) ::
  {:stop, :normal, :ok,
   %ExIRC.Client.ClientState{
     autoping: term(),
     channel_prefixes: term(),
     channels: term(),
     connected?: term(),
     debug?: term(),
     event_handlers: term(),
     inet: term(),
     logged_on?: term(),
     login_time: term(),
     name: term(),
     network: term(),
     nick: term(),
     owner: term(),
     pass: term(),
     port: term(),
     retries: term(),
     server: term(),
     socket: term(),
     ssl?: term(),
     user: term(),
     user_prefixes: term(),
     who_buffers: term(),
     whois_buffers: term()
   }}

Stop the IRC client process

Example

Blur.IRC.stop! client
{:stop, :normal, :ok, %ExIRC.Client{}}