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