mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-10 10:00:28 +01:00
Added irc:setmode()
This commit is contained in:
parent
af2f48553f
commit
4f17455fbe
17
init.lua
17
init.lua
@ -223,6 +223,10 @@ handlers["PING"] = function(o, prefix, query)
|
|||||||
end
|
end
|
||||||
|
|
||||||
handlers["001"] = function(o)
|
handlers["001"] = function(o)
|
||||||
|
if type(o.config.startup) == "function" then
|
||||||
|
o.config.startup(o)
|
||||||
|
end
|
||||||
|
|
||||||
o.join = postAuth_join
|
o.join = postAuth_join
|
||||||
for k,room in ipairs(o.rooms) do
|
for k,room in ipairs(o.rooms) do
|
||||||
o:join(room.name, room.key)
|
o:join(room.name, room.key)
|
||||||
@ -350,3 +354,16 @@ function meta:whois(nick)
|
|||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function meta:setmode(t)
|
||||||
|
local target = t.target or self.nick
|
||||||
|
local mode = ""
|
||||||
|
local add, rem = t.add, t.remove
|
||||||
|
if add then
|
||||||
|
mode = table.concat{mode, "+", add}
|
||||||
|
elseif rem then
|
||||||
|
mode = table.concat{mode, "-", rem}
|
||||||
|
end
|
||||||
|
|
||||||
|
self:send("MODE %s %s", target, mode)
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user