1 <?xml version=
"1.0" encoding=
"utf-8" ?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
6 <meta name=
"generator" content=
"Docutils 0.4.1: http://docutils.sourceforge.net/" />
8 <meta name=
"author" content=
"Enrico Tröger" />
9 <meta name=
"date" content=
"2008-03-24" />
10 <style type=
"text/css">
13 :Author: Enrico Troeger
14 :Contact: enrico(dot)troeger(at)uvena(dot)de
15 :Copyright: This stylesheet has been placed in the public domain.
17 Stylesheet for Geany's documentation based on a version of John Gabriele.
20 /*@import url(html4css1.css);*/
23 background-color: #f2f2f2;
39 text-decoration: none;
43 border-top:
1px dotted;
48 font-family: sans-serif;
71 font-family: sans-serif;
72 background-color: #DBEDD5;
74 border-left:
4px solid;
75 border-color: #
9FD98C;
79 background-color: #ECDFCE;
81 border-left:
4px solid;
82 border-color: #D9BE9A;
90 border:
1px solid #
200067;
94 border:
1px dotted #
200067;
98 border:
1px dotted #
200067;
122 <div class=
"document" id=
"vomak">
123 <h1 class=
"title">Vomak
</h1>
124 <h2 class=
"subtitle" id=
"a-very-simple-irc-bot">A very simple IRC bot
</h2>
125 <table class=
"docinfo" frame=
"void" rules=
"none">
126 <col class=
"docinfo-name" />
127 <col class=
"docinfo-content" />
129 <tr><th class=
"docinfo-name">Author:
</th>
130 <td>Enrico Tröger
</td></tr>
131 <tr><th class=
"docinfo-name">Date:
</th>
132 <td>2008-
03-
24</td></tr>
133 <tr><th class=
"docinfo-name">Version:
</th>
137 <p>Copyright ©
2008</p>
138 <p>Vomak is distributed under the terms of the GNU General Public
139 License as published by the Free Software Foundation; version
2
140 of the License. A copy of this license can be found in the file
141 COPYING included with the source code of this program.
</p>
142 <div class=
"section">
143 <h1><a id=
"big-fat-warning" name=
"big-fat-warning">BIG FAT WARNING
</a></h1>
144 <p>This code is not well tested and probably runs only on GNU/Linux systems.
145 There has no work been made in being compatible with other systems nor
147 This whole code was just written to get an IRC bot working and only was
148 published in case anyone might find it useful. The code quality is also
149 not very good, comments are missing.
150 It does not very much error checking, consider it running unstable.
151 This document is the only documentation available besides the source code.
</p>
152 <p>You have been warned.
</p>
154 <div class=
"section">
155 <h1><a id=
"about" name=
"about">About
</a></h1>
156 <p>Vomak is a very simple IRC bot with a few basic features.
157 It connects to an IRC server and joins a channel. Then it waits for
158 commands like
<tt class=
"docutils literal"><span class=
"pre">??
</span> <span class=
"pre">keyword
</span></tt>. This is the built-in help system, see
159 <a class=
"reference" href=
"#help-system">Help System
</a>.
160 Additionally, the bot creates a socket (Unix Domain Socket) where it
161 accepts directly IRC messages and a few special commands, see
162 <a class=
"reference" href=
"#socket-communication">Socket Communication
</a>.
</p>
164 <div class=
"section">
165 <h1><a id=
"get-the-code" name=
"get-the-code">Get the code
</a></h1>
166 <p>The source code is maintained in a GIT repository.
</p>
167 <p>GIT clone URL:
<a class=
"reference" href=
"http://repo.or.cz/r/vomak.git">http://repo.or.cz/r/vomak.git
</a></p>
168 <p>GIT web interface:
<a class=
"reference" href=
"http://repo.or.cz/w/vomak.git">http://repo.or.cz/w/vomak.git
</a></p>
169 <p>For downloading a tarball, use the web interface. There is a link
170 <tt class=
"docutils literal"><span class=
"pre">snapshot
</span></tt> which you can use to download a generated tarball og
173 <div class=
"section">
174 <h1><a id=
"configuration" name=
"configuration">Configuration
</a></h1>
175 <p>Vomak expects two configuration files in the ~/.vomak.
176 The first is
<tt class=
"docutils literal"><span class=
"pre">config
</span></tt> and defines basic settings for operation.
177 The settings should be self-explanatory.
178 The second file is
<cite>database
</cite> which contains all definitions for the
179 built-in help system. The format is pretty simple, each line contains
180 a key-value pair. The key should not contain whitespaces, quotes or any
181 special characters. The values can contain any characters except line
182 breaks. To add a line break, escape it with
<tt class=
"docutils literal"><span class=
"pre">\n
</span></tt>.
183 Each defined key-value pair can later be queried with the command
184 <tt class=
"docutils literal"><span class=
"pre">??
</span> <span class=
"pre">key
</span></tt>.
185 Examples of both files are included in the source code.
</p>
187 <div class=
"section">
188 <h1><a id=
"help-system" name=
"help-system">Help System
</a></h1>
189 <p>The built-in help system is a handy way to access often used information and
190 print them in the current channel for all users. It is triggered by two question
191 marks followed by a space and the keyword to search.
192 If the keyword is not known, nothing happens.
193 If it is known, Vomak will print the corresponding help text found in its database.
194 The database is a simple text file with some pre-defined help texts, see
195 <a class=
"reference" href=
"#configuration">Configuration
</a> above.
196 There is a special keyword named
<tt class=
"docutils literal"><span class=
"pre">keywords
</span></tt> which lists all known keywords.
</p>
198 <div class=
"section">
199 <h1><a id=
"socket-communication" name=
"socket-communication">Socket Communication
</a></h1>
200 <p>A Unix Domain Socket is created once Vomak has start up and it is meant for
201 inter-process communication with other applications running on this host.
202 Please be careful with connecting clients: the opened socket connection should
203 be closed as soon as all commands are sent and possible answers have been read.
204 The socket is non-blocking, i.e. while a client connects to the socket, Vomaks
205 main operation(reading and processing IRC messages) is blocked.
206 All commands are line-based, i.e. answers are terminated with
<tt class=
"docutils literal"><span class=
"pre">\r\n
</span></tt> and you
207 should your commands terminate with a
<tt class=
"docutils literal"><span class=
"pre">\r\n
</span></tt>.
208 Vomak accepts direct IRC messages (e.g.
<tt class=
"docutils literal"><span class=
"pre">PRIVMSG
</span> <span class=
"pre">#channel
</span> <span class=
"pre">:text
</span> <span class=
"pre">to
</span> <span class=
"pre">send
</span></tt>) or
209 the following special commands:
</p>
215 <div class=
"section">
216 <h2><a id=
"userlist" name=
"userlist">userlist
</a></h2>
217 <p>After sending this command to the socket, it will answer with a space separated
218 list of currently connected users to current channel.
219 Vomak caches this list for performance reasons and updates it every three minutes.
</p>
221 <div class=
"section">
222 <h2><a id=
"reload" name=
"reload">reload
</a></h2>
223 <p>This command performs a reload of the database with the help texts. This is useful
224 when you want to add, edit or remove some help texts and don't want to quit and start
227 <div class=
"section">
228 <h2><a id=
"quit" name=
"quit">quit
</a></h2>
229 <p>Does a graceful shutdown of the program. This can also achieved by the SIGTERM or SIGINT
235 <hr class=
"footer" />
236 <a class=
"reference" href=
"README">View document source
</a>.
237 Generated on:
2008-
03-
24 22:
50 UTC.
238 Generated by
<a class=
"reference" href=
"http://docutils.sourceforge.net/">Docutils
</a> from
<a class=
"reference" href=
"http://docutils.sourceforge.net/rst.html">reStructuredText
</a> source.