summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Schoenfelder <paulschoenfelder@gmail.com>2013-12-10 00:35:06 -0600
committerPaul Schoenfelder <paulschoenfelder@gmail.com>2013-12-10 00:35:06 -0600
commitc9ab8c5c36411f6ac6b425ce0bf7f5c731fdb95b (patch)
tree88096453a5de0ea588dc06a161c4fc91704c5707 /lib
parentFix bug in remove_handler (diff)
Add docs to ExIrc supervisor module
Diffstat (limited to 'lib')
-rw-r--r--lib/exirc/exirc.ex29
1 files changed, 25 insertions, 4 deletions
diff --git a/lib/exirc/exirc.ex b/lib/exirc/exirc.ex
index a94c942..e016c60 100644
--- a/lib/exirc/exirc.ex
+++ b/lib/exirc/exirc.ex
@@ -3,10 +3,30 @@ defmodule ExIrc do
Supervises IRC client processes
Usage:
- # Start the supervisor (started automatically when ExIrc is run as an application)
- ExIrc.start_link
- # Start a new IRC client
- {:ok, client} = ExIrc.start_client!
+
+ # Start the supervisor (started automatically when ExIrc is run as an application)
+ ExIrc.start_link
+
+ # Start a new IRC client
+ {:ok, client} = ExIrc.start_client!
+
+ # Connect to an IRC server
+ ExIrc.Client.connect! client, "localhost", 6667
+
+ # Logon
+ ExIrc.Client.logon client, "password", "nick", "user", "name"
+
+ # Join a channel (password is optional)
+ ExIrc.Client.join client, "#channel", "password"
+
+ # Send a message
+ ExIrc.Client.msg client, :privmsg, "#channel", "Hello world!"
+
+ # Quit (message is optional)
+ ExIrc.Client.quit client, "message"
+
+ # Stop and close the client connection
+ ExIrc.Client.stop! client
"""
use Supervisor.Behaviour
@@ -36,6 +56,7 @@ defmodule ExIrc do
# Supervisor API
##############
+ @spec init(any) :: {:ok, pid} | {:error, term}
def init(_) do
supervise [], strategy: :one_for_one
end