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"
+--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
+--
+ 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 @@

Module 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

@@ -84,7 +84,7 @@ irc:part (channel) - Parts channel. + Leaves channel. @@ -275,7 +275,7 @@ Joins channel, optionally with the channel password keyirc:part (channel)
-Parts channel. +Leaves channel.

Parameters