View Source TMI.Client (tmi.ex v0.5.0)
TMI wrapper for ExIRC.Client.
Link to this section Summary
Functions
Add a new event handler process.
Add a new event handler process, asynchronously.
Determine if a user is present in the provided channel.
Get a list of users in the provided channel.
Send a raw IRC command to TMI IRC server.
Connect to a server with the provided server and port via SSL.
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.
Kick a user from a channel.
Logon to a server.
Send an action message, i.e. (/me slaps someone with a big trout)
Map channel names to channel names with the prepended "#".
Leave a channel.
Quit the server.
Remove an event handler process.
Remove an event handler process, asynchronously
Send a channel message.
Stop the client process.
Send a whisper message to a user.
Link to this section Functions
Specs
add_handler(TMI.Conn.t(), pid()) :: :ok
Add a new event handler process.
Specs
add_handler_async(TMI.Conn.t(), pid()) :: :ok
Add a new event handler process, asynchronously.
Specs
channel_has_user?(TMI.Conn.t(), String.t(), String.t()) :: boolean() | {:error, :not_connected | :not_logged_in | :no_such_channel}
Determine if a user is present in the provided channel.
Specs
channel_users(TMI.Conn.t(), String.t()) :: [String.t()] | {:error, :not_connected | :not_logged_in | :no_such_channel}
Get a list of users in the provided channel.
Specs
Send a raw IRC command to TMI IRC server.
Specs
connect_ssl(TMI.Conn.t()) :: :ok | {:error, any()}
Connect to a server with the provided server and port via SSL.
Specs
is_connected?(TMI.Conn.t()) :: boolean()
Determine if the provided client process has an open connection to a server.
Specs
is_logged_on?(TMI.Conn.t()) :: boolean() | {:error, :not_connected}
Determine if the provided client is logged on to a server.
Specs
join(TMI.Conn.t(), String.t()) :: :ok | {:error, :not_connected | :not_logged_in}
Join a channel.
Specs
kick(TMI.Conn.t(), String.t(), String.t(), String.t()) :: :ok | {:error, :not_connected | :not_logged_in}
Kick a user from a channel.
Specs
logon(TMI.Conn.t()) :: :ok | {:error, :not_connected}
Logon to a server.
Your nickname (nick
) must be your Twitch username (login name) in lowercase.
A successful connection session looks like the following example:
< PASS oauth:<Twitch OAuth token>
< NICK <user>
> :tmi.twitch.tv 001 <user> :Welcome, GLHF!
> :tmi.twitch.tv 002 <user> :Your host is tmi.twitch.tv
> :tmi.twitch.tv 003 <user> :This server is rather new
> :tmi.twitch.tv 004 <user> :-
> :tmi.twitch.tv 375 <user> :-
> :tmi.twitch.tv 372 <user> :You are in a maze of twisty passages.
> :tmi.twitch.tv 376 <user> :>
Specs
Send an action message, i.e. (/me slaps someone with a big trout)
Map channel names to channel names with the prepended "#".
examples
Examples
iex> TMI.Client.normalize_channel("#foo")
|> expect("")
"#foo"
iex> TMI.Client.normalize_channel("bar")
|> expect("")
"#bar"
Specs
part(TMI.Conn.t(), String.t()) :: :ok | {:error, :not_connected | :not_logged_in}
Leave a channel.
Specs
quit(TMI.Conn.t(), String.t()) :: :ok | {:error, :not_connected | :not_logged_in}
Quit the server.
Specs
remove_handler(TMI.Conn.t(), pid()) :: :ok
Remove an event handler process.
Specs
remove_handler_async(TMI.Conn.t(), pid()) :: :ok
Remove an event handler process, asynchronously
Specs
Send a channel message.
Specs
stop(TMI.Conn.t()) :: :ok
Stop the client process.
Specs
Send a whisper message to a user.