~pkal/irc.awk

An IRC library for AWK
Set $0 the message content on PRIVMSG
c9940ab3 — Philip Kaludercic 1 year, 1 month ago
Rename README to README.md
77efeae7 — Philip Kaludercic 1 year, 1 month ago
Add auxiliary function irc_shell

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~pkal/irc.awk
read/write
git@git.sr.ht:~pkal/irc.awk

You can also use your local clone with git send-email.

#irc.awk

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.

#Example

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.

#Usage

The DOCUMENTATION file explains each variable and function necessary to use this library.

#Bugs and Comments

Bug reports, issues, questions and patches should be sent to my public inbox.

irc.awk is currently maintained on sourcehut.

#Licensing

irc.awk is distributed under CC0, for more details please refer to the LICENSE file.