mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-07-15 06:10:22 +02:00
Add PreRegister hook
This is useful for CAP commands and SASL.
This commit is contained in:
@ -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.
|
||||
-- <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>OnDisconnect(message, errorOccurred)</code></li>
|
||||
-- <li><code>OnChat(user, channel, message)</code></li>
|
||||
|
3
init.lua
3
init.lua
@ -116,6 +116,9 @@ function meta_preconnect:connect(_host, _port)
|
||||
|
||||
self.socket = s
|
||||
setmetatable(self, meta)
|
||||
|
||||
self:invoke("PreRegister", self)
|
||||
self:send("CAP END")
|
||||
|
||||
if password then
|
||||
self:send("PASS %s", password)
|
||||
|
Reference in New Issue
Block a user