diff --git a/doc/irc.luadoc b/doc/irc.luadoc
index 44ea413..97abe09 100644
--- a/doc/irc.luadoc
+++ b/doc/irc.luadoc
@@ -1,5 +1,27 @@
--- LuaIRC is a low-level IRC library for Lua.
-- All functions raise Lua exceptions on error.
+--
+-- Use new
to create a new IRC object.
+-- Example:
+--
+--require "irc"
+
module "irc"
--- Create a new IRC object.
diff --git a/doc/modules/irc.html b/doc/modules/irc.html
index 27a5ded..3a12f4f 100644
--- a/doc/modules/irc.html
+++ b/doc/modules/irc.html
@@ -53,7 +53,7 @@
+--local sleep = require "socket".sleep
+--
+--local s = irc.new{nick = "example"}
+--
+--s:hook("OnChat", function(user, channel, message)
+-- print(("[%s] %s: %s"):format(channel, user.nick, message))
+--end)
+--
+--s:connect("irc.example.net")
+--s:join("#example")
+--
+--while true do
+-- s:think()
+-- sleep(0.5)
+--end
+--
irc
LuaIRC is a low-level IRC library for Lua. All functions raise Lua exceptions on error.
+LuaIRC is a low-level IRC library for Lua. All functions raise Lua exceptions on error. Use new
to create a new IRC object.
Example:
require "irc"
local sleep = require "socket".sleep
local s = irc.new{nick = "example"}
s:hook("OnChat", function(user, channel, message)
print(("[%s] %s: %s"):format(channel, user.nick, message))
end)
s:connect("irc.example.net")
s:join("#example")
while true do
s:think()
sleep(0.5)
end
channel
.channel
.channel
, optionally with the channel password key
irc:part (channel)
channel
.
+Leaves channel
.