4 Botbot is a very simple IRC bot written in Chicken Scheme.
5 It handles connection to an IRC server with a specified
6 nick, optionally joining a channel, and responding to
9 The logic behind message responses is handled by a function
10 defined in a text file provided at runtime, making the actual
11 functioning of the bot highly (overly?) configurable.
16 You'll need a Chicken 5 build environment to compile the bot.
17 With this, and the necessary eggs in place, use
21 to produce the binary. Move this to wherever makes you happy.
23 Note: "necessary eggs" includes machable, srfi-1, srfi-13, srfi-18,
29 Run botbot from the command line using:
31 botbot [options] proc-file host nick
35 -h/--help: print usage information
37 -p/--port PORT: specify irc server port
38 Otherwise the default ports of 6697 (TLS) or 6667 (no TLS) are used.
40 --notls: disable use of TLS (default is to use TLS)
42 -c/--channel CHANNEL: specify a channel for the bot to join on connecting
43 (Default behaviour is to not join any channel.)
45 proc-file: name of file defining bot logic (see below)
47 host: irc server hostname
49 nick: nick to assign to the bot
54 The proc-file must be a text file containing a single S-expression.
55 Botbot reads this expresion and expects the evaluation of this expression
56 to yield a procedure taking three arguments. Every time the bot receives
57 a message, this procedure is called. The three arguments are:
59 source: a string containing the source of the message (usually a nick)
60 args: a list containing the arguments of the message
61 privmsg: a procedure (privmsg dest . strings) to be used to send
62 messages in response, where dest can be a nick or a channel name.
64 For example, passing a proc-file containing the following sexp produces
65 a bot which responds with a private message "Bonjour!" in response to
66 a user sending "/msg botnick hello".
68 (lambda (source args privmsg)
69 (if (string=? (car args) "hello")
70 (privmsg source "Bonjour!")))
72 Other examples can be found in the examples/ subdirectory.
77 Botbot is free software. It is distributed under the terms of the GNU
78 General Public License version 3. A copy of this license is available
79 in the same directory as this README in a file named COPYING.