[project @ 2005-07-07 23:51:52 by unknown_lamer]
[clinton/bobotpp.git] / bobot++.info
CommitLineData
6b59e728 1This is bobot++.info, produced by makeinfo version 4.7 from
2e20c3e1 2bobot++.texinfo.
3
4 This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
e45daca1 5(The original author who no longer works on the program).
2e20c3e1 6
2e18045a 7 Copyright 2002,2004,2005 Clinton Ebadi
2e20c3e1 8
9 Permission is granted to copy, distribute and/or modify this document
10under the terms of the GNU Free Documentation License, Version 1.1 or
11any later version published by the Free Software Foundation; with no
12Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
13Texts.
14
15\1f
16File: bobot++.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
17
18 This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
e45daca1 19(The original author who no longer works on the program).
2e20c3e1 20
e45daca1 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
26under the terms of the GNU Free Documentation License, Version 1.1 or
27any later version published by the Free Software Foundation; with no
28Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
29Texts.
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
43Configuration
44
c7d9fb19 45* Configuration File Placement::
4679dc8b 46* Configuration Files::
c7d9fb19 47
48Configuration Files
49
50* bot.conf::
c8f13c06 51* bot.users::
9b2fe824 52* bot.init::
53* bot.autoexec::
528799bd 54* bot.shit::
c7d9fb19 55
56bot.conf
57
58* server syntax::
59* channel syntax::
60
61Using Bobot++
62
6b59e728 63* Starting the Bot::
9b2fe824 64* Concepts::
65* Built-In Commands::
66
67Concepts
68
c7d9fb19 69* User Levels::
c8f13c06 70* Protection::
71* Automatic Op::
528799bd 72* Shit Levels::
c7d9fb19 73
3fed2165 74Built-In Commands
75
d15caa3b 76* Bot Control Commands::
3fed2165 77* Message Commands::
d15caa3b 78* Channel Control::
79* Spylist Commands::
3fed2165 80* User List Commands::
d15caa3b 81* Server List Commands::
82* Shit List Commands::
83* Channel Info::
84* Scripting Commands::
85* Authentication Commands::
86* Miscellaneous Commands::
3fed2165 87
c7d9fb19 88Scripting
89
90* Adding New Commands::
91* Hooks::
c7d9fb19 92* Sending Messages::
93* Misc Scripting Stuff::
3fed2165 94* Scheme Commands::
95* Query Functions::
c7d9fb19 96
97Hooks
98
99* Creating a Hook::
100* Hook Types::
101
ae97d6ec 102Hook Types
103
104* Received Message Hooks::
105* Sent Message Hooks::
106* DCC CHAT Hooks::
107* Miscellaneous Hooks::
108
c7d9fb19 109Sending Messages
110
111* High Level Message Functions::
112* Low Level Message Functions::
113
3fed2165 114Misc. Scripting Stuff
115
116* Scheme Commands::
117* Query Functions::
118
2e20c3e1 119\1f
ad529fde 120File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top
2e20c3e1 121
6b59e728 1221 Introduction
123**************
2e20c3e1 124
528799bd 125Bobot++ is a powerful IRC bot written in C++. It can be used standalone
126as a channel maintenence bot, or extended to do almost anything using
127Scheme scripts.
128
129 FIXME: Fill the intro in more?
2e20c3e1 130
ad529fde 131\1f
e07b6b46 132File: bobot++.info, Node: Configuration, Next: Using the Bot, Prev: Introduction, Up: Top
ad529fde 133
6b59e728 1342 Configuration
135***************
ad529fde 136
c8f13c06 137Bobot++ is easy to configure. See the `examples' directory for an
138example configuration.
ad529fde 139
e45daca1 140 The main configuration file is `bot.conf'. There are several
141auxiliary configuration files (a user list, aliases file, ban list, and
142a script autoexec).
143
ad529fde 144* Menu:
145
c7d9fb19 146* Configuration File Placement::
4679dc8b 147* Configuration Files::
148
149\1f
150File: bobot++.info, Node: Configuration File Placement, Next: Configuration Files, Prev: Configuration, Up: Configuration
151
1522.1 Configuration File Placement
153================================
154
155Bobot++ will look in `/etc/bobotpp/default/' for its default config if
156none is specified on the command line. Put the configuration files you
e45daca1 157want to be loaded by default in this directory. If you are not root, or
4679dc8b 158you want to have your own personal configuration, put it in
159`~/.bobotpp/config/default/'.
ad529fde 160
161\1f
4679dc8b 162File: bobot++.info, Node: Configuration Files, Prev: Configuration File Placement, Up: Configuration
ad529fde 163
4679dc8b 1642.2 Configuration Files
6b59e728 165=======================
ad529fde 166
e171dcce 167* Menu:
168
169* bot.conf::
c8f13c06 170* bot.users::
9b2fe824 171* bot.init::
172* bot.autoexec::
528799bd 173* bot.shit::
e171dcce 174
175\1f
c8f13c06 176File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files
e171dcce 177
4679dc8b 1782.2.1 bot.conf
6b59e728 179--------------
e171dcce 180
e45daca1 181`bot.conf' contains key value pairs separated by `='.
c7d9fb19 182
183 `<key> = <value>'
184
185 Comments are started with a `#' and cause the entire line to be
186ignored. _Note that this only works when the `#' is the first character
187of the line_.
188
189 bot.conf is the main configuration file for a Bobot++. The available
e171dcce 190configuration variables are listed below in the format "VARIABLE
191<default-value>: description"
192
e45daca1 193 A few of the options have more complex syntax, they are documented in
194their own subsections.
195
196* Menu:
197
198* server syntax::
199* channel syntax::
200
528799bd 201 * MAXNICKLENGTH <9>: The maximum length a valid nickname may be.
202 This should be set before setting the bot's nickname if it will be
203 more than nine characters long. Most IRC servers support nicknames
204 longer than nine characters, but Bobot++ still follows the old spec
205 and defaults to nine.
206
e171dcce 207 * NICKNAME <Bobot>: The nickname of the bot (NICK is an alias for
208 NICKNAME)
209
210 * USERNAME <bobot>: The IRC username of the bot
211
212 * CMDCHAR <!>: The character that prefixes commands given to the bot
213 (COMMAND is an alias for CMDCHAR)
214
215 * IRCNAME <I'm a bobot++!>: The IRC name (or 'real name') of the bot
216 (REALNAME is an alias for IRCNAME)
217
218 * USERLIST <bot.users>: Name of the file where the userlist is stored
219
9b2fe824 220 * AUTOEXECFILE <bot.autoexec>: Name of the file containing Scheme
221 code to be executed when the bot starts (only used if the bot is
222 compiled with scripting support)
223
224 * INITFILE <bot.init>: Name of the file containing the default
225 command aliases
226
e45daca1 227 * SHITLIST <bot.shit>: Name of the file where the shitlist (ban
228 list) is stored
e171dcce 229
c7d9fb19 230 * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this
231 to `/dev/null' to disable logging).
232
e45daca1 233 * SERVER <None>: This specifies the server to which the bot will
234 connect. Note that this has a special syntax *note server syntax::.
c7d9fb19 235
e45daca1 236 * CHANNEL <None>: This specifies the channels the bot will join when
237 it starts up. This has a special syntax *note channel syntax::.
c7d9fb19 238
239
c7d9fb19 240\1f
241File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf
242
4679dc8b 2432.2.1.1 server syntax
6b59e728 244.....................
c7d9fb19 245
e45daca1 246The server syntax in `bot.conf' allows you to specify an alternate port
247to connect on, and a password to send the server.
248
249 You may use more than one server line; Bobot++ will attempt to
250connect to the first one, and will connect to the next one in the list
251if it fails. The bot will continue cycling through the server list
252until it is able to connect to one. There is a command (`!cycle') to
253make the bot to cycle servers.
254
255 SERVER = SERVER_NAME [PORT [PASSWORD]]
c7d9fb19 256
257 This will make Bobot++ attempt to connect to SERVER_NAME on port
258PORT with the password PASSWORD. SERVER_NAME should be the address of
e45daca1 259the server. PORT and PASSWORD are optional.
c7d9fb19 260
261\1f
262File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf
263
4679dc8b 2642.2.1.2 channel syntax
6b59e728 265......................
c7d9fb19 266
e45daca1 267The channel syntax in `bot.conf' allows you to specify the initial
268modes the bot should set on a channel, the modes the bot should
269maintain, and a key if the channel needs it.
c7d9fb19 270
271 You may have any number of channel lines. When Bobot++ starts it will
e45daca1 272attempt to join and gain operator status in every channel listed.
273
274 CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY
275
276 The bot will join NAME and set the channel modes to INITIAL_MODES
277(e.g. "nt") if it is able to gain operator status. It will then
278maintain MODES_TO_KEEP. If the channel requires a key to enter simply
279set CHANNEL_KEY. Every argument except for NAME is optional.
c7d9fb19 280
281 A few example lines:
282
e45daca1 283 CHANNEL = #foo:nt:nt:bar
c7d9fb19 284
285 The bot will join `#foo' with the channel key `bar' and will then
286maintain the modes `nt'.
287
e45daca1 288 CHANNEL = #bar:::
e171dcce 289
c7d9fb19 290 The bot will join `#bar' and will not set any modes nor will it
291attempt to maintain any modes.
ad529fde 292
c8f13c06 293\1f
9b2fe824 294File: bobot++.info, Node: bot.users, Next: bot.init, Prev: bot.conf, Up: Configuration Files
c8f13c06 295
528799bd 2962.2.2 bot.users (User List)
297---------------------------
c8f13c06 298
299`bot.users' is the default file name of the userlist. It may be changed
9b2fe824 300in `bot.conf' via the USERLIST option. *You must add an entry for
301yourself manually.* You will probably want to add other entries using
302the IRC command interface as it is more intuitive than editing the file
303by hand.
528799bd 304
305 The file contains lines with the format:
c8f13c06 306
528799bd 307 `HOST_MASK:CHANNEL_MASK:LEVEL:PROTECTION:AUTO-OP:EXPIRATION:PASSWORD'
c8f13c06 308
528799bd 309 * HOST_MASK is the host mask (e.g. `*!*username
c8f13c06 310 .domain.com') of the user
311
528799bd 312 * CHANNEL_MASK is a channel mask of the channels that the user has
c8f13c06 313 priviliges to use the bot in (e.g. `*' for all channels, `#*' for
314 all non-local channel, `#foo*' for all channels starting with
315 "foo," `#bar' for channel "#bar" only, etc.)
316
317 * LEVEL is the user level of the user (*Note User Levels::).
318
319 * PROTECTION is the protection level of the user (*Note
320 Protection::).
321
322 * AUTO-OP is set to control whether a user is automatically given
323 operator priviliges on channel entry (*Note Automatic Op::).
324
528799bd 325 * EXPIRATION is the UNIX timestamp of when the user entry becomes
326 invalid. Setting this to -1 will make the entry permanent.
327
328 * PASSWORD is the password the user must supply to the bot to
329 authenticate. This can be set to `*NONE*' to not have a password.
330
331
332\1f
9b2fe824 333File: bobot++.info, Node: bot.init, Next: bot.autoexec, Prev: bot.users, Up: Configuration Files
334
3352.2.3 bot.init (Command Aliases)
336--------------------------------
337
338This file stores a list of IRC command aliases. The filename may be
339changed in `bot.conf' via the INITFILE option. You use this file to set
340up aliases for IRC commands, e.g. to make `!a' call `!adduser'. This
341way you can save typing for commonly used commands.
342
343 The format of a line in the file is: ALIAS COMMAND
344
345 This will make ALIAS call COMMAND. e.g. `t topic' will make `!t New
346Topic' set the current channel's topic to "New Topic," just as if you
347had used `!topic New Topic'.
348
349\1f
350File: bobot++.info, Node: bot.autoexec, Next: bot.shit, Prev: bot.init, Up: Configuration Files
351
3522.2.4 bot.autoexec (Scheme Init File)
353-------------------------------------
354
355This file is only used when Bobot++ is compiled with scripting support.
356The name of the autoexec file can be changed in `bot.conf' via the
357AUTOEXECFILE option.
358
359 The contents of this file are evaluated by Guile when the bot
360starts. You can use this to do things like loading a few default
361modules when the bot starts.
362
363\1f
364File: bobot++.info, Node: bot.shit, Prev: bot.autoexec, Up: Configuration Files
528799bd 365
9b2fe824 3662.2.5 bot.shit (Ban/Shit List)
528799bd 367------------------------------
368
9b2fe824 369This file stores the ban list. The name may be changed in `bot.conf'
370via the SHITLIST option. You will most likely want to use the IRC
371command interface to edit this file instead of editing it directly.
528799bd 372
373 The file contains lines in the form:
374
375 `HOST_MASK:CHANNEL_MASK:LEVEL:EXPIRATION:REASON'
376
377 * HOST_MASK is the host mask (e.g. `*!*username
378 .domain.com') of the user
379
380 * CHANNEL_MASK is a channel mask of the channels that the user is
381 banned on (e.g. `*' for all channels, `#*' for all non-local
382 channel, `#foo*' for all channels starting with "foo," `#bar' for
383 channel "#bar" only, etc.
384
385 * LEVEL is a number specifying if the bot should not allow the user
386 to gain ops, to kick the user upon joining, or to prevent the user
387 from being debanned by other users. *Note Shit Levels:: for
388 information on the available levels.
389
390 * EXPIRATION is the UNIX timestamp of when the shit entry becomes
391 invalid. This may be set to -1 to make it valid forever.
392
393 * REASON is text that is sent to the user when they are kicked or
394 banned from the channel.
395
c8f13c06 396
ad529fde 397\1f
e07b6b46 398File: bobot++.info, Node: Using the Bot, Next: Scripting, Prev: Configuration, Up: Top
399
6b59e728 4003 Using Bobot++
401***************
e07b6b46 402
9b2fe824 403Using Bobot++ is easy. This chapter covers starting the bot, a few
404Bobot++ specific concepts, and using the built-in commands of the bot.
e07b6b46 405
406* Menu:
407
6b59e728 408* Starting the Bot::
9b2fe824 409* Concepts::
6b59e728 410* Built-In Commands::
e07b6b46 411
412\1f
9b2fe824 413File: bobot++.info, Node: Starting the Bot, Next: Concepts, Prev: Using the Bot, Up: Using the Bot
6b59e728 414
4153.1 Starting the Bot
416====================
417
418The bot is usually installed with the binary name `bobotpp'. It accepts
e45daca1 419the following command line arguments.
6b59e728 420
421 * `[--help][-h]' - Shows detailed help and exits
422
423 * `[--version][-v]' - Shows version information and exits
424
425 * `[--no-background][-b]' - Run bobot++ in the foreground
426
427 * `[--config-file file][-f]' - Use file instead of `bot.conf'
428
429 * `[--config-dir dir][-d]' - Use dir as dir to load config file from
430
431 * `[--config dir][-c]' - Search your config path (defaults to
432 `$HOME/.bobotpp/config/' and then `/etc/bobotpp/') for dir and
433 then loads your config data using dir
434
435 * `[--sys-config dir][-s]' - Looks for config in `/etc/bobotpp/dir'.
436 Note that the user dir is still searched first
437
438 * `[--user-config dir][-u]' - Looks for config in
439 `$HOME/.bobotpp/config/dir/'. Note that the system dir is still
440 searched after this if dir is not found.
441
442 * `[--debug][-D]' Makes Bobot++ print debugging info and run in the
443 foreground
e07b6b46 444
528799bd 445 * `[--debug-scripts][-S]' Enables the Guile debugging evaluator for
4da877a5 446 verbose script errors and backtraces while still running the bot
447 in the background.
448
6b59e728 449 The default configuration is read from
450`$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if
451the user config is not found.
452
453 The bot defaults to running in the background as a daemon.
454
455\1f
9b2fe824 456File: bobot++.info, Node: Concepts, Next: Built-In Commands, Prev: Starting the Bot, Up: Using the Bot
457
4583.2 Concepts
459============
460
461There are a few general concepts that a user of Bobot++ should know
462about.
463
464* Menu:
465
466* User Levels::
467* Protection::
468* Automatic Op::
469* Shit Levels::
470
471\1f
472File: bobot++.info, Node: User Levels, Next: Protection, Prev: Concepts, Up: Concepts
6b59e728 473
9b2fe824 4743.2.1 User Levels
475-----------------
e07b6b46 476
c8f13c06 477There are several user levels available in Bobot++ to provide gradated
478access to commands. `!adduser' and `bot.users' use the numeric code;
e45daca1 479Scheme uses the textual name for the level. By default (if the user is
480not found in the userlist) a user has access to commands with the level
481`bot:user-none'.
c8f13c06 482
483 0. `bot:user-none' - No *built-in* commands may be executed _by
484 default_ (commands may be added from Scheme that can be executed
485 by users of level none and the level required to execute a command
486 may be changed from Scheme).
487
488 1. `bot:user-user' - Will be able to execute most commands but not
489 all and cannot use masks on kicks and bans.
490
491 2. `bot:user-trusted' - For built-ins with a default configuration
492 this user has access to the same set of commands as an `user' but
493 may use masks on kicks and bans. Scheme commands may be added
494 which require a user to be of this level.
495
496 3. `bot:user-friend' - In the default configuration a user who is a
497 friend will be able to do everything short of stopping the bot.
498 Again, there may be user added commands that require a higher user
499 level.
500
501 4. `bot:user-master' - This is the highest user level and has access
502 to every feature of the bot.
503
504
505\1f
9b2fe824 506File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Concepts
c8f13c06 507
9b2fe824 5083.2.2 Protection
509----------------
c8f13c06 510
511A user added via Scheme, the `bot.users' file, or `!adduser' may be
e45daca1 512protected from being deoped, kicked, or banned. The user list and IRC
513commands use the numeric codes, Scheme uses the symbolic names.
c8f13c06 514
e45daca1 515 0. `bot:protection/none' No protection
c8f13c06 516
e45daca1 517 1. `bot:protection/no-ban' No ban. If a user is banned the bot will
518 unban him..
c8f13c06 519
e45daca1 520 2. `bot:protection/no-kick' No kick. The user may still be kicked but
521 the bot will kickban the user who kicked the protected user.
c8f13c06 522
e45daca1 523 3. `bot:protection/no-deop' No deop. The bot will ensure that the
524 user always maintains operator status.
c8f13c06 525
c8f13c06 526\1f
9b2fe824 527File: bobot++.info, Node: Automatic Op, Next: Shit Levels, Prev: Protection, Up: Concepts
c8f13c06 528
9b2fe824 5293.2.3 Automatic Op
530------------------
c8f13c06 531
532A user may be automatically given operator status upon entering a
e45daca1 533channel. Scheme uses the symbolic name, the user list (`bot.users') and
534IRC commands use the numeric value.
535
536 0. `bot:aop/no' Do not automatically op the user
537
538 1. `bot:aop/yes' Do automatically op the user
e07b6b46 539
6b59e728 540\1f
9b2fe824 541File: bobot++.info, Node: Shit Levels, Prev: Automatic Op, Up: Concepts
6b59e728 542
9b2fe824 5433.2.4 Shit Levels
544-----------------
528799bd 545
546The shit list and shit list related commands use different levels to
547define how much the bot hates a user. Scheme uses the symbolic names,
548the shit list and IRC commands use the numbers.
549
550 0. `bot:shit/none' The bot doesn't hate the user (this is the normal
551 level)
552
553 1. `bot:shit/no-op' The bot will deop the user any time he gains
554 operator priviliges in the channel
555
556 2. `bot:shit/no-join' The bot will kick and ban the user when he
557 joins the channel
558
559 3. `bot:shit/no-deban' The bot will kick and ban usre when he joins
560 the channel, and will prevent other users from debanning him.
561
562\1f
9b2fe824 563File: bobot++.info, Node: Built-In Commands, Prev: Concepts, Up: Using the Bot
528799bd 564
9b2fe824 5653.3 Built-In Commands
6b59e728 566=====================
567
568Bobot++ has many built-in commands that make it useful without
569scripting support. The reference leaves off the command char; remember
570to use whatever you defined the command char to be in `bot.conf'. If a
571command needs the channel name then you must specify the channel as the
572first argument to the command when private messaging the bot a command.
573
3fed2165 574* Menu:
575
d15caa3b 576* Bot Control Commands::
3fed2165 577* Message Commands::
d15caa3b 578* Channel Control::
579* Spylist Commands::
3fed2165 580* User List Commands::
d15caa3b 581* Server List Commands::
582* Shit List Commands::
583* Channel Info::
584* Scripting Commands::
585* Authentication Commands::
586* Miscellaneous Commands::
3fed2165 587
588\1f
d15caa3b 589File: bobot++.info, Node: Bot Control Commands, Next: Message Commands, Prev: Built-In Commands, Up: Built-In Commands
3fed2165 590
d15caa3b 5913.3.1 Bot Control Commands
592--------------------------
593
594COMMAND NEEDS MIN LEVEL DESCRIPTION
595 CHANNEL TO USE
596`cycle' Yes Makes the bot leave and join
597 CHANNEL.
598`die' Makes the bot stop immediately.
599`join' Makes the bot join CHANNEL.
600`nick' Makes the bot use nickname NICK.
601`save' Saves the userlist.
602`setfloodrate'
603`setversion'
604
605\1f
606File: bobot++.info, Node: Message Commands, Next: Channel Control, Prev: Bot Control Commands, Up: Built-In Commands
607
6083.3.2 Message Commands
3fed2165 609----------------------
610
9efc3706 611COMMAND NEEDS MIN LEVEL DESCRIPTION
612 CHANNEL TO USE
613`action' `do' Yes USER Causes the bot to perform the
614 action `do' in the current channel.
3fed2165 615`do'
616`msg'
617`say' Yes Makes the bot say MESSAGE on
618 CHANNEL.
619
620\1f
d15caa3b 621File: bobot++.info, Node: Channel Control, Next: Spylist Commands, Prev: Message Commands, Up: Built-In Commands
3fed2165 622
d15caa3b 6233.3.3 Channel Control
624---------------------
3fed2165 625
626COMMAND NEEDS MIN LEVEL DESCRIPTION
627 CHANNEL TO USE
9efc3706 628`ban' Bans MASK or NICK from CHANNEL. You
629 need to be a trusted user to ban
630 with a MASK.
9efc3706 631`deban' Yes Debans MASK or NICK from CHANNEL.
632 You need to be a trusted user to
633 deban with a MASK.
9efc3706 634`deop' Yes Deops MASK or NICK on CHANNEL.
9efc3706 635`invite' Yes Invites NICK on CHANNEL.
9efc3706 636`keep' Yes Sets the MODES that the bot will
637 keep for CHANNEL.
638`kick' Yes Kicks MASK or NICK out of CHANNEL,
639 because of REASON. You need to be a
640 trusted user to use a MASK.
641`kickban' Yes Bans then kicks MASK or NICK out of
642 CHANNEL, because of REASON. You need
643 to be a trusted user to use a MASK.
9efc3706 644`lock' Locks topic on CHANNEL.
645`mode' Yes Sends MODE STRING as mode for
646 CHANNEL.
9efc3706 647`op' Yes Ops NICK on CHANNEL.
648`part' Yes Makes the bot leave CHANNEL.
9efc3706 649`tban' Yes Bans NICK or MASK from CHANNEL for
650 TIME seconds.
651`tkban' Yes Bans NICK or MASK from CHANNEL for
652 TIME seconds, then kicks him/them
653 because of REASON.
654`topic' Yes If no TOPICis given, prints
655 CHANNEL's topic. Otherwise, the bot
656 will change CHANNEL's topic to
657 TOPIC.
658`unlock' Yes Makes the bot unlock topic on
659 CHANNEL
d15caa3b 660
661\1f
662File: bobot++.info, Node: Spylist Commands, Next: User List Commands, Prev: Channel Control, Up: Built-In Commands
663
6643.3.4 Spylist Commands
665----------------------
666
667COMMAND NEEDS MIN LEVEL DESCRIPTION
668 CHANNEL TO USE
669`spylist' Shows the bot's spylist.
670`spymessage' Adds you to the spylist
671`rspymessage' Removes you from the spy list.
672
673\1f
674File: bobot++.info, Node: User List Commands, Next: Server List Commands, Prev: Spylist Commands, Up: Built-In Commands
675
6763.3.5 User List Commands
677------------------------
678
679COMMAND NEEDS MIN LEVEL DESCRIPTION
680 CHANNEL TO USE
681`adduser'
682`deluser' Removes NICK or MASK from the
683 userlist.
9efc3706 684`userlist' Shows the bot's userlist
d15caa3b 685
686\1f
687File: bobot++.info, Node: Server List Commands, Next: Shit List Commands, Prev: User List Commands, Up: Built-In Commands
688
6893.3.6 Server List Commands
690--------------------------
691
692COMMAND NEEDS MIN LEVEL DESCRIPTION
693 CHANNEL TO USE
694`addserver' Adds the server specified by HOST
695 NAME or IP ADDRESS to the server
696 list.
697`delserver' Deletes server from server list
698 whose number in the server list is
699 SERVER NUMBER.
700`nextserver' Makes the bot connect to the next
701 server in its server list.
702`reconnect' Makes the bot reconnect to its
703 current server.
704`server' Select the server to connect to.
705 SERVER NUMBER is the number of the
706 server in the serverlist.
707`serverlist' Shows the bot's serverlist.
708
709\1f
710File: bobot++.info, Node: Shit List Commands, Next: Channel Info, Prev: Server List Commands, Up: Built-In Commands
711
7123.3.7 Shit List Commands
713------------------------
714
715COMMAND NEEDS MIN LEVEL DESCRIPTION
716 CHANNEL TO USE
717`addshit'
718`delshit' Removes NICK or MASK from the
719 shitlist
720`shitlist' Shows the bot's shitlist.
721
722\1f
723File: bobot++.info, Node: Channel Info, Next: Scripting Commands, Prev: Shit List Commands, Up: Built-In Commands
724
7253.3.8 Channel Info
726------------------
727
728COMMAND NEEDS MIN LEVEL DESCRIPTION
729 CHANNEL TO USE
730`banlist'
731`channels' Prints the channel(s) where the bot
732 is currently.
733`names' Yes Shows the nicknames and status of
734 users on CHANNEL.
735`stats' Yes Gives CHANNEL's statistics.
736
737\1f
738File: bobot++.info, Node: Scripting Commands, Next: Authentication Commands, Prev: Channel Info, Up: Built-In Commands
739
7403.3.9 Scripting Commands
741------------------------
742
743COMMAND NEEDS MIN LEVEL DESCRIPTION
744 CHANNEL TO USE
745`execute' *Only available if scripting
746 support is enabled*
747`load' Reloads the userlist from disk.
748`loadscript' *Only available if scripting
749 support is enabled*
750
751\1f
752File: bobot++.info, Node: Authentication Commands, Next: Miscellaneous Commands, Prev: Scripting Commands, Up: Built-In Commands
753
7543.3.10 Authentication Commands
755------------------------------
756
757COMMAND NEEDS MIN LEVEL DESCRIPTION
758 CHANNEL TO USE
759`ident' Identifies you on the bot. Note
760 that you should not use this
761 command in public ...
762`password' Changes your password on the bot.
763 Use `NONE' as password if you want
764 to clear it. Do not use this
765 command in public!
766
767\1f
768File: bobot++.info, Node: Miscellaneous Commands, Prev: Authentication Commands, Up: Built-In Commands
769
7703.3.11 Miscellaneous Commands
771-----------------------------
772
773COMMAND NEEDS MIN LEVEL DESCRIPTION
774 CHANNEL TO USE
775`alias' Makes an alias, and adds the
776 function NEW NAME, that will do
777 exactly the same command as OLD
778 NAME.
779`dcclist' Gives the list of all DCC Chat
780 connections.
781`help'
782`nslookup' Does a nameserver query about NICK
783 host, HOST or IP ADDRESS.
9efc3706 784`who' Yes Show your level on CHANNEL
785`whois' Yes Shows information about NICK on
786 CHANNEL
6b59e728 787
e07b6b46 788\1f
789File: bobot++.info, Node: Scripting, Next: Concept Index, Prev: Using the Bot, Up: Top
ad529fde 790
6b59e728 7914 Scripting
792***********
ad529fde 793
5a8b0ec6 794Bobot++'s most powerful feature is its scripting system. You write
ad529fde 795scripts using Guile Scheme. This manual does not cover how to use Guile
796or how to learn Scheme. *Note Guile Reference Manual: (guile)Top, for
797the Guile reference manual and
6b59e728 798`http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html' for a
ad529fde 799good tutorial on Scheme.
800
439869bf 801 Note that in previous versions the scripting commands where in the
802form `bot-FUNCTION'. They are now in the form `bot:FUNCTION'. The old
803names are still available, but are deprecated and will be removed in
c8f13c06 804Bobot++ 3.0. New commands are only available with the `bot:' prefix.
805The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough
806to convert your code to use the new functions.
439869bf 807
ae97d6ec 808 *NOTE*: All arguments to functions and hooks called by the bot are
809strings unless otherwise specified.
810
439869bf 811* Menu:
812
813* Adding New Commands::
814* Hooks::
e07b6b46 815* Sending Messages::
91dddabd 816* Misc Scripting Stuff::
3fed2165 817* Scheme Commands::
818* Query Functions::
439869bf 819
820\1f
821File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting
822
6b59e728 8234.1 Adding New Commands
824=======================
439869bf 825
5a8b0ec6 826Adding a new command is simple. To register a new command use
9efc3706 827`bot:addcommand'.
828
829 -- Function: bot:addcommand name func needs-channel? num-of-args
830 min-level
831 The NAME is a string representing the name of the command being
832 added. FUNC is a function accepting NUM-OF-ARGS arguments.
833 NEEDS-CHANNEL? is a bool that is true if the function needs the
834 channel name as its first arg, and false otherwise. NUM-OF-ARGS
835 is the number of args FUNC will take and must be within zero (0)
528799bd 836 and twenty (20). MIN-LEVEL is one of the *Note User Levels::. A
837 user must be at least a MIN-LEVEL user to use the new command.
838 None of the arguments are guaranteed to be passed; if they aren't
839 they are set to the empty string `""'. An example of a new
840 command would be:
9efc3706 841
842 (define (hello channel name)
843 (if (string=? name "")
844 (bot:say channel "Hello world!")
845 (bot:say channel (string-append "Hello " name "!")))
846
847 (bot:addcommand "hello" hello #t 2 0)
848
849 This will display "Hello World!" if called as `!hello' and "Hello
ae97d6ec 850 World USER" if called as `!hello USER'.
439869bf 851
852\1f
528799bd 853File: bobot++.info, Node: Hooks, Next: Sending Messages, Prev: Adding New Commands, Up: Scripting
439869bf 854
6b59e728 8554.2 Hooks
856=========
439869bf 857
5a8b0ec6 858Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII
6530edbf 859and tiny fugue (a MUD bot) hooks with a little bit of extra stuff added
02341ea9 860in. A hook is called when a regular expression is matched against a
861message sent to or by the bot.
862
863 Bobot++ uses different hook types for each IRC message type, and also
864includes a hook for accessing raw irc messages. Hooks are tagged with a
865priority and a flag that specifies whether to call the next hook that
866matches after calling the current one or to stop processing.
867
868 Hooks are processed from the highest to lowest priority, with
869fallthrough hooks of equal priority to non-fallthrough hooks being
870executed first.
439869bf 871
872* Menu:
873
874* Creating a Hook::
875* Hook Types::
876
877\1f
878File: bobot++.info, Node: Creating a Hook, Next: Hook Types, Prev: Hooks, Up: Hooks
879
6b59e728 8804.2.1 Creating a Hook
881---------------------
439869bf 882
9efc3706 883To add a new hook you use the function `bot:addhook'.
884
885 -- Function: bot:addhook type regex function [pri fall name]
886 TYPE specifies the type of hook (the types of hooks are listed in
ae97d6ec 887 *Note Hook Types::).
888
889 REGEX is a standard regular expression. If REGEX is matched,
890 FUNCTION will be called.
891
892 FUNCTION will take a different number of args depending on the
893 hook type.
894
895 PRI specifies the priority of the hook--higher priority hooks are
896 executed first. This argument is optional and defaults to `0'.
897
898 FALL is `#t' if the hook is a fallthrough hook and `#f' is the
899 hook is not a fallthrough hook. This arg is also optional and
900 defaults to `#t'.
901
902 NAME is the optional name of the hook that defaults to
903 `"DEFAULT"'. If you set the name then you can have more than one
904 hook that matches the same regexp, as long as they have the same
905 name. E.g. in a log script you could have the regexps for the log
906 function all be `".*"' and set their names to `"log"' to avoid a
907 conflict with other hooks.
439869bf 908
909\1f
910File: bobot++.info, Node: Hook Types, Prev: Creating a Hook, Up: Hooks
911
6b59e728 9124.2.2 Hook Types
913----------------
439869bf 914
ae97d6ec 915The following sections document the different hooks Bobot++ exposes.
916
917 The general format of each hook description is as if it were a
c99c411a 918function to be defined, but these describe the function to be passed to
9efc3706 919`bot:add-hook'. Do _not_ name your functions these names.
439869bf 920
9efc3706 921 That said, here is the list of available hooks functions. FIXME:
922write docs
439869bf 923
ae97d6ec 924* Menu:
925
926* Received Message Hooks::
927* Sent Message Hooks::
928* DCC CHAT Hooks::
929* Miscellaneous Hooks::
930
931\1f
932File: bobot++.info, Node: Received Message Hooks, Next: Sent Message Hooks, Prev: Hook Types, Up: Hook Types
933
9344.2.2.1 Receieved Message Hooks
935...............................
936
937The following hooks are triggered when a mesage is received by the bot.
938
9efc3706 939 -- Function: hooks/action from to action
ae97d6ec 940 This hook is triggered when someone performs an action.
941
942 FROM is the nickname the person that performed the action.
943
944 TO is the target of the action, which is either a channel or the
945 Bot's nick if the user private messages the bot.
946
947 ACTION is the text of the action. E.g. if someone did `* foobar
948 does baz', then ACTION would be the string `"does baz"'.
439869bf 949
9efc3706 950 -- Function: hooks/nickname old-nick new-nick
ae97d6ec 951 This hook is called when someone changes his nickname from
9efc3706 952 OLD-NICK to NEW-NICK.
439869bf 953
ae97d6ec 954 -- Function: hooks/signoff nick message
955 This hook is called when someone signs off of IRC.
956
957 NICK is the nickname of the person signing off.
958
959 MESSAGE is his quit message
439869bf 960
9efc3706 961 -- Function: hooks/ctcp nick to command rest
ae97d6ec 962 This hook is called when a CTCP request is received by the bot.
963
964 NICK is the nickname of the sender.
965
966 TO is the target of the CTCP request. This will either be a
967 channel the bot is in, or the nickname of the bot.
968
969 COMMAND is the CTCP command issued.
970
971 REST contains the arguments to the CTCP command.
439869bf 972
9efc3706 973 -- Function: hooks/ctcp-reply nick command rest
ae97d6ec 974 This hook is called when a CTCP REPLY is received. This occurs when
975 the bot has sent a CTCP request to another client. The CTCP REPLY
976 is always addressed to the bot directly.
439869bf 977
ae97d6ec 978 NICK is the nickname of the person who replied.
439869bf 979
ae97d6ec 980 COMMAND is the command to which NICK is replying.
981
982 REST contains the body of the reply.
983
984 -- Function: hooks/disconnect server intentional
985 This is called when the bot is disconnected from a server.
986
987 SERVER is the hostname of the server from which the bot was
988 disconnected.
989
990 INTENTIONAL is a flag set to `#t' when the bot disonnected from
991 the server as the result of a command (issued by a user from IRC,
992 SIGHUP, or from a script), or `#f' when the bot disconnected from
993 the server unintentionally..
439869bf 994
9efc3706 995 -- Function: hooks/invite nick channel
ae97d6ec 996 This hook is called when a user invited the bot to join a channel.
997
998 NICK is the nickname of the user who sent the invite.
999
1000 CHANNEL is the channel to which the bot was invited.
439869bf 1001
9efc3706 1002 -- Function: hooks/join nick channel
ae97d6ec 1003 This is called when a user or the bot joins a channel.
1004
1005 NICK is the nickname of the user who joined CHANNEL. This may be
1006 the bot's nickname (the IRC server sends the JOIN command back to
1007 the the bot after it joins a channel).
1008
1009 CHANNEL is the channel that was joined
439869bf 1010
9efc3706 1011 -- Function: hooks/kick target from channel reason
ae97d6ec 1012 This hook is called when a user, including the bot, is kicked out
1013 of a channel.
1014
1015 TARGET is the nick of the user who was kicked. This may be the
1016 bot's nick.
1017
1018 FROM is the nick of the user who issued the kick. This may also be
1019 the bot's nick.
1020
1021 CHANNEL is the channel the kick was issued in.
1022
1023 REASON is the reason the user was kicked.
439869bf 1024
9efc3706 1025 -- Function: hooks/part nick channel
ae97d6ec 1026 This hook is called when a user parts a channel.
1027
1028 NICK is the user who parted the channel. This may be the bot.
1029
1030 CHANNEL is the channel from which the user parted.
1031
1032 -- Function: hooks/mode nick target modes
1033 This hook is called when someone sets the modes of TARGET.
439869bf 1034
ae97d6ec 1035 NICK is the user who set the modes. This may be the bot.
439869bf 1036
ae97d6ec 1037 TARGET is the target of the MODE command. This may be a channel or
1038 a user. If it is a user, it may be the bot.
1039
1040 MODES is the MODE string.
1041
1042 -- Function: hooks/message nick message
1043 This hook is called when someone sends a private message to the
1044 bot.
1045
1046 NICK is the nickname of the user who sent the message.
1047
1048 MESSAGE is the message the user sent.
439869bf 1049
9efc3706 1050 -- Function: hooks/notice nick message
ae97d6ec 1051 This hook is called when a user send a private notice to the bot.
1052
1053 NICK is the user who sent the notice.
1054
1055 MESSAGE is the message the user sent.
439869bf 1056
ae97d6ec 1057 -- Function: hooks/public nick channel message
1058 This hook is called when a user sends a normal message to a
1059 channel.
439869bf 1060
ae97d6ec 1061 NICK is the user who sent the message.
1062
1063 CHANNEL is the channel to which the message was sent.
1064
1065 MESSAGE is the message that was sent.
1066
1067 -- Function: hooks/public-notice nick channel message
1068 This hook is called when a user send a notice to a channel.
1069
1070 NICK is the user who sent the notice.
1071
1072 CHANNEL is the channel to which the notice was sent.
1073
1074 MESSAGE is the message that was sent.
439869bf 1075
9efc3706 1076 -- Function: hooks/raw raw-message
ae97d6ec 1077 This hook is called every time a message is received. This matches
1078 on the raw message text and passes the hook function the raw IRC
1079 message.
439869bf 1080
ae97d6ec 1081 RAW-MESSAGE is the raw IRC message.
439869bf 1082
9efc3706 1083 -- Function: hooks/topic nick channel new-topic
ae97d6ec 1084 This hook is called when a user changes the topic in a channel.
1085
1086 NICK is the user who set the topic. This may be the bot.
1087
1088 CHANNEL is the channel that's topic was changed.
1089
1090 NEW-TOPIC is the new topic.
1091
1092\1f
1093File: bobot++.info, Node: Sent Message Hooks, Next: DCC CHAT Hooks, Prev: Received Message Hooks, Up: Hook Types
439869bf 1094
ae97d6ec 10954.2.2.2 Sent Message Hooks
1096..........................
439869bf 1097
ae97d6ec 1098These hooks are called when the bot sends a message. MYNICK is always
1099the bot's nick and will not be documented in each hook description.
1100
1101 -- Function: hooks/send/public mynick channel message
1102 This hook is called when the bot sends a normal message to a
1103 channel.
1104
1105 CHANNEL is the channel to which the bot sent the message.
1106
1107 MESSAGE is the message the bot sent.
1108
1109 -- Function: hooks/send/message mynick to message
1110 This hook is called when the bot sends a private message to a user.
1111
1112 TO is the nick of the user to whom the message was sent.
1113
1114 MESSAGE is the message that was sent.
439869bf 1115
9efc3706 1116 -- Function: hooks/send/action mynick to message
ae97d6ec 1117 This hook is called when the bot sents an action to a channel or a
1118 user.
1119
1120 TO is the channel or nick of the user to which the action was sent.
1121
1122 MESSAGE is the text of the action.
439869bf 1123
9efc3706 1124 -- Function: hooks/send/ctcp mynick to command message
ae97d6ec 1125 This hook is called when the bot sends a CTCP message _other than_
1126 an ACTION to a channel or user.
1127
1128 TO is the channel or nick of the user to which the CTCP was sent.
1129
1130 COMMAND is the CTCP command that was sent.
1131
1132 MESSAGE is a string containing the arguments to the CTCP command.
1133
528799bd 1134 -- Function: hooks/send/who who
1135 This is called when the bot sends a WHO message. The regex is
1136 matched on WHO, which is also passed as the only argument to your
1137 function.
1138
1139 WHO is the channel or nick that was WHOed.
1140
1141 -- Function: hooks/send/whois nick
1142 This is called when the bot sends a WHOIS message. The regex is
1143 matched on NICK, which is also passed as the only argument to your
1144 function.
1145
1146 NICK is the nickname of the person who was WHOISed.
1147
ae97d6ec 1148\1f
1149File: bobot++.info, Node: DCC CHAT Hooks, Next: Miscellaneous Hooks, Prev: Sent Message Hooks, Up: Hook Types
1150
11514.2.2.3 DCC CHAT Hooks
1152......................
1153
1154These hooks are called when a user initializes a DCC CHAT and when the
1155bot receives messages from the user in a DCC CHAT.
0b7a49e2 1156
9efc3706 1157 -- Function: hooks/dcc/chat-begin from
ae97d6ec 1158 This hook is called when a user begins a DCC CHAT with the bot.
9efc3706 1159 FROM is the user's address in the form `nick!user@host'.
0b7a49e2 1160
133eff7a 1161 -- Function: hooks/dcc/chat-end address
1162 This hook is called when a DCC CHAT is purged after being idle for
1163 a while, or when the user closes the DCC CHAT. As such, you cannot
1164 write any more data to the DCC CHAT.
1165
1166 ADDRESS is the address (nick!user@host) of the person on the other
1167 side of the DCC.
1168
9efc3706 1169 -- Function: hooks/dcc/chat-message from message
ae97d6ec 1170 This hook is called when a user sends a message to the bot through
1171 a DCC CHAT.
1172
1173 FROM is the user's address in the form `nick!user@host'.
1174
1175 MESSAGE is the message the user sent to the bot.
1176
1177\1f
1178File: bobot++.info, Node: Miscellaneous Hooks, Prev: DCC CHAT Hooks, Up: Hook Types
1179
11804.2.2.4 Miscellaneous Hooks
1181...........................
1182
1183 -- Function: hooks/flood nick
1184 This hook is called when a user is detected flooding the bot.
1185
1186 NICK is the nickname of the user flooding the bot.
1187
1188 -- Function: hooks/timer time
1189 This hook is called once a minute. The regex is *not* used.
1190
1191 TIME is the in zero-padded `hh:mm' format.
439869bf 1192
e07b6b46 1193\1f
528799bd 1194File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Hooks, Up: Scripting
e07b6b46 1195
528799bd 11964.3 Sending Messages
6b59e728 1197====================
e07b6b46 1198
5a8b0ec6 1199There are several types of messages you can send with Bobot++ from
528799bd 1200scripts. They are split into High and Low level message sending
1201functions. Most bots will only use the high level functions, but the
1202low level ones are provided for when a bot needs to do things like send
1203raw IRC messages or CTCP commands.
e07b6b46 1204
1205* Menu:
1206
1207* High Level Message Functions::
1208* Low Level Message Functions::
1209
1210\1f
1211File: bobot++.info, Node: High Level Message Functions, Next: Low Level Message Functions, Prev: Sending Messages, Up: Sending Messages
1212
528799bd 12134.3.1 "High Level" Message Functions
6b59e728 1214------------------------------------
e07b6b46 1215
9efc3706 1216 -- Function: bot:say channel message
1217 Send a public or private MESSAGE to CHANNEL.
1218
1219 Sends a normal text message, as if a user had typed it in. The
1220 DEST can be a nickname or a channel.
1221
1222 -- Function: bot:action channel message
1223 Send an "action" type MESSAGE to CHANNEL
1224
528799bd 1225 -- Function: bot:msg target message
1226 -- Function: bot:say target message
1227 Send a public or private message to TARGET.
1228
1229 TARGET may be a channel or a nickname.
1230
1231 In versions of Bobot++ prior to 2.1.8 `bot:say' could only send to
1232 channels, and `bot:msg' could only send private messages to users.
1233 They are aliases of the same command now, but it may be worth
1234 using them as they used to for clarity.
e07b6b46 1235
5aec4622 1236 -- Function: bot:notice target message
1237 Sends MESSAGE as a NOTICE to TARGET. TARGET may be a user (nick)
528799bd 1238 or a channel.
5aec4622 1239
e07b6b46 1240\1f
1241File: bobot++.info, Node: Low Level Message Functions, Prev: High Level Message Functions, Up: Sending Messages
1242
528799bd 12434.3.2 "Low Level" Message Functions
6b59e728 1244-----------------------------------
e07b6b46 1245
5a8b0ec6 1246The "Low Level" messaging functions allow you to do things like send
fed59248 1247CTCP messages. You probably want to read rfc 2812 and the CTCP spec
e07b6b46 1248before using these. If you have no idea what these do, read rfc 2812
1249(IRC Client Protocol) and CTCP spec. These functions all return
1250`*unspecified*' always, so don't use the return value for anything.
1251
c6e7af05 1252 -- Function: bot:ctcp to command message
4679dc8b 1253 TO is the target of your CTCP message, COMMAND is the CTCP
1254 command, and MESSAGE is the message (or arguments) of the command.
1255 Make sure to `bot:ctcp-quote' the message!
e07b6b46 1256
c6e7af05 1257 -- Function: bot:ctcp-reply to command message
4679dc8b 1258 TO is the target of your CTCP reply, COMMAND is the CTCP command,
1259 and MESSAGE is the message (or arguments) of the command. Make
1260 sure to `bot:ctcp-quote' the message!
d56bdd22 1261
1262 This is used to reply to a ctcp that the bot has received.
1263
91dddabd 1264\1f
3fed2165 1265File: bobot++.info, Node: Misc Scripting Stuff, Next: Scheme Commands, Prev: Sending Messages, Up: Scripting
91dddabd 1266
528799bd 12674.4 Misc. Scripting Stuff
6b59e728 1268=========================
91dddabd 1269
5a8b0ec6 1270These are a few useful things that I thought people writing scripts
91dddabd 1271might want to know.
1272
1273 If you want to execute code when the bot exits, just do `add-hook!
1274bot:exit-hook THUNK' where THUNK is an argumentless procedure (a
1275thunk). When the bot exits your thunk will be called.
1276
3fed2165 1277* Menu:
9efc3706 1278
3fed2165 1279* Scheme Commands::
1280* Query Functions::
1281
1282\1f
1283File: bobot++.info, Node: Scheme Commands, Next: Query Functions, Prev: Misc Scripting Stuff, Up: Scripting
1284
12854.5 Scheme Commands
1286===================
1287
1288These scheme functions are the same as the commands. They allow you to
1289execute bot commands from scheme scripts.
9efc3706 1290
1291 -- Function: bot:adduser nick-or-mask cbannel-mask level prot auto-op
1292 Adds an user to the userlist, for a `nick!user@host' matching the
1293 one given, on a channel matching the CHANNELMASK given.
1294
1295 The LEVEL can be: The PROT can be: The AUTO-OP can be:
1296 0 - No level 0 - No protection 0 - No auto-op
1297 1 - User 1 - No ban 1 - Op on join
1298 2 - Trusted User 2 - No kick
1299 3 - Friend 3 - No deop
1300 4 - Master
1301
1302
1303 -- Function: bot:addserver hostname ip-address [portnumber]
1304 Adds the server specified by HOSTNAME or IP-ADDRESS to the server
1305 list.
1306
1307 -- Function: bot:addshit nick-or-mask channel-mask level [time reason]
1308 Adds an user to the shitlist, for a nick!user@host matching the
1309 one given, on a channel matching the CHANNELMASK given.
1310
1311 The LEVEL can be:
1312 0 - No shit
1313 1 - No op
1314 2 - Kick and Ban on join
1315 3 - Kick and Ban on join, no deban
1316
1317
1318 -- Function: bot:ban channel mask-or-nick
1319 Bans MASK or NICK from CHANNEL. You need to be a trusted user to
1320 ban with a MASK.
1321
1322 -- Function: bot:change-command-level nick-or-mask channel-mask
1323 new-level
1324 Gives NICK or MASK level NEW-LEVEL on channel(s) CHANNEL-MASK.
1325 Note that you can not change level for someone whose level is
1326 greater than yours, and that you can not give a level greater than
1327 yours.
1328
1329 -- Function: bot:cycle channel
1330 Makes the bot leave and join CHANNEL.
1331
1332 -- Function: bot:deban channel mask-or-nick
1333 Debans MASK or NICK from CHANNEL. You need to be a trusted user to
1334 deban with a MASK.
1335
1336 -- Function: bot:delserver server-number
1337 Deletes server from server list whose number in the server list is
1338 SERVER-NUMBER
1339
1340 -- Function: bot:deluser nick-or-mask channel-mask
1341 Removes NICK or MASK from the userlist.
1342
1343 -- Function: bot:delshit nick-or-mask channel-mask
1344 Removes NICK or MASK from the shitlist.
1345
1346 -- Function: bot:deop channel mask-or-nick
1347 Deops MASK or NICK on CHANNEL.
1348
1349 -- Function: bot:die reason
1350 Makes the bot stop immediately.
1351
1352 -- Function: bot:do ?
1353
1354 -- Function: bot:invite channel nick
1355 Invites NICK on CHANNEL.
1356
1357 -- Function: bot:join channel
1358 Makes the bot join CHANNEL.
1359
1360 -- Function: bot:keep channel modes
1361 Sets the MODES that the bot will keep for CHANNEL. See also STATS.
1362
1363 -- Function: bot:kick channel mask-or-nick [reason]
1364 Kicks MASK or NICK out of CHANNEL, because of REASON. You need to
1365 be a trusted user to use a MASK.
1366
1367 -- Function: bot:kickban channel mask-or-nick [reason]
1368 Bans then kicks MASK or NICK out of CHANNEL, because of REASON.
1369 You need to be a trusted user to use a MASK.
1370
1371 -- Function: bot:lock channel
1372 Locks topic on CHANNEL.
1373
9efc3706 1374 -- Function: bot:mode channel mode-string
1375 Sends MODE-STRING as mode for CHANNEL.
1376
1377 -- Function: bot:nextserver
1378 Makes the bot connect to the next server in its server list.
1379
1380 -- Function: bot:nick nick
1381 Makes the bot use nickname NICK.
1382
1383 -- Function: bot:op channel nick
1384 Ops NICK on CHANNEL.
1385
1386 -- Function: bot:part channel
1387 Makes the bot leave CHANNEL.
1388
1389 -- Function: bot:reconnect
1390 Makes the bot reconnect to its current server.
1391
1392 -- Function: bot:server server-number
1393 Select the server to connect to. SERVER-NUMBER is the number of
1394 the server in the serverlist.
1395
1396 -- Function: bot:setfloodrate ?
1397
1398 -- Function: bot:setversion ?
1399
1400 -- Function: bot:tban channel nick-or-mask time
1401 Bans NICK or MASK from CHANNEL for TIME seconds.
1402
1403 -- Function: bot:tkban channel nick-or-mask time [reason]
1404 Bans NICK or MASK from CHANNEL for TIME seconds, then kicks
1405 him/them because of REASON.
1406
1407 -- Function: bot:topic channel topic
1408 If no TOPIC is given, prints CHANNEL's topic. Otherwise, the bot
1409 will change CHANNEL's topic to TOPIC.
1410
1411 -- Function: bot:unlock channel
1412 Makes the bot unlock topic on CHANNEL.
1413
c6e7af05 1414 -- Function: bot:who target
1415 Sends a WHO command to TARGET. TARGET may be either a channel or a
1416 user.
1417
1418 -- Function: bot:whois nick
1419 Sends a WHOIS command to NICK. NICK *must* be a nickname, you
1420 cannot send a WHOIS to a channel.
1421
3fed2165 1422 -- Function: bot:delcommand
1423 [ Probably deletes a command added with `bot:addcommand' ? ]
1424
1425\1f
1426File: bobot++.info, Node: Query Functions, Prev: Scheme Commands, Up: Scripting
1427
14284.6 Query Functions
1429===================
1430
1431 [ I didn't know where to put any of these, so I just stuck them in
1432 here.
1433
1434 There probably needs to be several sections added, like dealing
1435 with users (kicking, added, etc), dealing with the bot (channels,
1436 nickname of the bot, etc), server issues (serverlist), useful
1437 tools (nslookup, whois), and do on. ]
1438
1439 These functions allow scripts to get various bits of information.
1440
1441 -- Function: bot:logport
1442 [ Probably returns the log port? ]
1443
9efc3706 1444 -- Function: bot:getnickname
1445 [ Gets the bot's nickname? ]
1446
1447 -- Function: bot:getserver
1448
1449 -- Function: bot:getserverlist
1450
1451 -- Function: bot:flush
1452 [ Flushes the socket to the server? ]
1453
1454 -- Function: bot:flushport
1455 [ Flushes the log port? ]
1456
1457 -- Function: bot:random ?
1458 [ Returns a random number? What range? Why? ]
1459
9efc3706 1460 -- Function: bot:addtimer ? ?
1461
1462 -- Function: bot:deltimer ?
1463
1464 -- Function: bot:dcc-chat-send ? ?
1465
1466 [ And what about the stuff defined in `bobot-utils.scm' ? I just
1467 added it here so it could be somewhere. There should also be a
1468 section dealing with modules. How to use them. What module
1469 scripts are in. What module bobot++ provided primites are in.
1470 And so on. ]
1471
1472 -- Function: bot:log . messages
1473 Write as many MESSAGES as you want to the log. If the arg is a
1474 thunk it will be executed and it's output will be written to the
1475 log.
1476
1477 -- Function: bot:load file
1478
1479 -- Function: bot:load-module module-spec
1480
1481 -- Function: bot:use-module module-spec
1482
1483 -- Function: bot:match-not-channel regex
3fed2165 1484 `bot:match-not-channel' adds a prefix regex to your REGEX so it
1485 doesn't match the sender or channel in a PUBLIC message
9efc3706 1486
1487 -- Function: bot:match-to-me regex
3fed2165 1488 `bot:match-to-me' matches text that was addressed to the bot with a
1489 ':', ',', or nothing after the bot name.
9efc3706 1490
1491 -- Function: bot:sent-to-me? message
1492
1493 -- Function: bot:ctcp-quote message
1494 Returns the CTCP quoted message Input _MUST NOT_ contain the
1495 trailing `\r\n' (it is added by the message sending code).
1496
1497 -- Variable: %bot:loadpath
1498
1499 -- Function: %bot:load-extensions
1500
ad529fde 1501\1f
1502File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top
1503
1504Concept Index
1505*************
1506
6b59e728 1507\0\b[index\0\b]
ad529fde 1508* Menu:
e07b6b46 1509
6b59e728 1510* Background on Hooks: Hooks. (line 6)
e07b6b46 1511
ad529fde 1512\1f
1513File: bobot++.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top
1514
1515Function Index
1516**************
1517
6b59e728 1518\0\b[index\0\b]
ad529fde 1519* Menu:
e07b6b46 1520
3fed2165 1521* %bot:load-extensions: Query Functions. (line 75)
9efc3706 1522* bot:action: High Level Message Functions.
1523 (line 13)
1524* bot:addcommand: Adding New Commands. (line 11)
1525* bot:addhook: Creating a Hook. (line 9)
3fed2165 1526* bot:addserver: Scheme Commands. (line 22)
1527* bot:addshit: Scheme Commands. (line 26)
1528* bot:addtimer: Query Functions. (line 36)
1529* bot:adduser: Scheme Commands. (line 10)
1530* bot:ban: Scheme Commands. (line 37)
1531* bot:change-command-level: Scheme Commands. (line 42)
c6e7af05 1532* bot:ctcp: Low Level Message Functions.
1533 (line 13)
3fed2165 1534* bot:ctcp-quote: Query Functions. (line 69)
c6e7af05 1535* bot:ctcp-reply: Low Level Message Functions.
1536 (line 18)
3fed2165 1537* bot:cycle: Scheme Commands. (line 48)
1538* bot:dcc-chat-send: Query Functions. (line 40)
1539* bot:deban: Scheme Commands. (line 51)
1540* bot:delcommand: Scheme Commands. (line 141)
1541* bot:delserver: Scheme Commands. (line 55)
1542* bot:delshit: Scheme Commands. (line 62)
1543* bot:deltimer: Query Functions. (line 38)
1544* bot:deluser: Scheme Commands. (line 59)
1545* bot:deop: Scheme Commands. (line 65)
1546* bot:die: Scheme Commands. (line 68)
1547* bot:do: Scheme Commands. (line 71)
1548* bot:flush: Query Functions. (line 27)
1549* bot:flushport: Query Functions. (line 30)
1550* bot:getnickname: Query Functions. (line 20)
1551* bot:getserver: Query Functions. (line 23)
1552* bot:getserverlist: Query Functions. (line 25)
1553* bot:invite: Scheme Commands. (line 73)
1554* bot:join: Scheme Commands. (line 76)
1555* bot:keep: Scheme Commands. (line 79)
1556* bot:kick: Scheme Commands. (line 82)
1557* bot:kickban: Scheme Commands. (line 86)
1558* bot:load: Query Functions. (line 53)
1559* bot:load-module: Query Functions. (line 55)
1560* bot:lock: Scheme Commands. (line 90)
1561* bot:log: Query Functions. (line 48)
1562* bot:logport: Query Functions. (line 17)
1563* bot:match-not-channel: Query Functions. (line 59)
1564* bot:match-to-me: Query Functions. (line 63)
1565* bot:mode: Scheme Commands. (line 93)
9efc3706 1566* bot:msg: High Level Message Functions.
1567 (line 16)
3fed2165 1568* bot:nextserver: Scheme Commands. (line 96)
1569* bot:nick: Scheme Commands. (line 99)
5aec4622 1570* bot:notice: High Level Message Functions.
528799bd 1571 (line 27)
3fed2165 1572* bot:op: Scheme Commands. (line 102)
1573* bot:part: Scheme Commands. (line 105)
1574* bot:random: Query Functions. (line 33)
1575* bot:reconnect: Scheme Commands. (line 108)
9efc3706 1576* bot:say: High Level Message Functions.
1577 (line 7)
3fed2165 1578* bot:sent-to-me?: Query Functions. (line 67)
1579* bot:server: Scheme Commands. (line 111)
1580* bot:setfloodrate: Scheme Commands. (line 115)
1581* bot:setversion: Scheme Commands. (line 117)
1582* bot:tban: Scheme Commands. (line 119)
1583* bot:tkban: Scheme Commands. (line 122)
1584* bot:topic: Scheme Commands. (line 126)
1585* bot:unlock: Scheme Commands. (line 130)
1586* bot:use-module: Query Functions. (line 57)
1587* bot:who: Scheme Commands. (line 133)
1588* bot:whois: Scheme Commands. (line 137)
ae97d6ec 1589* hooks/action: Received Message Hooks.
1590 (line 9)
1591* hooks/ctcp: Received Message Hooks.
1592 (line 31)
1593* hooks/ctcp-reply: Received Message Hooks.
1594 (line 43)
1595* hooks/dcc/chat-begin: DCC CHAT Hooks. (line 10)
133eff7a 1596* hooks/dcc/chat-end: DCC CHAT Hooks. (line 14)
1597* hooks/dcc/chat-message: DCC CHAT Hooks. (line 22)
ae97d6ec 1598* hooks/disconnect: Received Message Hooks.
1599 (line 54)
1600* hooks/flood: Miscellaneous Hooks. (line 7)
1601* hooks/invite: Received Message Hooks.
1602 (line 65)
1603* hooks/join: Received Message Hooks.
1604 (line 72)
1605* hooks/kick: Received Message Hooks.
1606 (line 81)
1607* hooks/message: Received Message Hooks.
1608 (line 112)
1609* hooks/mode: Received Message Hooks.
1610 (line 102)
1611* hooks/nickname: Received Message Hooks.
1612 (line 20)
1613* hooks/notice: Received Message Hooks.
1614 (line 120)
1615* hooks/part: Received Message Hooks.
1616 (line 95)
1617* hooks/public: Received Message Hooks.
1618 (line 127)
1619* hooks/public-notice: Received Message Hooks.
1620 (line 137)
1621* hooks/raw: Received Message Hooks.
1622 (line 146)
1623* hooks/send/action: Sent Message Hooks. (line 25)
1624* hooks/send/ctcp: Sent Message Hooks. (line 33)
1625* hooks/send/message: Sent Message Hooks. (line 18)
1626* hooks/send/public: Sent Message Hooks. (line 10)
528799bd 1627* hooks/send/who: Sent Message Hooks. (line 43)
1628* hooks/send/whois: Sent Message Hooks. (line 50)
ae97d6ec 1629* hooks/signoff: Received Message Hooks.
1630 (line 24)
1631* hooks/timer: Miscellaneous Hooks. (line 12)
1632* hooks/topic: Received Message Hooks.
1633 (line 153)
e07b6b46 1634
ad529fde 1635\1f
1636File: bobot++.info, Node: Variable Index, Prev: Function Index, Up: Top
1637
1638Variable Index
1639**************
1640
6b59e728 1641\0\b[index\0\b]
ad529fde 1642* Menu:
2e20c3e1 1643
3fed2165 1644* %bot:loadpath: Query Functions. (line 73)
1645* exit-hook: Misc Scripting Stuff. (line 9)
e07b6b46 1646
1647
2e20c3e1 1648\1f
1649Tag Table:
e45daca1 1650Node: Top\7f538
d15caa3b 1651Node: Introduction\7f2385
1652Node: Configuration\7f2697
1653Node: Configuration File Placement\7f3141
1654Node: Configuration Files\7f3642
1655Node: bot.conf\7f3878
1656Node: server syntax\7f6064
1657Node: channel syntax\7f6862
1658Node: bot.users\7f7906
1659Node: bot.init\7f9367
1660Node: bot.autoexec\7f10026
1661Node: bot.shit\7f10527
1662Node: Using the Bot\7f11779
1663Node: Starting the Bot\7f12111
1664Node: Concepts\7f13617
1665Node: User Levels\7f13904
1666Node: Protection\7f15283
1667Node: Automatic Op\7f16000
1668Node: Shit Levels\7f16412
1669Node: Built-In Commands\7f17136
1670Node: Bot Control Commands\7f17879
1671Node: Message Commands\7f18617
1672Node: Channel Control\7f19221
1673Node: Spylist Commands\7f21599
1674Node: User List Commands\7f22057
1675Node: Server List Commands\7f22549
1676Node: Shit List Commands\7f23756
1677Node: Channel Info\7f24244
1678Node: Scripting Commands\7f24861
1679Node: Authentication Commands\7f25455
1680Node: Miscellaneous Commands\7f26219
1681Node: Scripting\7f27221
1682Node: Adding New Commands\7f28310
1683Node: Hooks\7f29621
1684Node: Creating a Hook\7f30459
1685Node: Hook Types\7f31665
1686Node: Received Message Hooks\7f32229
1687Node: Sent Message Hooks\7f37456
1688Node: DCC CHAT Hooks\7f39340
1689Node: Miscellaneous Hooks\7f40380
1690Node: Sending Messages\7f40829
1691Node: High Level Message Functions\7f41361
1692Node: Low Level Message Functions\7f42425
1693Node: Misc Scripting Stuff\7f43478
1694Node: Scheme Commands\7f43976
1695Node: Query Functions\7f48632
1696Node: Concept Index\7f50858
1697Node: Function Index\7f51077
1698Node: Variable Index\7f59329
2e20c3e1 1699\1f
1700End Tag Table