Skip to content

IRC events

swizzin.on(event, fn, opts?)

Calls fn(event) for each event of that kind. opts is {own = false, playback = false}:

  • own = true also receives events caused by your own nickname (your own messages, joins and nick changes).
  • playback = true also receives lines replayed by a bouncer (a server-time more than 30 seconds old).

An unknown event name is an error that lists the valid ones.

Event tables are read-only.

Field Meaning
kind The event name
network, network_name The network
me Your nickname there
target Channel or conversation, when there is one
nick Who caused it
text Message or topic text
time Milliseconds since the Unix epoch (the server-time tag when the server sent one)
origin "live", "playback" or "local"
is_self The event was caused by your own nickname
tags Read-only table of IRCv3 tags (time, msgid, account when present)
server Server name
Event Extra fields
message, private, notice, action text, target (for private, the other nickname)
join, part target; part also has reason
quit reason, channels (list)
nick old_nick, new_nick, channels
kick nick (who kicked), kicked, reason
topic text (new topic), nick (who set it)
mode modes, a list such as {"+o alice", "-v bob"}
connect You registered; nick
disconnect, reconnecting state

The user and host of the sender (nick!user@host) are not provided, and CTCP requests other than ACTION are not delivered.

Event text comes from IRC servers and other users. It reaches scripts as plain strings, never as markup.