exirc v1.1.0 ExIRC.Client
Maintains the state and behaviour for individual IRC client connections
Link to this section Summary
Functions
Add a new event handler process
Add a new event handler process, asynchronously
Determine if a nick is present in the provided channel
Get the topic of the provided channel
Get the channel type of the provided channel
Get a list of users in the provided channel
Get details about each of the client's currently joined channels
Returns a specification to start this module under a supervisor
Send a raw IRC command
Transform state for hot upgrades/downgrades
Connect to a server with the provided server and port
Connect to a server with the provided server and port via SSL
Handle calls from the external API. It is not recommended to call these directly
Handles asynchronous messages from the external API. Not recommended to call these directly
Handle ExIRC.Messages received from the server
Handle messages from the SSL socket connection
Called when GenServer initializes the client
Invite a user to a channel
Determine if the provided client process has an open connection to a server
Determine if the provided client is logged on to a server
Join a channel, with an optional password
Kick a user from a channel
Logon to a server
Send an action message, i.e. (/me slaps someone with a big trout)
Change mode for a user or channel
Send a message to a nick or channel Message types are: :privmsg :notice :ctcp
Change the client's nick
Leave a channel
Quit the server, with an optional part message
Remove an event handler process
Remove an event handler process, asynchronously
Start a new IRC client process
Start a new IRC client process
Get the current state of the provided client
Stop the IRC client process
Handle termination
Ask the server for the channel's users
Ask the server for the user's informations
Link to this section Functions
add_handler(client, pid)
Add a new event handler process
add_handler_async(client, pid)
Add a new event handler process, asynchronously
channel_has_user?(client, channel, nick)
Determine if a nick is present in the provided channel
channel_topic(client, channel)
Get the topic of the provided channel
channel_type(client, channel)
Get the channel type of the provided channel
channel_users(client, channel)
Get a list of users in the provided channel
channels(client)
Get details about each of the client's currently joined channels
child_spec(arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
cmd(client, raw_cmd)
Send a raw IRC command
code_change(old, state, extra)
Transform state for hot upgrades/downgrades
connect!(client, server, port, options \\ [])
connect!(
client :: pid(),
server :: binary(),
port :: non_neg_integer(),
options :: list() | nil
) :: :ok
connect!( client :: pid(), server :: binary(), port :: non_neg_integer(), options :: list() | nil ) :: :ok
Connect to a server with the provided server and port
Example: Client.connect! pid, "localhost", 6667
connect_ssl!(client, server, port, options \\ [])
connect_ssl!(
client :: pid(),
server :: binary(),
port :: non_neg_integer(),
options :: list() | nil
) :: :ok
connect_ssl!( client :: pid(), server :: binary(), port :: non_neg_integer(), options :: list() | nil ) :: :ok
Connect to a server with the provided server and port via SSL
Example: Client.connect! pid, "localhost", 6697
handle_call(msg, from, state)
Handle calls from the external API. It is not recommended to call these directly.
handle_cast(msg, state)
Handles asynchronous messages from the external API. Not recommended to call these directly.
handle_data(msg, state)
Handle ExIRC.Messages received from the server.
handle_info(msg, state)
Handle messages from the SSL socket connection.
init(options \\ [])
init([any()] | []) :: {:ok, ExIRC.Client.ClientState.t()}
init([any()] | []) :: {:ok, ExIRC.Client.ClientState.t()}
Called when GenServer initializes the client
invite(client, nick, channel)
Invite a user to a channel
is_connected?(client)
is_connected?(client :: pid()) :: true | false
is_connected?(client :: pid()) :: true | false
Determine if the provided client process has an open connection to a server
is_logged_on?(client)
is_logged_on?(client :: pid()) :: true | false
is_logged_on?(client :: pid()) :: true | false
Determine if the provided client is logged on to a server
join(client, channel, key \\ "")
Join a channel, with an optional password
kick(client, channel, nick, message \\ "")
Kick a user from a channel
logon(client, pass, nick, user, name)
Logon to a server
Example: Client.logon pid, "password", "mynick", "user", "My Name"
me(client, channel, msg)
Send an action message, i.e. (/me slaps someone with a big trout)
mode(client, channel_or_nick, flags, args \\ "")
Change mode for a user or channel
msg(client, type, nick, msg)
Send a message to a nick or channel Message types are: :privmsg :notice :ctcp
names(client, channel)
nick(client, new_nick)
Change the client's nick
part(client, channel)
Leave a channel
quit(client, msg \\ "Leaving..")
Quit the server, with an optional part message
remove_handler(client, pid)
Remove an event handler process
remove_handler_async(client, pid)
Remove an event handler process, asynchronously
start!(options \\ [])
Start a new IRC client process
Returns either {:ok, pid} or {:error, reason}
start_link(options \\ [], process_opts \\ [])
Start a new IRC client process.
Returns either {:ok, pid} or {:error, reason}
state(client)
Get the current state of the provided client
stop!(client)
stop!(client :: pid()) :: {:stop, :normal, :ok, ExIRC.Client.ClientState.t()}
stop!(client :: pid()) :: {:stop, :normal, :ok, ExIRC.Client.ClientState.t()}
Stop the IRC client process
terminate(reason, state)
Handle termination
who(client, channel)
Ask the server for the channel's users
whois(client, user)
Ask the server for the user's informations.