-
Notifications
You must be signed in to change notification settings - Fork 7
Event List
KitnIRC uses an event system to run code when certain things occur. These events specific to KitnIRC but often linked to corresponding IRC events. There are two types of events that KitnIRC uses: high-level logical events, and low-level network events.
These events are the bread and butter of KitnIRC. They represent the kinds of things to which a typical IRC-using application might want to respond.
This event fires when KitnIRC has successfully connected to the IRC server and is considered "on the network" - specifically, it's triggered by the RPL_WELCOME
response from the server.
Arguments: hostmask
(your hostmask as perceived by the IRC network).
These events are mostly used internally by KitnIRC, but you can also hook into them if you have a specific need. In most cases, however, you shouldn't need to worry about them.
This event fires when it's time for KitnIRC to potentially supply a password to the IRC server as part of its connection process (the IRC PASS
command). It allows modules to supply this password (e.g. from a configuration file) rather than having it passed in as part of the .connect()
call. If any PASSWORD
handler returns a boolean true value, KitnIRC will assume a PASS
command has been issued by the handler and will not send another. (Example usage: kitnirc.contrib.foonetic
.)
Arguments: none.
This event fires when a socket connection is successfully opened to the IRC server, but before any actual IRC protocol traffic is sent. By default, this triggers sending the NICK
and USER
IRC messages being sent to the server. In most cases where you think you want to use this event, you probably actually want the logical event WELCOME
instead.
Arguments: none.
This event fires every time a complete line of IRC protocol traffic is received, no matter what kind of traffic it is. You typically don't want to handle this, as this traffic will get routed through KitnIRC's own parsers and get split up into different logical events based on its type.
Arguments: line
(the content of the line).
This event fires any time a complete line of IRC protocol traffic is received and KitnIRC doesn't have any defined way to handle it (for instance, if the IRC server implements a superset of the standard IRC features, the extra functionality probably won't be handled by KitnIRC). You can listen for this event to write your own handlers for these responses, up to and including dispatching your own events.
Arguments: line
(the content of the line).