6b59e728 |
1 | This is bobot++.info, produced by makeinfo version 4.7 from |
2e20c3e1 |
2 | bobot++.texinfo. |
3 | |
4 | This file documents Bobot++ by Clinton Ebadi and Etienne Bernard |
5 | (original author, no longer works on program). |
6 | |
2e18045a |
7 | Copyright 2002,2004,2005 Clinton Ebadi |
2e20c3e1 |
8 | |
9 | Permission is granted to copy, distribute and/or modify this document |
10 | under the terms of the GNU Free Documentation License, Version 1.1 or |
11 | any later version published by the Free Software Foundation; with no |
12 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
13 | Texts. |
14 | |
15 | \1f |
16 | File: bobot++.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) |
17 | |
18 | This document describes Bobot++ by Clinton Ebadi and Etienne Bernard |
19 | (original author, no longer works on program). |
20 | |
ae97d6ec |
21 | This document applies to version 2.2 of the program named Bobot++ |
2e20c3e1 |
22 | |
ae97d6ec |
23 | Copyright 2002,2004,2005 Clinton Ebadi |
439869bf |
24 | |
25 | Permission is granted to copy, distribute and/or modify this document |
26 | under the terms of the GNU Free Documentation License, Version 1.1 or |
27 | any later version published by the Free Software Foundation; with no |
28 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
29 | Texts. |
30 | |
2e20c3e1 |
31 | * Menu: |
32 | |
33 | * Introduction:: |
ad529fde |
34 | * Configuration:: |
e07b6b46 |
35 | * Using the Bot:: |
ad529fde |
36 | * Scripting:: |
37 | * Concept Index:: |
38 | * Function Index:: |
39 | * Variable Index:: |
2e20c3e1 |
40 | |
c7d9fb19 |
41 | --- The Detailed Node Listing --- |
42 | |
43 | Configuration |
44 | |
c7d9fb19 |
45 | * Configuration File Placement:: |
4679dc8b |
46 | * Configuration Files:: |
c7d9fb19 |
47 | |
48 | Configuration Files |
49 | |
50 | * bot.conf:: |
c8f13c06 |
51 | * bot.users:: |
c7d9fb19 |
52 | |
53 | bot.conf |
54 | |
55 | * server syntax:: |
56 | * channel syntax:: |
57 | |
58 | Using Bobot++ |
59 | |
6b59e728 |
60 | * Starting the Bot:: |
c7d9fb19 |
61 | * User Levels:: |
c8f13c06 |
62 | * Protection:: |
63 | * Automatic Op:: |
6b59e728 |
64 | * Built-In Commands:: |
c7d9fb19 |
65 | |
66 | Scripting |
67 | |
68 | * Adding New Commands:: |
69 | * Hooks:: |
70 | * Scheme User Levels:: |
71 | * Sending Messages:: |
72 | * Misc Scripting Stuff:: |
73 | |
74 | Hooks |
75 | |
76 | * Creating a Hook:: |
77 | * Hook Types:: |
78 | |
ae97d6ec |
79 | Hook Types |
80 | |
81 | * Received Message Hooks:: |
82 | * Sent Message Hooks:: |
83 | * DCC CHAT Hooks:: |
84 | * Miscellaneous Hooks:: |
85 | |
c7d9fb19 |
86 | Sending Messages |
87 | |
88 | * High Level Message Functions:: |
89 | * Low Level Message Functions:: |
90 | |
2e20c3e1 |
91 | \1f |
ad529fde |
92 | File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top |
2e20c3e1 |
93 | |
6b59e728 |
94 | 1 Introduction |
95 | ************** |
2e20c3e1 |
96 | |
5a8b0ec6 |
97 | This manual feels abused and neglected because it has almost no content. |
2e20c3e1 |
98 | |
ad529fde |
99 | \1f |
e07b6b46 |
100 | File: bobot++.info, Node: Configuration, Next: Using the Bot, Prev: Introduction, Up: Top |
ad529fde |
101 | |
6b59e728 |
102 | 2 Configuration |
103 | *************** |
ad529fde |
104 | |
c8f13c06 |
105 | Bobot++ is easy to configure. See the `examples' directory for an |
106 | example configuration. |
ad529fde |
107 | |
108 | * Menu: |
109 | |
c7d9fb19 |
110 | * Configuration File Placement:: |
4679dc8b |
111 | * Configuration Files:: |
112 | |
113 | \1f |
114 | File: bobot++.info, Node: Configuration File Placement, Next: Configuration Files, Prev: Configuration, Up: Configuration |
115 | |
116 | 2.1 Configuration File Placement |
117 | ================================ |
118 | |
119 | Bobot++ will look in `/etc/bobotpp/default/' for its default config if |
120 | none is specified on the command line. Put the configuration files you |
121 | want to be loaded by default in this directory. If you are not root or |
122 | you want to have your own personal configuration, put it in |
123 | `~/.bobotpp/config/default/'. |
ad529fde |
124 | |
125 | \1f |
4679dc8b |
126 | File: bobot++.info, Node: Configuration Files, Prev: Configuration File Placement, Up: Configuration |
ad529fde |
127 | |
4679dc8b |
128 | 2.2 Configuration Files |
6b59e728 |
129 | ======================= |
ad529fde |
130 | |
e171dcce |
131 | * Menu: |
132 | |
133 | * bot.conf:: |
c8f13c06 |
134 | * bot.users:: |
e171dcce |
135 | |
136 | \1f |
c8f13c06 |
137 | File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files |
e171dcce |
138 | |
4679dc8b |
139 | 2.2.1 bot.conf |
6b59e728 |
140 | -------------- |
e171dcce |
141 | |
c8f13c06 |
142 | * Menu: |
143 | |
144 | * server syntax:: |
145 | * channel syntax:: |
146 | |
147 | `bot.conf' contains key value pairs separated by `='. |
c7d9fb19 |
148 | |
149 | `<key> = <value>' |
150 | |
151 | Comments are started with a `#' and cause the entire line to be |
152 | ignored. _Note that this only works when the `#' is the first character |
153 | of the line_. |
154 | |
155 | bot.conf is the main configuration file for a Bobot++. The available |
e171dcce |
156 | configuration variables are listed below in the format "VARIABLE |
157 | <default-value>: description" |
158 | |
159 | * NICKNAME <Bobot>: The nickname of the bot (NICK is an alias for |
160 | NICKNAME) |
161 | |
162 | * USERNAME <bobot>: The IRC username of the bot |
163 | |
164 | * CMDCHAR <!>: The character that prefixes commands given to the bot |
165 | (COMMAND is an alias for CMDCHAR) |
166 | |
167 | * IRCNAME <I'm a bobot++!>: The IRC name (or 'real name') of the bot |
168 | (REALNAME is an alias for IRCNAME) |
169 | |
170 | * USERLIST <bot.users>: Name of the file where the userlist is stored |
171 | |
172 | * SHITLIST <bot.shit>: Name of the file where the shitlist is stored |
173 | |
c7d9fb19 |
174 | * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this |
175 | to `/dev/null' to disable logging). |
176 | |
177 | * SERVER <None>: This specifies the server to connect to. Note that |
178 | this has a special syntax. |
179 | |
180 | * CHANNEL <None>: This specifies a channel the bot will join when it |
181 | starts up. This also has a special syntax. |
182 | |
183 | |
c7d9fb19 |
184 | \1f |
185 | File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf |
186 | |
4679dc8b |
187 | 2.2.1.1 server syntax |
6b59e728 |
188 | ..................... |
c7d9fb19 |
189 | |
190 | SERVER = SERVER_NAME [PORT [PASSWORD]] |
191 | |
192 | This will make Bobot++ attempt to connect to SERVER_NAME on port |
193 | PORT with the password PASSWORD. SERVER_NAME should be the address of |
194 | the server. PORT and PASSWORD are optional. You may use more than one |
195 | server line; Bobot++ will attempt to connect to the first one and, if |
196 | it fails, will connect to the next one in the list. There is also a |
197 | command to cause the bot to cycle servers. At the present time Bobot++ |
198 | cannot connect to more than one server at a time. This is a planned |
199 | feature of 3.0 (which is a very long way away; the current structure of |
200 | the program would make it very difficult to add support for connecting |
201 | to multiple servers at a time in a usable manner). |
202 | |
203 | \1f |
204 | File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf |
205 | |
4679dc8b |
206 | 2.2.1.2 channel syntax |
6b59e728 |
207 | ...................... |
c7d9fb19 |
208 | |
209 | CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY |
210 | |
211 | You may have any number of channel lines. When Bobot++ starts it will |
212 | attempt to join and gain ops in every channel listed. It will join NAME |
213 | and set the channel modes to INITIAL_MODES (e.g. "nt") if it is able to |
214 | gain operator status. It will then maintain MODES_TO_KEEP. If the |
215 | channel requires a key to enter simply set CHANNEL_KEY. Every argument |
216 | except for NAME is optional. |
217 | |
218 | A few example lines: |
219 | |
220 | `CHANNEL = #foo:nt:nt:bar' |
221 | |
222 | The bot will join `#foo' with the channel key `bar' and will then |
223 | maintain the modes `nt'. |
224 | |
225 | `CHANNEL = #bar:::' |
e171dcce |
226 | |
c7d9fb19 |
227 | The bot will join `#bar' and will not set any modes nor will it |
228 | attempt to maintain any modes. |
ad529fde |
229 | |
c8f13c06 |
230 | \1f |
231 | File: bobot++.info, Node: bot.users, Prev: bot.conf, Up: Configuration Files |
232 | |
4679dc8b |
233 | 2.2.2 bot.users |
6b59e728 |
234 | --------------- |
c8f13c06 |
235 | |
236 | `bot.users' is the default file name of the userlist. It may be changed |
237 | in `bot.conf'. The file contains lines with the format: |
238 | |
239 | `MASK:CHANNEL:LEVEL:PROTECTION:AUTO-OP' |
240 | |
241 | * MASK is the host mask (e.g. `*!*username |
242 | .domain.com') of the user |
243 | |
244 | * CHANNEL is a channel mask of the channels that the user has |
245 | priviliges to use the bot in (e.g. `*' for all channels, `#*' for |
246 | all non-local channel, `#foo*' for all channels starting with |
247 | "foo," `#bar' for channel "#bar" only, etc.) |
248 | |
249 | * LEVEL is the user level of the user (*Note User Levels::). |
250 | |
251 | * PROTECTION is the protection level of the user (*Note |
252 | Protection::). |
253 | |
254 | * AUTO-OP is set to control whether a user is automatically given |
255 | operator priviliges on channel entry (*Note Automatic Op::). |
256 | |
257 | |
ad529fde |
258 | \1f |
e07b6b46 |
259 | File: bobot++.info, Node: Using the Bot, Next: Scripting, Prev: Configuration, Up: Top |
260 | |
6b59e728 |
261 | 3 Using Bobot++ |
262 | *************** |
e07b6b46 |
263 | |
5a8b0ec6 |
264 | FIXME: stuff here... |
e07b6b46 |
265 | |
266 | * Menu: |
267 | |
6b59e728 |
268 | * Starting the Bot:: |
e07b6b46 |
269 | * User Levels:: |
c8f13c06 |
270 | * Protection:: |
271 | * Automatic Op:: |
6b59e728 |
272 | * Built-In Commands:: |
e07b6b46 |
273 | |
274 | \1f |
6b59e728 |
275 | File: bobot++.info, Node: Starting the Bot, Next: User Levels, Prev: Using the Bot, Up: Using the Bot |
276 | |
277 | 3.1 Starting the Bot |
278 | ==================== |
279 | |
280 | The bot is usually installed with the binary name `bobotpp'. It accepts |
281 | the following command line arguments: |
282 | |
283 | * `[--help][-h]' - Shows detailed help and exits |
284 | |
285 | * `[--version][-v]' - Shows version information and exits |
286 | |
287 | * `[--no-background][-b]' - Run bobot++ in the foreground |
288 | |
289 | * `[--config-file file][-f]' - Use file instead of `bot.conf' |
290 | |
291 | * `[--config-dir dir][-d]' - Use dir as dir to load config file from |
292 | |
293 | * `[--config dir][-c]' - Search your config path (defaults to |
294 | `$HOME/.bobotpp/config/' and then `/etc/bobotpp/') for dir and |
295 | then loads your config data using dir |
296 | |
297 | * `[--sys-config dir][-s]' - Looks for config in `/etc/bobotpp/dir'. |
298 | Note that the user dir is still searched first |
299 | |
300 | * `[--user-config dir][-u]' - Looks for config in |
301 | `$HOME/.bobotpp/config/dir/'. Note that the system dir is still |
302 | searched after this if dir is not found. |
303 | |
304 | * `[--debug][-D]' Makes Bobot++ print debugging info and run in the |
305 | foreground |
e07b6b46 |
306 | |
4da877a5 |
307 | * `[--debug-scripts][-S]' Enabled the Guile debugging evaluator for |
308 | verbose script errors and backtraces while still running the bot |
309 | in the background. |
310 | |
6b59e728 |
311 | The default configuration is read from |
312 | `$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if |
313 | the user config is not found. |
314 | |
315 | The bot defaults to running in the background as a daemon. |
316 | |
317 | \1f |
318 | File: bobot++.info, Node: User Levels, Next: Protection, Prev: Starting the Bot, Up: Using the Bot |
319 | |
320 | 3.2 User Levels |
321 | =============== |
e07b6b46 |
322 | |
c8f13c06 |
323 | There are several user levels available in Bobot++ to provide gradated |
324 | access to commands. `!adduser' and `bot.users' use the numeric code; |
325 | Scheme uses the textual name for the level. By default (if no catch-all |
4679dc8b |
326 | setting is found in *Note bot.users::.) a user has access to commands |
327 | with the level `bot:user-none'. |
c8f13c06 |
328 | |
329 | 0. `bot:user-none' - No *built-in* commands may be executed _by |
330 | default_ (commands may be added from Scheme that can be executed |
331 | by users of level none and the level required to execute a command |
332 | may be changed from Scheme). |
333 | |
334 | 1. `bot:user-user' - Will be able to execute most commands but not |
335 | all and cannot use masks on kicks and bans. |
336 | |
337 | 2. `bot:user-trusted' - For built-ins with a default configuration |
338 | this user has access to the same set of commands as an `user' but |
339 | may use masks on kicks and bans. Scheme commands may be added |
340 | which require a user to be of this level. |
341 | |
342 | 3. `bot:user-friend' - In the default configuration a user who is a |
343 | friend will be able to do everything short of stopping the bot. |
344 | Again, there may be user added commands that require a higher user |
345 | level. |
346 | |
347 | 4. `bot:user-master' - This is the highest user level and has access |
348 | to every feature of the bot. |
349 | |
350 | |
351 | \1f |
352 | File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Using the Bot |
353 | |
6b59e728 |
354 | 3.3 Protection |
355 | ============== |
c8f13c06 |
356 | |
357 | A user added via Scheme, the `bot.users' file, or `!adduser' may be |
358 | protected from being deoped, kicked, or banned. There are currently no |
359 | symbolic levels in Scheme; just use the numeric code. |
360 | |
361 | 0. No protection |
362 | |
363 | 1. No ban. If a user is banned the bot will unban him.. |
364 | |
365 | 2. No kick. The user may still be kicked but the bot will kickban the |
366 | user who kicked the protected user. |
367 | |
368 | 3. No deop. The bot will ensure that the user always maintains |
369 | operator status. |
370 | |
c8f13c06 |
371 | \1f |
6b59e728 |
372 | File: bobot++.info, Node: Automatic Op, Next: Built-In Commands, Prev: Protection, Up: Using the Bot |
c8f13c06 |
373 | |
6b59e728 |
374 | 3.4 Automatic Op |
375 | ================ |
c8f13c06 |
376 | |
377 | A user may be automatically given operator status upon entering a |
378 | channel. Set the AOP field to "0" to disable auto-op or "1" to enable |
379 | auto-op. |
e07b6b46 |
380 | |
6b59e728 |
381 | \1f |
382 | File: bobot++.info, Node: Built-In Commands, Prev: Automatic Op, Up: Using the Bot |
383 | |
384 | 3.5 Built-In Commands |
385 | ===================== |
386 | |
387 | Bobot++ has many built-in commands that make it useful without |
388 | scripting support. The reference leaves off the command char; remember |
389 | to use whatever you defined the command char to be in `bot.conf'. If a |
390 | command needs the channel name then you must specify the channel as the |
391 | first argument to the command when private messaging the bot a command. |
392 | |
9efc3706 |
393 | COMMAND NEEDS MIN LEVEL DESCRIPTION |
394 | CHANNEL TO USE |
395 | `action' `do' Yes USER Causes the bot to perform the |
396 | action `do' in the current channel. |
397 | `adduser' |
398 | `addserver' Adds the server specified by HOST |
399 | NAME or IP ADDRESS to the server |
400 | list. |
401 | `addshit' |
402 | `alias' Makes an alias, and adds the |
403 | function NEW NAME, that will do |
404 | exactly the same command as OLD |
405 | NAME. |
406 | `ban' Bans MASK or NICK from CHANNEL. You |
407 | need to be a trusted user to ban |
408 | with a MASK. |
409 | `banlist' |
410 | `channels' Prints the channel(s) where the bot |
411 | is currently. |
412 | `cycle' Yes Makes the bot leave and join |
413 | CHANNEL. |
414 | `dcclist' Gives the list of all DCC Chat |
415 | connections. |
416 | `deban' Yes Debans MASK or NICK from CHANNEL. |
417 | You need to be a trusted user to |
418 | deban with a MASK. |
419 | `delserver' Deletes server from server list |
420 | whose number in the server list is |
421 | SERVER NUMBER. |
422 | `deluser' Removes NICK or MASK from the |
423 | userlist. |
424 | `delshit' Removes NICK or MASK from the |
425 | shitlist. |
426 | `deop' Yes Deops MASK or NICK on CHANNEL. |
427 | `die' Makes the bot stop immediately. |
428 | `do' |
429 | `execute' *Only available if scripting |
430 | support is enabled* |
431 | `help' |
432 | `ident' Identifies you on the bot. Note |
433 | that you should not use this |
434 | command in public ... |
435 | `invite' Yes Invites NICK on CHANNEL. |
436 | `join' Makes the bot join CHANNEL. |
437 | `keep' Yes Sets the MODES that the bot will |
438 | keep for CHANNEL. |
439 | `kick' Yes Kicks MASK or NICK out of CHANNEL, |
440 | because of REASON. You need to be a |
441 | trusted user to use a MASK. |
442 | `kickban' Yes Bans then kicks MASK or NICK out of |
443 | CHANNEL, because of REASON. You need |
444 | to be a trusted user to use a MASK. |
445 | `load' Reloads the userlist from disk. |
446 | `loadscript' *Only available if scripting |
447 | support is enabled* |
448 | `lock' Locks topic on CHANNEL. |
449 | `mode' Yes Sends MODE STRING as mode for |
450 | CHANNEL. |
451 | `msg' |
452 | `names' Yes Shows the nicknames and status of |
453 | users on CHANNEL. |
454 | `nextserver' Makes the bot connect to the next |
455 | server in its server list. |
456 | `nick' Makes the bot use nickname NICK. |
457 | `nslookup' Does a nameserver query about NICK |
458 | host, HOST or IP ADDRESS. |
459 | `op' Yes Ops NICK on CHANNEL. |
460 | `part' Yes Makes the bot leave CHANNEL. |
461 | `password' Changes your password on the bot. |
462 | Use `NONE' as password if you want |
463 | to clear it. Do not use this |
464 | command in public! |
465 | `reconnect' Makes the bot reconnect to its |
466 | current server. |
467 | `rspymessage' Removes you from the spy list. |
468 | `save' Saves the userlist. |
469 | `say' Yes Makes the bot say MESSAGE on |
470 | CHANNEL. |
471 | `server' Select the server to connect to. |
472 | SERVER NUMBER is the number of the |
473 | server in the serverlist. |
474 | `serverlist' Shows the bot's serverlist. |
475 | `setfloodrate' |
476 | `setversion' |
477 | `shitlist' Shows the bot's shitlist. |
478 | `spylist' Shows the bot's spylist. |
479 | `spymessage' Adds you to the spylist |
480 | `stats' Yes Gives CHANNEL's statistics. |
481 | `tban' Yes Bans NICK or MASK from CHANNEL for |
482 | TIME seconds. |
483 | `tkban' Yes Bans NICK or MASK from CHANNEL for |
484 | TIME seconds, then kicks him/them |
485 | because of REASON. |
486 | `topic' Yes If no TOPICis given, prints |
487 | CHANNEL's topic. Otherwise, the bot |
488 | will change CHANNEL's topic to |
489 | TOPIC. |
490 | `unlock' Yes Makes the bot unlock topic on |
491 | CHANNEL |
492 | `userlist' Shows the bot's userlist |
493 | `who' Yes Show your level on CHANNEL |
494 | `whois' Yes Shows information about NICK on |
495 | CHANNEL |
6b59e728 |
496 | |
e07b6b46 |
497 | \1f |
498 | File: bobot++.info, Node: Scripting, Next: Concept Index, Prev: Using the Bot, Up: Top |
ad529fde |
499 | |
6b59e728 |
500 | 4 Scripting |
501 | *********** |
ad529fde |
502 | |
5a8b0ec6 |
503 | Bobot++'s most powerful feature is its scripting system. You write |
ad529fde |
504 | scripts using Guile Scheme. This manual does not cover how to use Guile |
505 | or how to learn Scheme. *Note Guile Reference Manual: (guile)Top, for |
506 | the Guile reference manual and |
6b59e728 |
507 | `http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html' for a |
ad529fde |
508 | good tutorial on Scheme. |
509 | |
439869bf |
510 | Note that in previous versions the scripting commands where in the |
511 | form `bot-FUNCTION'. They are now in the form `bot:FUNCTION'. The old |
512 | names are still available, but are deprecated and will be removed in |
c8f13c06 |
513 | Bobot++ 3.0. New commands are only available with the `bot:' prefix. |
514 | The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough |
515 | to convert your code to use the new functions. |
439869bf |
516 | |
ae97d6ec |
517 | *NOTE*: All arguments to functions and hooks called by the bot are |
518 | strings unless otherwise specified. |
519 | |
439869bf |
520 | * Menu: |
521 | |
522 | * Adding New Commands:: |
523 | * Hooks:: |
e07b6b46 |
524 | * Scheme User Levels:: |
525 | * Sending Messages:: |
91dddabd |
526 | * Misc Scripting Stuff:: |
439869bf |
527 | |
528 | \1f |
529 | File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting |
530 | |
6b59e728 |
531 | 4.1 Adding New Commands |
532 | ======================= |
439869bf |
533 | |
5a8b0ec6 |
534 | Adding a new command is simple. To register a new command use |
9efc3706 |
535 | `bot:addcommand'. |
536 | |
537 | -- Function: bot:addcommand name func needs-channel? num-of-args |
538 | min-level |
539 | The NAME is a string representing the name of the command being |
540 | added. FUNC is a function accepting NUM-OF-ARGS arguments. |
541 | NEEDS-CHANNEL? is a bool that is true if the function needs the |
542 | channel name as its first arg, and false otherwise. NUM-OF-ARGS |
543 | is the number of args FUNC will take and must be within zero (0) |
544 | and twenty (20). MIN-LEVEL is one of the *Note Scheme User |
545 | Levels::. A user must be at least a `min-level' user to use the |
546 | new command. None of the arguments are guaranteed to be passed; |
547 | if they aren't they are set to the empty string `""'. An example |
548 | of a new command would be: |
549 | |
550 | (define (hello channel name) |
551 | (if (string=? name "") |
552 | (bot:say channel "Hello world!") |
553 | (bot:say channel (string-append "Hello " name "!"))) |
554 | |
555 | (bot:addcommand "hello" hello #t 2 0) |
556 | |
557 | This will display "Hello World!" if called as `!hello' and "Hello |
ae97d6ec |
558 | World USER" if called as `!hello USER'. |
439869bf |
559 | |
560 | \1f |
e07b6b46 |
561 | File: bobot++.info, Node: Hooks, Next: Scheme User Levels, Prev: Adding New Commands, Up: Scripting |
439869bf |
562 | |
6b59e728 |
563 | 4.2 Hooks |
564 | ========= |
439869bf |
565 | |
5a8b0ec6 |
566 | Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII |
6530edbf |
567 | and tiny fugue (a MUD bot) hooks with a little bit of extra stuff added |
02341ea9 |
568 | in. A hook is called when a regular expression is matched against a |
569 | message sent to or by the bot. |
570 | |
571 | Bobot++ uses different hook types for each IRC message type, and also |
572 | includes a hook for accessing raw irc messages. Hooks are tagged with a |
573 | priority and a flag that specifies whether to call the next hook that |
574 | matches after calling the current one or to stop processing. |
575 | |
576 | Hooks are processed from the highest to lowest priority, with |
577 | fallthrough hooks of equal priority to non-fallthrough hooks being |
578 | executed first. |
439869bf |
579 | |
580 | * Menu: |
581 | |
582 | * Creating a Hook:: |
583 | * Hook Types:: |
584 | |
585 | \1f |
586 | File: bobot++.info, Node: Creating a Hook, Next: Hook Types, Prev: Hooks, Up: Hooks |
587 | |
6b59e728 |
588 | 4.2.1 Creating a Hook |
589 | --------------------- |
439869bf |
590 | |
9efc3706 |
591 | To add a new hook you use the function `bot:addhook'. |
592 | |
593 | -- Function: bot:addhook type regex function [pri fall name] |
594 | TYPE specifies the type of hook (the types of hooks are listed in |
ae97d6ec |
595 | *Note Hook Types::). |
596 | |
597 | REGEX is a standard regular expression. If REGEX is matched, |
598 | FUNCTION will be called. |
599 | |
600 | FUNCTION will take a different number of args depending on the |
601 | hook type. |
602 | |
603 | PRI specifies the priority of the hook--higher priority hooks are |
604 | executed first. This argument is optional and defaults to `0'. |
605 | |
606 | FALL is `#t' if the hook is a fallthrough hook and `#f' is the |
607 | hook is not a fallthrough hook. This arg is also optional and |
608 | defaults to `#t'. |
609 | |
610 | NAME is the optional name of the hook that defaults to |
611 | `"DEFAULT"'. If you set the name then you can have more than one |
612 | hook that matches the same regexp, as long as they have the same |
613 | name. E.g. in a log script you could have the regexps for the log |
614 | function all be `".*"' and set their names to `"log"' to avoid a |
615 | conflict with other hooks. |
439869bf |
616 | |
617 | \1f |
618 | File: bobot++.info, Node: Hook Types, Prev: Creating a Hook, Up: Hooks |
619 | |
6b59e728 |
620 | 4.2.2 Hook Types |
621 | ---------------- |
439869bf |
622 | |
ae97d6ec |
623 | The following sections document the different hooks Bobot++ exposes. |
624 | |
625 | The general format of each hook description is as if it were a |
626 | function to be defined, but these describe the function to be passwd to |
9efc3706 |
627 | `bot:add-hook'. Do _not_ name your functions these names. |
439869bf |
628 | |
9efc3706 |
629 | That said, here is the list of available hooks functions. FIXME: |
630 | write docs |
439869bf |
631 | |
ae97d6ec |
632 | * Menu: |
633 | |
634 | * Received Message Hooks:: |
635 | * Sent Message Hooks:: |
636 | * DCC CHAT Hooks:: |
637 | * Miscellaneous Hooks:: |
638 | |
639 | \1f |
640 | File: bobot++.info, Node: Received Message Hooks, Next: Sent Message Hooks, Prev: Hook Types, Up: Hook Types |
641 | |
642 | 4.2.2.1 Receieved Message Hooks |
643 | ............................... |
644 | |
645 | The following hooks are triggered when a mesage is received by the bot. |
646 | |
9efc3706 |
647 | -- Function: hooks/action from to action |
ae97d6ec |
648 | This hook is triggered when someone performs an action. |
649 | |
650 | FROM is the nickname the person that performed the action. |
651 | |
652 | TO is the target of the action, which is either a channel or the |
653 | Bot's nick if the user private messages the bot. |
654 | |
655 | ACTION is the text of the action. E.g. if someone did `* foobar |
656 | does baz', then ACTION would be the string `"does baz"'. |
439869bf |
657 | |
9efc3706 |
658 | -- Function: hooks/nickname old-nick new-nick |
ae97d6ec |
659 | This hook is called when someone changes his nickname from |
9efc3706 |
660 | OLD-NICK to NEW-NICK. |
439869bf |
661 | |
ae97d6ec |
662 | -- Function: hooks/signoff nick message |
663 | This hook is called when someone signs off of IRC. |
664 | |
665 | NICK is the nickname of the person signing off. |
666 | |
667 | MESSAGE is his quit message |
439869bf |
668 | |
9efc3706 |
669 | -- Function: hooks/ctcp nick to command rest |
ae97d6ec |
670 | This hook is called when a CTCP request is received by the bot. |
671 | |
672 | NICK is the nickname of the sender. |
673 | |
674 | TO is the target of the CTCP request. This will either be a |
675 | channel the bot is in, or the nickname of the bot. |
676 | |
677 | COMMAND is the CTCP command issued. |
678 | |
679 | REST contains the arguments to the CTCP command. |
439869bf |
680 | |
9efc3706 |
681 | -- Function: hooks/ctcp-reply nick command rest |
ae97d6ec |
682 | This hook is called when a CTCP REPLY is received. This occurs when |
683 | the bot has sent a CTCP request to another client. The CTCP REPLY |
684 | is always addressed to the bot directly. |
439869bf |
685 | |
ae97d6ec |
686 | NICK is the nickname of the person who replied. |
439869bf |
687 | |
ae97d6ec |
688 | COMMAND is the command to which NICK is replying. |
689 | |
690 | REST contains the body of the reply. |
691 | |
692 | -- Function: hooks/disconnect server intentional |
693 | This is called when the bot is disconnected from a server. |
694 | |
695 | SERVER is the hostname of the server from which the bot was |
696 | disconnected. |
697 | |
698 | INTENTIONAL is a flag set to `#t' when the bot disonnected from |
699 | the server as the result of a command (issued by a user from IRC, |
700 | SIGHUP, or from a script), or `#f' when the bot disconnected from |
701 | the server unintentionally.. |
439869bf |
702 | |
9efc3706 |
703 | -- Function: hooks/invite nick channel |
ae97d6ec |
704 | This hook is called when a user invited the bot to join a channel. |
705 | |
706 | NICK is the nickname of the user who sent the invite. |
707 | |
708 | CHANNEL is the channel to which the bot was invited. |
439869bf |
709 | |
9efc3706 |
710 | -- Function: hooks/join nick channel |
ae97d6ec |
711 | This is called when a user or the bot joins a channel. |
712 | |
713 | NICK is the nickname of the user who joined CHANNEL. This may be |
714 | the bot's nickname (the IRC server sends the JOIN command back to |
715 | the the bot after it joins a channel). |
716 | |
717 | CHANNEL is the channel that was joined |
439869bf |
718 | |
9efc3706 |
719 | -- Function: hooks/kick target from channel reason |
ae97d6ec |
720 | This hook is called when a user, including the bot, is kicked out |
721 | of a channel. |
722 | |
723 | TARGET is the nick of the user who was kicked. This may be the |
724 | bot's nick. |
725 | |
726 | FROM is the nick of the user who issued the kick. This may also be |
727 | the bot's nick. |
728 | |
729 | CHANNEL is the channel the kick was issued in. |
730 | |
731 | REASON is the reason the user was kicked. |
439869bf |
732 | |
9efc3706 |
733 | -- Function: hooks/part nick channel |
ae97d6ec |
734 | This hook is called when a user parts a channel. |
735 | |
736 | NICK is the user who parted the channel. This may be the bot. |
737 | |
738 | CHANNEL is the channel from which the user parted. |
739 | |
740 | -- Function: hooks/mode nick target modes |
741 | This hook is called when someone sets the modes of TARGET. |
439869bf |
742 | |
ae97d6ec |
743 | NICK is the user who set the modes. This may be the bot. |
439869bf |
744 | |
ae97d6ec |
745 | TARGET is the target of the MODE command. This may be a channel or |
746 | a user. If it is a user, it may be the bot. |
747 | |
748 | MODES is the MODE string. |
749 | |
750 | -- Function: hooks/message nick message |
751 | This hook is called when someone sends a private message to the |
752 | bot. |
753 | |
754 | NICK is the nickname of the user who sent the message. |
755 | |
756 | MESSAGE is the message the user sent. |
439869bf |
757 | |
9efc3706 |
758 | -- Function: hooks/notice nick message |
ae97d6ec |
759 | This hook is called when a user send a private notice to the bot. |
760 | |
761 | NICK is the user who sent the notice. |
762 | |
763 | MESSAGE is the message the user sent. |
439869bf |
764 | |
ae97d6ec |
765 | -- Function: hooks/public nick channel message |
766 | This hook is called when a user sends a normal message to a |
767 | channel. |
439869bf |
768 | |
ae97d6ec |
769 | NICK is the user who sent the message. |
770 | |
771 | CHANNEL is the channel to which the message was sent. |
772 | |
773 | MESSAGE is the message that was sent. |
774 | |
775 | -- Function: hooks/public-notice nick channel message |
776 | This hook is called when a user send a notice to a channel. |
777 | |
778 | NICK is the user who sent the notice. |
779 | |
780 | CHANNEL is the channel to which the notice was sent. |
781 | |
782 | MESSAGE is the message that was sent. |
439869bf |
783 | |
9efc3706 |
784 | -- Function: hooks/raw raw-message |
ae97d6ec |
785 | This hook is called every time a message is received. This matches |
786 | on the raw message text and passes the hook function the raw IRC |
787 | message. |
439869bf |
788 | |
ae97d6ec |
789 | RAW-MESSAGE is the raw IRC message. |
439869bf |
790 | |
9efc3706 |
791 | -- Function: hooks/topic nick channel new-topic |
ae97d6ec |
792 | This hook is called when a user changes the topic in a channel. |
793 | |
794 | NICK is the user who set the topic. This may be the bot. |
795 | |
796 | CHANNEL is the channel that's topic was changed. |
797 | |
798 | NEW-TOPIC is the new topic. |
799 | |
800 | \1f |
801 | File: bobot++.info, Node: Sent Message Hooks, Next: DCC CHAT Hooks, Prev: Received Message Hooks, Up: Hook Types |
439869bf |
802 | |
ae97d6ec |
803 | 4.2.2.2 Sent Message Hooks |
804 | .......................... |
439869bf |
805 | |
ae97d6ec |
806 | These hooks are called when the bot sends a message. MYNICK is always |
807 | the bot's nick and will not be documented in each hook description. |
808 | |
809 | -- Function: hooks/send/public mynick channel message |
810 | This hook is called when the bot sends a normal message to a |
811 | channel. |
812 | |
813 | CHANNEL is the channel to which the bot sent the message. |
814 | |
815 | MESSAGE is the message the bot sent. |
816 | |
817 | -- Function: hooks/send/message mynick to message |
818 | This hook is called when the bot sends a private message to a user. |
819 | |
820 | TO is the nick of the user to whom the message was sent. |
821 | |
822 | MESSAGE is the message that was sent. |
439869bf |
823 | |
9efc3706 |
824 | -- Function: hooks/send/action mynick to message |
ae97d6ec |
825 | This hook is called when the bot sents an action to a channel or a |
826 | user. |
827 | |
828 | TO is the channel or nick of the user to which the action was sent. |
829 | |
830 | MESSAGE is the text of the action. |
439869bf |
831 | |
9efc3706 |
832 | -- Function: hooks/send/ctcp mynick to command message |
ae97d6ec |
833 | This hook is called when the bot sends a CTCP message _other than_ |
834 | an ACTION to a channel or user. |
835 | |
836 | TO is the channel or nick of the user to which the CTCP was sent. |
837 | |
838 | COMMAND is the CTCP command that was sent. |
839 | |
840 | MESSAGE is a string containing the arguments to the CTCP command. |
841 | |
842 | \1f |
843 | File: bobot++.info, Node: DCC CHAT Hooks, Next: Miscellaneous Hooks, Prev: Sent Message Hooks, Up: Hook Types |
844 | |
845 | 4.2.2.3 DCC CHAT Hooks |
846 | ...................... |
847 | |
848 | These hooks are called when a user initializes a DCC CHAT and when the |
849 | bot receives messages from the user in a DCC CHAT. |
0b7a49e2 |
850 | |
9efc3706 |
851 | -- Function: hooks/dcc/chat-begin from |
ae97d6ec |
852 | This hook is called when a user begins a DCC CHAT with the bot. |
9efc3706 |
853 | FROM is the user's address in the form `nick!user@host'. |
0b7a49e2 |
854 | |
9efc3706 |
855 | -- Function: hooks/dcc/chat-message from message |
ae97d6ec |
856 | This hook is called when a user sends a message to the bot through |
857 | a DCC CHAT. |
858 | |
859 | FROM is the user's address in the form `nick!user@host'. |
860 | |
861 | MESSAGE is the message the user sent to the bot. |
862 | |
863 | \1f |
864 | File: bobot++.info, Node: Miscellaneous Hooks, Prev: DCC CHAT Hooks, Up: Hook Types |
865 | |
866 | 4.2.2.4 Miscellaneous Hooks |
867 | ........................... |
868 | |
869 | -- Function: hooks/flood nick |
870 | This hook is called when a user is detected flooding the bot. |
871 | |
872 | NICK is the nickname of the user flooding the bot. |
873 | |
874 | -- Function: hooks/timer time |
875 | This hook is called once a minute. The regex is *not* used. |
876 | |
877 | TIME is the in zero-padded `hh:mm' format. |
439869bf |
878 | |
e07b6b46 |
879 | \1f |
880 | File: bobot++.info, Node: Scheme User Levels, Next: Sending Messages, Prev: Hooks, Up: Scripting |
881 | |
6b59e728 |
882 | 4.3 Scheme User Levels |
883 | ====================== |
e07b6b46 |
884 | |
5a8b0ec6 |
885 | There are five levels that a user may be when interfacing with a bot: |
e07b6b46 |
886 | NONE, USER, TRUSTED_USER, FRIEND, MASTER. The Scheme variables for the |
887 | user levels are `bot:user-none', `bot:user-user', `bot:user-trusted', |
888 | `bot:user-friend', and `bot:user-master'. See *Note User Levels:: for |
889 | more information on User Levels. |
890 | |
891 | When adding a new command, think about who should be able to use it. |
892 | Is your command a general purpose command that helps the channel (e.g. |
893 | `!seen') that everyone should be able to use? Or is it something that |
894 | should be restricted? See *Note User Levels:: for information on what |
895 | level users can do what with the built in bot commands and think about |
896 | what level a user your command is targetted towards. You must be _very_ |
897 | careful when giving new commands to lower level users because you can |
898 | do basically everything the bot can do with a script. As the scripting |
899 | interface becomes more powerful, you must think more about what users |
900 | can use new commands you add. |
901 | |
902 | \1f |
91dddabd |
903 | File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Scheme User Levels, Up: Scripting |
e07b6b46 |
904 | |
6b59e728 |
905 | 4.4 Sending Messages |
906 | ==================== |
e07b6b46 |
907 | |
5a8b0ec6 |
908 | There are several types of messages you can send with Bobot++ from |
e07b6b46 |
909 | scripts. There is the simple, but rather limited, `bot:say', |
910 | `bot:action' and `bot:msg', and the more powerful, but lower level, |
911 | `bot:send-MESSAGE' functions. Most bots will probably only need the |
912 | higher level functions, but for the sake of why-not Bobot++ lets you |
ce02032f |
913 | use the lower level functions (in progress). |
e07b6b46 |
914 | |
915 | * Menu: |
916 | |
917 | * High Level Message Functions:: |
918 | * Low Level Message Functions:: |
919 | |
920 | \1f |
921 | File: bobot++.info, Node: High Level Message Functions, Next: Low Level Message Functions, Prev: Sending Messages, Up: Sending Messages |
922 | |
6b59e728 |
923 | 4.4.1 "High Level" Message Functions |
924 | ------------------------------------ |
e07b6b46 |
925 | |
9efc3706 |
926 | -- Function: bot:say channel message |
927 | Send a public or private MESSAGE to CHANNEL. |
928 | |
929 | Sends a normal text message, as if a user had typed it in. The |
930 | DEST can be a nickname or a channel. |
931 | |
932 | -- Function: bot:action channel message |
933 | Send an "action" type MESSAGE to CHANNEL |
934 | |
935 | -- Function: bot:msg nick message |
936 | The same as if a user typed `/msg nick message' to their IRC |
937 | client. |
e07b6b46 |
938 | |
5aec4622 |
939 | -- Function: bot:notice target message |
940 | Sends MESSAGE as a NOTICE to TARGET. TARGET may be a user (nick) |
5c73c60a |
941 | or a channel. This returns 0 on success. |
5aec4622 |
942 | |
e07b6b46 |
943 | \1f |
944 | File: bobot++.info, Node: Low Level Message Functions, Prev: High Level Message Functions, Up: Sending Messages |
945 | |
6b59e728 |
946 | 4.4.2 "Low Level" Message Functions |
947 | ----------------------------------- |
e07b6b46 |
948 | |
5a8b0ec6 |
949 | The "Low Level" messaging functions allow you to do things like send |
fed59248 |
950 | CTCP messages. You probably want to read rfc 2812 and the CTCP spec |
e07b6b46 |
951 | before using these. If you have no idea what these do, read rfc 2812 |
952 | (IRC Client Protocol) and CTCP spec. These functions all return |
953 | `*unspecified*' always, so don't use the return value for anything. |
954 | |
672b7d4e |
955 | -- Function: bot:send-ctcp to command message |
4679dc8b |
956 | TO is the target of your CTCP message, COMMAND is the CTCP |
957 | command, and MESSAGE is the message (or arguments) of the command. |
958 | Make sure to `bot:ctcp-quote' the message! |
e07b6b46 |
959 | |
d56bdd22 |
960 | -- Function: bot:send-ctcp-reply to command message |
4679dc8b |
961 | TO is the target of your CTCP reply, COMMAND is the CTCP command, |
962 | and MESSAGE is the message (or arguments) of the command. Make |
963 | sure to `bot:ctcp-quote' the message! |
d56bdd22 |
964 | |
965 | This is used to reply to a ctcp that the bot has received. |
966 | |
91dddabd |
967 | \1f |
968 | File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting |
969 | |
6b59e728 |
970 | 4.5 Misc. Scripting Stuff |
971 | ========================= |
91dddabd |
972 | |
5a8b0ec6 |
973 | These are a few useful things that I thought people writing scripts |
91dddabd |
974 | might want to know. |
975 | |
976 | If you want to execute code when the bot exits, just do `add-hook! |
977 | bot:exit-hook THUNK' where THUNK is an argumentless procedure (a |
978 | thunk). When the bot exits your thunk will be called. |
979 | |
4679dc8b |
980 | [ I didn't know where to put any of these, so I just stuck them in |
9efc3706 |
981 | here. |
982 | |
983 | There probably needs to be several sections added, like dealing |
984 | with users (kicking, added, etc), dealing with the bot (channels, |
985 | nickname of the bot, etc), server issues (serverlist), useful |
986 | tools (nslookup, whois), and do on. ] |
987 | |
988 | -- Function: bot:adduser nick-or-mask cbannel-mask level prot auto-op |
989 | Adds an user to the userlist, for a `nick!user@host' matching the |
990 | one given, on a channel matching the CHANNELMASK given. |
991 | |
992 | The LEVEL can be: The PROT can be: The AUTO-OP can be: |
993 | 0 - No level 0 - No protection 0 - No auto-op |
994 | 1 - User 1 - No ban 1 - Op on join |
995 | 2 - Trusted User 2 - No kick |
996 | 3 - Friend 3 - No deop |
997 | 4 - Master |
998 | |
999 | |
1000 | -- Function: bot:addserver hostname ip-address [portnumber] |
1001 | Adds the server specified by HOSTNAME or IP-ADDRESS to the server |
1002 | list. |
1003 | |
1004 | -- Function: bot:addshit nick-or-mask channel-mask level [time reason] |
1005 | Adds an user to the shitlist, for a nick!user@host matching the |
1006 | one given, on a channel matching the CHANNELMASK given. |
1007 | |
1008 | The LEVEL can be: |
1009 | 0 - No shit |
1010 | 1 - No op |
1011 | 2 - Kick and Ban on join |
1012 | 3 - Kick and Ban on join, no deban |
1013 | |
1014 | |
1015 | -- Function: bot:ban channel mask-or-nick |
1016 | Bans MASK or NICK from CHANNEL. You need to be a trusted user to |
1017 | ban with a MASK. |
1018 | |
1019 | -- Function: bot:change-command-level nick-or-mask channel-mask |
1020 | new-level |
1021 | Gives NICK or MASK level NEW-LEVEL on channel(s) CHANNEL-MASK. |
1022 | Note that you can not change level for someone whose level is |
1023 | greater than yours, and that you can not give a level greater than |
1024 | yours. |
1025 | |
1026 | -- Function: bot:cycle channel |
1027 | Makes the bot leave and join CHANNEL. |
1028 | |
1029 | -- Function: bot:deban channel mask-or-nick |
1030 | Debans MASK or NICK from CHANNEL. You need to be a trusted user to |
1031 | deban with a MASK. |
1032 | |
1033 | -- Function: bot:delserver server-number |
1034 | Deletes server from server list whose number in the server list is |
1035 | SERVER-NUMBER |
1036 | |
1037 | -- Function: bot:deluser nick-or-mask channel-mask |
1038 | Removes NICK or MASK from the userlist. |
1039 | |
1040 | -- Function: bot:delshit nick-or-mask channel-mask |
1041 | Removes NICK or MASK from the shitlist. |
1042 | |
1043 | -- Function: bot:deop channel mask-or-nick |
1044 | Deops MASK or NICK on CHANNEL. |
1045 | |
1046 | -- Function: bot:die reason |
1047 | Makes the bot stop immediately. |
1048 | |
1049 | -- Function: bot:do ? |
1050 | |
1051 | -- Function: bot:invite channel nick |
1052 | Invites NICK on CHANNEL. |
1053 | |
1054 | -- Function: bot:join channel |
1055 | Makes the bot join CHANNEL. |
1056 | |
1057 | -- Function: bot:keep channel modes |
1058 | Sets the MODES that the bot will keep for CHANNEL. See also STATS. |
1059 | |
1060 | -- Function: bot:kick channel mask-or-nick [reason] |
1061 | Kicks MASK or NICK out of CHANNEL, because of REASON. You need to |
1062 | be a trusted user to use a MASK. |
1063 | |
1064 | -- Function: bot:kickban channel mask-or-nick [reason] |
1065 | Bans then kicks MASK or NICK out of CHANNEL, because of REASON. |
1066 | You need to be a trusted user to use a MASK. |
1067 | |
1068 | -- Function: bot:lock channel |
1069 | Locks topic on CHANNEL. |
1070 | |
1071 | -- Function: bot:logport |
1072 | [ Probably returns the log port? ] |
1073 | |
1074 | -- Function: bot:mode channel mode-string |
1075 | Sends MODE-STRING as mode for CHANNEL. |
1076 | |
1077 | -- Function: bot:nextserver |
1078 | Makes the bot connect to the next server in its server list. |
1079 | |
1080 | -- Function: bot:nick nick |
1081 | Makes the bot use nickname NICK. |
1082 | |
1083 | -- Function: bot:op channel nick |
1084 | Ops NICK on CHANNEL. |
1085 | |
1086 | -- Function: bot:part channel |
1087 | Makes the bot leave CHANNEL. |
1088 | |
1089 | -- Function: bot:reconnect |
1090 | Makes the bot reconnect to its current server. |
1091 | |
1092 | -- Function: bot:server server-number |
1093 | Select the server to connect to. SERVER-NUMBER is the number of |
1094 | the server in the serverlist. |
1095 | |
1096 | -- Function: bot:setfloodrate ? |
1097 | |
1098 | -- Function: bot:setversion ? |
1099 | |
1100 | -- Function: bot:tban channel nick-or-mask time |
1101 | Bans NICK or MASK from CHANNEL for TIME seconds. |
1102 | |
1103 | -- Function: bot:tkban channel nick-or-mask time [reason] |
1104 | Bans NICK or MASK from CHANNEL for TIME seconds, then kicks |
1105 | him/them because of REASON. |
1106 | |
1107 | -- Function: bot:topic channel topic |
1108 | If no TOPIC is given, prints CHANNEL's topic. Otherwise, the bot |
1109 | will change CHANNEL's topic to TOPIC. |
1110 | |
1111 | -- Function: bot:unlock channel |
1112 | Makes the bot unlock topic on CHANNEL. |
1113 | |
1114 | -- Function: bot:getnickname |
1115 | [ Gets the bot's nickname? ] |
1116 | |
1117 | -- Function: bot:getserver |
1118 | |
1119 | -- Function: bot:getserverlist |
1120 | |
1121 | -- Function: bot:flush |
1122 | [ Flushes the socket to the server? ] |
1123 | |
1124 | -- Function: bot:flushport |
1125 | [ Flushes the log port? ] |
1126 | |
1127 | -- Function: bot:random ? |
1128 | [ Returns a random number? What range? Why? ] |
1129 | |
1130 | -- Function: bot:delcommand |
1131 | [ Probably deletes a command added with `bot:addcommand' ? ] |
1132 | |
1133 | -- Function: bot:addtimer ? ? |
1134 | |
1135 | -- Function: bot:deltimer ? |
1136 | |
1137 | -- Function: bot:dcc-chat-send ? ? |
1138 | |
1139 | [ And what about the stuff defined in `bobot-utils.scm' ? I just |
1140 | added it here so it could be somewhere. There should also be a |
1141 | section dealing with modules. How to use them. What module |
1142 | scripts are in. What module bobot++ provided primites are in. |
1143 | And so on. ] |
1144 | |
1145 | -- Function: bot:log . messages |
1146 | Write as many MESSAGES as you want to the log. If the arg is a |
1147 | thunk it will be executed and it's output will be written to the |
1148 | log. |
1149 | |
1150 | -- Function: bot:load file |
1151 | |
1152 | -- Function: bot:load-module module-spec |
1153 | |
1154 | -- Function: bot:use-module module-spec |
1155 | |
1156 | -- Function: bot:match-not-channel regex |
1157 | match-not-channel adds a prefix regex to your REGEX so it doesn't |
1158 | match the sender or channel in a PUBLIC message |
1159 | |
1160 | -- Function: bot:match-to-me regex |
1161 | match-to-me matches text that was addressed to the bot with a ':', |
1162 | ',', or nothing after the bot name. |
1163 | |
1164 | -- Function: bot:sent-to-me? message |
1165 | |
1166 | -- Function: bot:ctcp-quote message |
1167 | Returns the CTCP quoted message Input _MUST NOT_ contain the |
1168 | trailing `\r\n' (it is added by the message sending code). |
1169 | |
1170 | -- Variable: %bot:loadpath |
1171 | |
1172 | -- Function: %bot:load-extensions |
1173 | |
ad529fde |
1174 | \1f |
1175 | File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top |
1176 | |
1177 | Concept Index |
1178 | ************* |
1179 | |
6b59e728 |
1180 | \0\b[index\0\b] |
ad529fde |
1181 | * Menu: |
e07b6b46 |
1182 | |
6b59e728 |
1183 | * Background on Hooks: Hooks. (line 6) |
e07b6b46 |
1184 | |
ad529fde |
1185 | \1f |
1186 | File: bobot++.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top |
1187 | |
1188 | Function Index |
1189 | ************** |
1190 | |
6b59e728 |
1191 | \0\b[index\0\b] |
ad529fde |
1192 | * Menu: |
e07b6b46 |
1193 | |
9efc3706 |
1194 | * %bot:load-extensions: Misc Scripting Stuff. |
1195 | (line 206) |
1196 | * bot:action: High Level Message Functions. |
1197 | (line 13) |
1198 | * bot:addcommand: Adding New Commands. (line 11) |
1199 | * bot:addhook: Creating a Hook. (line 9) |
1200 | * bot:addserver: Misc Scripting Stuff. |
1201 | (line 34) |
1202 | * bot:addshit: Misc Scripting Stuff. |
1203 | (line 38) |
1204 | * bot:addtimer: Misc Scripting Stuff. |
1205 | (line 167) |
1206 | * bot:adduser: Misc Scripting Stuff. |
1207 | (line 22) |
1208 | * bot:ban: Misc Scripting Stuff. |
1209 | (line 49) |
1210 | * bot:change-command-level: Misc Scripting Stuff. |
1211 | (line 54) |
1212 | * bot:ctcp-quote: Misc Scripting Stuff. |
1213 | (line 200) |
1214 | * bot:cycle: Misc Scripting Stuff. |
1215 | (line 60) |
1216 | * bot:dcc-chat-send: Misc Scripting Stuff. |
1217 | (line 171) |
1218 | * bot:deban: Misc Scripting Stuff. |
1219 | (line 63) |
1220 | * bot:delcommand: Misc Scripting Stuff. |
1221 | (line 164) |
1222 | * bot:delserver: Misc Scripting Stuff. |
1223 | (line 67) |
1224 | * bot:delshit: Misc Scripting Stuff. |
1225 | (line 74) |
1226 | * bot:deltimer: Misc Scripting Stuff. |
1227 | (line 169) |
1228 | * bot:deluser: Misc Scripting Stuff. |
1229 | (line 71) |
1230 | * bot:deop: Misc Scripting Stuff. |
1231 | (line 77) |
1232 | * bot:die: Misc Scripting Stuff. |
1233 | (line 80) |
1234 | * bot:do: Misc Scripting Stuff. |
1235 | (line 83) |
1236 | * bot:flush: Misc Scripting Stuff. |
1237 | (line 155) |
1238 | * bot:flushport: Misc Scripting Stuff. |
1239 | (line 158) |
1240 | * bot:getnickname: Misc Scripting Stuff. |
1241 | (line 148) |
1242 | * bot:getserver: Misc Scripting Stuff. |
1243 | (line 151) |
1244 | * bot:getserverlist: Misc Scripting Stuff. |
1245 | (line 153) |
1246 | * bot:invite: Misc Scripting Stuff. |
1247 | (line 85) |
1248 | * bot:join: Misc Scripting Stuff. |
1249 | (line 88) |
1250 | * bot:keep: Misc Scripting Stuff. |
1251 | (line 91) |
1252 | * bot:kick: Misc Scripting Stuff. |
1253 | (line 94) |
1254 | * bot:kickban: Misc Scripting Stuff. |
1255 | (line 98) |
1256 | * bot:load: Misc Scripting Stuff. |
1257 | (line 184) |
1258 | * bot:load-module: Misc Scripting Stuff. |
1259 | (line 186) |
1260 | * bot:lock: Misc Scripting Stuff. |
1261 | (line 102) |
1262 | * bot:log: Misc Scripting Stuff. |
1263 | (line 179) |
1264 | * bot:logport: Misc Scripting Stuff. |
1265 | (line 105) |
1266 | * bot:match-not-channel: Misc Scripting Stuff. |
1267 | (line 190) |
1268 | * bot:match-to-me: Misc Scripting Stuff. |
1269 | (line 194) |
1270 | * bot:mode: Misc Scripting Stuff. |
1271 | (line 108) |
1272 | * bot:msg: High Level Message Functions. |
1273 | (line 16) |
1274 | * bot:nextserver: Misc Scripting Stuff. |
1275 | (line 111) |
1276 | * bot:nick: Misc Scripting Stuff. |
1277 | (line 114) |
5aec4622 |
1278 | * bot:notice: High Level Message Functions. |
1279 | (line 20) |
9efc3706 |
1280 | * bot:op: Misc Scripting Stuff. |
1281 | (line 117) |
1282 | * bot:part: Misc Scripting Stuff. |
1283 | (line 120) |
1284 | * bot:random: Misc Scripting Stuff. |
1285 | (line 161) |
1286 | * bot:reconnect: Misc Scripting Stuff. |
1287 | (line 123) |
1288 | * bot:say: High Level Message Functions. |
1289 | (line 7) |
672b7d4e |
1290 | * bot:send-ctcp: Low Level Message Functions. |
9efc3706 |
1291 | (line 13) |
d56bdd22 |
1292 | * bot:send-ctcp-reply: Low Level Message Functions. |
1293 | (line 18) |
9efc3706 |
1294 | * bot:sent-to-me?: Misc Scripting Stuff. |
1295 | (line 198) |
1296 | * bot:server: Misc Scripting Stuff. |
1297 | (line 126) |
1298 | * bot:setfloodrate: Misc Scripting Stuff. |
1299 | (line 130) |
1300 | * bot:setversion: Misc Scripting Stuff. |
1301 | (line 132) |
1302 | * bot:tban: Misc Scripting Stuff. |
1303 | (line 134) |
1304 | * bot:tkban: Misc Scripting Stuff. |
1305 | (line 137) |
1306 | * bot:topic: Misc Scripting Stuff. |
1307 | (line 141) |
1308 | * bot:unlock: Misc Scripting Stuff. |
1309 | (line 145) |
1310 | * bot:use-module: Misc Scripting Stuff. |
1311 | (line 188) |
ae97d6ec |
1312 | * hooks/action: Received Message Hooks. |
1313 | (line 9) |
1314 | * hooks/ctcp: Received Message Hooks. |
1315 | (line 31) |
1316 | * hooks/ctcp-reply: Received Message Hooks. |
1317 | (line 43) |
1318 | * hooks/dcc/chat-begin: DCC CHAT Hooks. (line 10) |
1319 | * hooks/dcc/chat-message: DCC CHAT Hooks. (line 14) |
1320 | * hooks/disconnect: Received Message Hooks. |
1321 | (line 54) |
1322 | * hooks/flood: Miscellaneous Hooks. (line 7) |
1323 | * hooks/invite: Received Message Hooks. |
1324 | (line 65) |
1325 | * hooks/join: Received Message Hooks. |
1326 | (line 72) |
1327 | * hooks/kick: Received Message Hooks. |
1328 | (line 81) |
1329 | * hooks/message: Received Message Hooks. |
1330 | (line 112) |
1331 | * hooks/mode: Received Message Hooks. |
1332 | (line 102) |
1333 | * hooks/nickname: Received Message Hooks. |
1334 | (line 20) |
1335 | * hooks/notice: Received Message Hooks. |
1336 | (line 120) |
1337 | * hooks/part: Received Message Hooks. |
1338 | (line 95) |
1339 | * hooks/public: Received Message Hooks. |
1340 | (line 127) |
1341 | * hooks/public-notice: Received Message Hooks. |
1342 | (line 137) |
1343 | * hooks/raw: Received Message Hooks. |
1344 | (line 146) |
1345 | * hooks/send/action: Sent Message Hooks. (line 25) |
1346 | * hooks/send/ctcp: Sent Message Hooks. (line 33) |
1347 | * hooks/send/message: Sent Message Hooks. (line 18) |
1348 | * hooks/send/public: Sent Message Hooks. (line 10) |
1349 | * hooks/signoff: Received Message Hooks. |
1350 | (line 24) |
1351 | * hooks/timer: Miscellaneous Hooks. (line 12) |
1352 | * hooks/topic: Received Message Hooks. |
1353 | (line 153) |
e07b6b46 |
1354 | |
ad529fde |
1355 | \1f |
1356 | File: bobot++.info, Node: Variable Index, Prev: Function Index, Up: Top |
1357 | |
1358 | Variable Index |
1359 | ************** |
1360 | |
6b59e728 |
1361 | \0\b[index\0\b] |
ad529fde |
1362 | * Menu: |
2e20c3e1 |
1363 | |
9efc3706 |
1364 | * %bot:loadpath: Misc Scripting Stuff. |
1365 | (line 204) |
fed59248 |
1366 | * exit-hook: Misc Scripting Stuff. |
6b59e728 |
1367 | (line 9) |
6b59e728 |
1368 | * user-friend: Scheme User Levels. (line 6) |
1369 | * user-master: Scheme User Levels. (line 6) |
1370 | * user-none: Scheme User Levels. (line 6) |
1371 | * user-trusted: Scheme User Levels. (line 6) |
1372 | * user-user: Scheme User Levels. (line 6) |
e07b6b46 |
1373 | |
1374 | |
2e20c3e1 |
1375 | \1f |
1376 | Tag Table: |
2e18045a |
1377 | Node: Top\7f527 |
ae97d6ec |
1378 | Node: Introduction\7f1925 |
1379 | Node: Configuration\7f2117 |
1380 | Node: Configuration File Placement\7f2404 |
1381 | Node: Configuration Files\7f2904 |
1382 | Node: bot.conf\7f3097 |
1383 | Node: server syntax\7f4535 |
1384 | Node: channel syntax\7f5399 |
1385 | Node: bot.users\7f6242 |
1386 | Node: Using the Bot\7f7145 |
1387 | Node: Starting the Bot\7f7395 |
1388 | Node: User Levels\7f8904 |
1389 | Node: Protection\7f10306 |
1390 | Node: Automatic Op\7f10914 |
1391 | Node: Built-In Commands\7f11203 |
1392 | Node: Scripting\7f18182 |
1393 | Node: Adding New Commands\7f19254 |
1394 | Node: Hooks\7f20575 |
1395 | Node: Creating a Hook\7f21415 |
1396 | Node: Hook Types\7f22621 |
1397 | Node: Received Message Hooks\7f23185 |
1398 | Node: Sent Message Hooks\7f28412 |
1399 | Node: DCC CHAT Hooks\7f29809 |
1400 | Node: Miscellaneous Hooks\7f30526 |
1401 | Node: Scheme User Levels\7f30975 |
1402 | Node: Sending Messages\7f32109 |
1403 | Node: High Level Message Functions\7f32725 |
1404 | Node: Low Level Message Functions\7f33505 |
1405 | Node: Misc Scripting Stuff\7f34568 |
1406 | Node: Concept Index\7f41144 |
1407 | Node: Function Index\7f41363 |
1408 | Node: Variable Index\7f52526 |
2e20c3e1 |
1409 | \1f |
1410 | End Tag Table |