~pkal/irc.awk

irc.awk/README -rw-r--r-- 1.3 KiB
ca64b43dPhilip Kaludercic Explain how to call an irc.awk bot 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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:

	https://lists.sr.ht/~pkal/public-inbox

irc.awk is currently maintained here on sourcehut:

	https://git.sr.ht/~pkal/irc.awk

Licensing
---------

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