Set $0 the message content on PRIVMSG
Rename README to README.md
Add auxiliary function irc_shell
Find here an IRC "library" in AWK. It is intended to be simple to use and fit somewhat organically into AWK.
Currently the library is restricted to only being able to implement event-based clients, i.e. clients that react to some external event, but have no initiative themselves (eg. send a messages at 5 PM, send a message every 3 seconds, etc.).
Furthermore the GNU AWK implementation is required, but it is intended to drop this in the future.
This is the body of script that would greet every new user that joins a channel, and that responds to anyone who starts a message with "hi":
#!/usr/bin/gawk -f irc.awk -f
BEGIN {
irc_setup("irc.server.com", "ssl", "bot", "#test");
}
JOIN { irc_msg("greetings, welcome to " TO); }
READ("^hi\W") { irc_msg("hi, " WHO); }
The "examples" directory contains more examples and commentary.
The DOCUMENTATION file explains each variable and function necessary to use this library.
Bug reports, issues, questions and patches should be sent to my public inbox.
irc.awk is currently maintained on sourcehut.
irc.awk is distributed under CC0, for more details please refer to the LICENSE file.