mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-24 17:00:21 +01:00
Add PreRegister hook
This is useful for CAP commands and SASL.
This commit is contained in:
parent
ad53b2aeb1
commit
1d0480adba
@ -125,6 +125,7 @@ function irc:shutdown()
|
|||||||
|
|
||||||
--- List of hooks you can use with irc:hook. The parameter list describes the parameters passed to the callback function.
|
--- List of hooks you can use with irc:hook. The parameter list describes the parameters passed to the callback function.
|
||||||
-- <ul>
|
-- <ul>
|
||||||
|
-- <li><code>PreRegister(connection)</code>Useful for CAP commands and SASL.</li>
|
||||||
-- <li><code>OnRaw(line) - (any non false/nil return value assumes line handled and will not be further processed)</code></li>
|
-- <li><code>OnRaw(line) - (any non false/nil return value assumes line handled and will not be further processed)</code></li>
|
||||||
-- <li><code>OnDisconnect(message, errorOccurred)</code></li>
|
-- <li><code>OnDisconnect(message, errorOccurred)</code></li>
|
||||||
-- <li><code>OnChat(user, channel, message)</code></li>
|
-- <li><code>OnChat(user, channel, message)</code></li>
|
||||||
|
3
init.lua
3
init.lua
@ -117,6 +117,9 @@ function meta_preconnect:connect(_host, _port)
|
|||||||
self.socket = s
|
self.socket = s
|
||||||
setmetatable(self, meta)
|
setmetatable(self, meta)
|
||||||
|
|
||||||
|
self:invoke("PreRegister", self)
|
||||||
|
self:send("CAP END")
|
||||||
|
|
||||||
if password then
|
if password then
|
||||||
self:send("PASS %s", password)
|
self:send("PASS %s", password)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user