Blur v0.2.1-beta1 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 default IRC 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(), cap :: binary()) :: :ok | {:error, atom()}

Request the CAP (capability) on the server

Example

iex> Blur.IRC.cap_request client, ':twitch.tv/membership'
:ok

Specs

connect!(client :: pid()) :: :ok

Connect to the default IRC server.

Example

iex> Blur.IRC.connect client
:ok
Link to this function

connect!(client, host, port)

View Source

Specs

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

Connect to the IRC server.

Example

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

Specs

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

Join an IRC channel.

Example

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

join_many(client, channels)

View Source

Specs

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

Join many channels.

Example

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

login(client, nick, pass)

View Source

Specs

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

Login to the server.

Example

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

Parse oauth token

Example

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

Specs

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

Part from IRC channel.

Example

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

Specs

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

Quit the IRC server with no message.

Example

iex> Blur.IRC.quit client
:ok

Specs

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

Quit the IRC server.

Example

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

request_twitch_capabilities(client)

View Source

Specs

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

Request twitch for capabilities

Example

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

say(client, channel, msg)

View Source

Specs

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

Send a message to the channel

Example

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

Stop the IRC client process

Example

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