chiark / gitweb /
mention #urls
[irc.git] / servus.html
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html 
3      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
7 <head>
8 <title>Servus Documentation</title>
9 <style type="text/css">
10 body {background: white; color: black; text-align: left}
11 h1 {text-align: center; font-weight: bold; font-size: xx-large}
12 h2 {font-weight: bold; font-size: x-large}
13 h3, h4, h5, h6 {font-weight: bold; font-size: large}
14 li {list-style-type: circle}
15 hr {clear: both}
16 span.code {font-family: courier, monospace}
17 </style>
18 </head>
19
20 <body>
21 <h1>Servus Documentation</h1> 
22
23 <h2>Introduction</h2>
24 <p>Servus is one of the IRC bots on <span
25 class="code">#chiark</span>. This page documents the available
26 commands. You can get a copy of the source code by running <span
27 class="code">git-clone <a
28 href="http://www.chiark.greenend.org.uk/~matthewv/irc/.git">http://www.chiark.greenend.org.uk/~matthewv/irc/.git</a></span></p>
29
30 <h2>Invocation</h2>
31 <p>Servus may be invoked in-channel using either <span
32 class="code">!command</span> or <span
33 class="code">~command</span>. Alternatively, you may pass commands by
34 <span class="code">/msg</span>.
35 </p>
36
37 <h2>Commands</h2>
38
39 <ul>
40 <li><a href="#define">define</a></li>
41 <li><a href="#die">die</a></li>
42 <li><a href="#do">do</a></li>
43 <li><a href="#fish">fish</a></li>
44 <li><a href="#flirt">flirt</a></li>
45 <li><a href="#google">google</a></li>
46 <li><a href="#help">help</a></li>
47 <li><a href="#info">info</a></li>
48 <li><a href="#karma">karma</a></li>
49 <li><a href="#karmadel">karmadel</a></li>
50 <li><a href="#karmalist">karmalist</a></li>
51 <li><a href="#list">list</a></li>
52 <li><a href="#nsfw">nsfw</a></li>
53 <li><a href="nws">nws</a></li>
54 <li><a href="#quiet">quiet</a></li>
55 <li><a href="#quit">quit</a></li>
56 <li><a href="#reload">reload</a></li>
57 <li><a href="#rot13">rot13</a></li>
58 <li><a href="#say">say</a></li>
59 <li><a href="#slash">slash</a></li>
60 <li><a href="#trout">trout</a></li>
61 <li><a href="#twit">twit</a></li>
62 <li><a href="#units">units</a></li>
63 <li><a href="#url">url</a></li>
64 </ul>
65
66 <hr />
67
68 <h3><a name="define">define</a></h3>
69 <p>This command returns (either on-channel or by <span
70 class="code">/msg</span>) a definition of the argument(s) of the
71 "define" command. This is done by using a "define:" query on
72 google, so the results may be a little unusual at times...</p>
73
74 <h3><a name="die">die</a></h3>
75 <p>This command must be invoked by <span class="code">/msg</span> only,
76 and is only effective if invoked by the bot's owner. The bot
77 exits.</p>
78
79 <h3><a name="do">do</a></h3>
80 <p>This command must be invoked by <span class="code">/msg</span>, and
81 is only effective if invoked by the bot's owner. The syntax is:<br />
82 <span class="code">/msg Servus do thing</span><br />...which results
83 in output to the channel of the form:<br />
84 <span class="code">* Servus/#chiark thing</span></p>
85
86 <h3><a name="fish">fish</a></h3>
87 <p>This command must be invoked by <span class="code">/msg</span>, and
88 is only effective if invoked by the bot's owner. It
89 returns some details about the internal state of the "fishpond" (a
90 simple rate-limiting feature for restricting the over-use of <span
91 class="code">trout</span>, <span class="code">flirt</span>, and <span
92 class="code">slash</span>).</p>
93
94 <h3><a name="flirt">flirt</a></h3>
95 <p>The syntax is:<br /> <span
96 class="code">flirt target</span><br /> Servus picks a flirt at random
97 from the flirts list (<span
98 class="code">/home/matthew/programming/irc/bot/flirts</span> on rapun),
99 and substitutes "target" for "%s" in the flirt line. If this command
100 is invoked by <span class="code">/msg</span>, there is a 10% chance
101 of Servus stating who invoked it by adding "(but nick is their secret
102 admirer)" to the end of the flirt. Further suggestions for flirts
103 should be submitted by email; a list of current flirts may be found
104 online at <a
105 href="flirts">http://www.chiark.greenend.org.uk/~matthewv/irc/flirts</a>.</p>
106
107 <h3><a name="google">google</a></h3>
108 <p>This command returns (either on-channel or by <span
109 class="code">/msg</span>) the "I'm feeling lucky" result of google
110 searching for the argument(s) of the "google" command.</p>
111
112 <h3><a name="help">help</a></h3>
113 <p>This command returns (either on-channel or by <span
114 class="code">/msg</span>) the location of this help file.</p>
115
116 <h3><a name="info">info</a></h3>
117 <p>This command returns (either on-channel or by <span
118 class="code">/msg</span>) information about the software version
119 running, which channel the bot is on, the bot's owner, and how many
120 items have karma recorded about them</p>
121
122 <h3><a name="karma">karma</a></h3>
123 <p>The syntax is:<br />
124 <span class="code">karma target</span><br />
125 It returns (either on-channel or by <span class="code">/msg</span>)
126 the current karma value for <span class="code">target</span> or "<span
127 class="code">target has no karma set.</span>" as appropriate. Items
128 gain or lose karma as the result of commands of the form:<br />
129 <span class="code">target++</span><br />or<br />
130 <span class="code">target--</span><br />
131 Note that if issued in-channel, the initial <span
132 class="code">!</span> or <span class="code">~</span> should not be
133 included. Karma targets must be one word only.</p>
134
135 <h3><a name="karmadel">karmadel</a></h3>
136 <p>The syntax is:<br /> <span
137 class="code">karmadel target</span><br /> <span
138 class="code">target</span>'s karma entry is deleted. An error message
139 is produced if <span class="code">target</span> has no karma set.</p>
140
141 <h3><a name="karmalist">karmalist</a></h3>
142 <p><span style="font-weight: bold">Do not use this
143 command</span>. Servus has too long a list of karma items, so
144 attempting to use this command will DoS the bot (it gets temporarily
145 removed from channel for excess flooding).</p>
146
147 <h3><a name="list">list</a></h3>
148 <p>This command returns (either on-channel or by <span
149 class="code">/msg</span>) a list of the commands Servus
150 understands</p> 
151
152 <h3><a name="nsfw">nsfw</a></h3>
153 <p>This command is the same as <a href="#url">url</a>, only you should
154 use it for URLs that are not work-safe. Servus will replace the "http"
155 in your URL with "nsfw", before passing it to <a href="#url">url</a>.</p>
156
157 <h3><a name="nws">nws</a></h3>
158 <p>This is an alias for <a href="nsfw">nsfw</a>.</p>
159
160 <h3><a name="quiet">quiet</a></h3>
161 <p>This command prevents the use of <span
162 class="code">trout</span>, <span class="code">flirt</span>, and <span
163 class="code">slash</span> for a short period of time (and will tell
164 anyone who attempts to do so that you have invoked this command).</p> 
165
166 <h3><a name="quit">quit</a></h3>
167 <p>This command is identical to <a href="#die">die</a>.</p>
168
169 <h3><a name="reload">reload</a></h3>
170 <p>This command may only be invoked by <span class="code">/msg</span>,
171 and only by the bot's owner. It causes Servus to re-load its <span
172 class="code">trout</span>, <span class="code">flirt</span>, and <span
173 class="code">slash</span> files, and to re-stock its fishpond.</p>
174
175 <h3><a name="rot13">rot13</a></h3>
176 <p>The syntax is:<br />
177 <span class="code">rot13 some text</span><br />
178 It returns by <span class="code">/msg</span>
179 the argument rot13d (so "<span class="code">fbzr grkg</span>" in this
180 case).</p>
181
182 <h3><a name="say">say</a></h3>
183 <p>This command must be invoked by <span class="code">/msg</span>, and
184 is only effective if invoked by the bot's owner. The syntax is:<br />
185 <span class="code">/msg Servus say thing</span><br />...which results
186 in output to the channel of the form:<br />
187 <span class="code">&lt;Servus&gt; thing</span></p>
188
189 <h3><a name="slash">slash</a></h3>
190 <p>The syntax is:<br /> <span
191 class="code">slash target1 / target2 </span><br /> Servus picks a slash at random
192 from the slashes list (<span
193 class="code">/home/matthew/programming/irc/bot/slashes</span> on rapun),
194 and substitutes "target1" for the first "%s" and "target2" for the
195 second "%s" in the slash line. If this command
196 is invoked by <span class="code">/msg</span>, there is a 10% chance
197 of Servus stating who invoked it by adding "(while nick watches)" to
198 the end of the slash. Further suggestions for slashes should be
199 submitted by email; a list of current slashes may be found online at <a
200 href="slashes">http://www.chiark.greenend.org.uk/~matthewv/irc/slashes</a>.</p>
201
202 <h3><a name="trout">trout</a></h3>
203 <p>The syntax is:<br /> <span
204 class="code">trout target</span><br /> Servus picks a trout at random
205 from the trouts list (<span
206 class="code">/home/matthew/programming/irc/bot/trouts</span> on rapun),
207 and substitutes "target" for "%s" in the trout line. If this command
208 is invoked by <span class="code">/msg</span>, there is a 10% chance
209 of Servus stating who invoked it by adding "(at the instigation of
210 nick)" to the end of the trout. Further suggestions for trouts should
211 be submitted by email; a list of current trouts may be found online at
212 <a href="trouts">http://www.chiark.greenend.org.uk/~matthewv/irc/trouts</a>.</p>
213
214 <h3><a name="twit">twit</a></h3>
215 <p>The syntax is:<br /><span
216 class="code">twit twitter-url</span><br /> Servus returns (either on-channel or by <span
217 class="code">/msg</span>) the content
218 of the tweet and the twitter user who posted it.</p>
219
220 <h3><a name="units">units</a></h3>
221 <p>The syntax is:<br /> <span
222 class="code">units x unit1 as unit2</span><br />or:<br /> <span
223 class="code">units unit1 as unit2</span><br />or:<br /> <span
224 class="code">units x unit1 as ?</span><br />or:<br /> <span
225 class="code">units unit1 as ?</span><br />
226 The first two will give the first value in terms of the second unit;
227 the latter two forms convert the first value into SI units. This
228 command is implemented by calling <span class="code">units(1)</span>.</p>
229
230 <h3><a name="url">url</a></h3>
231 <p>Servus now tracks URLs pasted into <span
232 class="code">#chiark</span>, and will comment if you post a duplicate
233 URL. The <span class="code">url</span> command provides a way for you
234 to check if a URL has been posted before (if not, Servus posts it on
235 your behalf). The syntax is:<br /> <span class="code">/msg Servus url
236 http://some.url</span><br /> Servus will either paste the URL into
237 channel, or <span class="code">/msg</span> you to tell you it was a
238 duplicate; in the latter case, the URL will still be sent to <span
239 class="code">#urls</span>. Although you can use this command
240 in-channel (and get a response by <span class="code">/msg </span>),
241 this is discouraged. Servus also understands <span
242 class="code">nsfw://</span> and <span class="code">nsfws://</span>
243 URLs, and knows they are an obfuscation of the relevant <span
244 class="code">http://</span> or <span class="code">https://</span> URL
245 for URLs that are not work-safe. You can make your firefox understand
246 <span class="code">nsfw://</span> URLS by visiting <a
247 href="http://www.chiark.greenend.org.uk/~owend/free/nsfw/">http://www.chiark.greenend.org.uk/~owend/free/nsfw/</a>.</p>
248
249 <hr />
250 <address>
251   <a href="mailto:matthewv@chiark.greenend.org.uk">Matthew Vernon</a><br />
252   Coventry, England
253 </address>
254  <p>
255 <a href="http://validator.w3.org/check/referer"><img
256         src="http://www.w3.org/Icons/valid-xhtml10"
257         alt="Valid XHTML 1.0!" height="31" width="88" /></a>
258 <a href="http://jigsaw.w3.org/css-validator/check/referer">
259 <img style="width:88px;height:31px"
260        src="http://jigsaw.w3.org/css-validator/images/vcss" 
261        alt="Valid CSS!" />
262 </a>
263 </p>
264 </body>
265 </html>
266