-This is bobot++.info, produced by makeinfo version 4.6 from
+This is bobot++.info, produced by makeinfo version 4.7 from
bobot++.texinfo.
This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
- Copyright 2002,2004 Clinton Ebadi
+ Copyright 2002,2004,2005 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
(original author, no longer works on program).
- This document applies to version 2.1.5 of the program named Bobot++
+ This document applies to version 2.2 of the program named Bobot++
- Copyright 2002,2004 Clinton Ebadi
+ Copyright 2002,2004,2005 Clinton Ebadi
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
Configuration
-* Configuration Files::
* Configuration File Placement::
+* Configuration Files::
Configuration Files
Using Bobot++
+* Starting the Bot::
* User Levels::
* Protection::
* Automatic Op::
+* Built-In Commands::
Scripting
* Creating a Hook::
* Hook Types::
+Hook Types
+
+* Received Message Hooks::
+* Sent Message Hooks::
+* DCC CHAT Hooks::
+* Miscellaneous Hooks::
+
Sending Messages
* High Level Message Functions::
\1f
File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top
-Introduction
-************
+1 Introduction
+**************
This manual feels abused and neglected because it has almost no content.
\1f
File: bobot++.info, Node: Configuration, Next: Using the Bot, Prev: Introduction, Up: Top
-Configuration
-*************
+2 Configuration
+***************
Bobot++ is easy to configure. See the `examples' directory for an
example configuration.
* Menu:
-* Configuration Files::
* Configuration File Placement::
+* Configuration Files::
\1f
-File: bobot++.info, Node: Configuration Files, Next: Configuration File Placement, Prev: Configuration, Up: Configuration
+File: bobot++.info, Node: Configuration File Placement, Next: Configuration Files, Prev: Configuration, Up: Configuration
-Configuration Files
-===================
+2.1 Configuration File Placement
+================================
+
+Bobot++ will look in `/etc/bobotpp/default/' for its default config if
+none is specified on the command line. Put the configuration files you
+want to be loaded by default in this directory. If you are not root or
+you want to have your own personal configuration, put it in
+`~/.bobotpp/config/default/'.
+
+\1f
+File: bobot++.info, Node: Configuration Files, Prev: Configuration File Placement, Up: Configuration
+
+2.2 Configuration Files
+=======================
* Menu:
\1f
File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files
-bot.conf
---------
+2.2.1 bot.conf
+--------------
* Menu:
\1f
File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf
-server syntax
-.............
+2.2.1.1 server syntax
+.....................
SERVER = SERVER_NAME [PORT [PASSWORD]]
\1f
File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf
-channel syntax
-..............
+2.2.1.2 channel syntax
+......................
CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY
\1f
File: bobot++.info, Node: bot.users, Prev: bot.conf, Up: Configuration Files
-bot.users
----------
+2.2.2 bot.users
+---------------
`bot.users' is the default file name of the userlist. It may be changed
in `bot.conf'. The file contains lines with the format:
operator priviliges on channel entry (*Note Automatic Op::).
-\1f
-File: bobot++.info, Node: Configuration File Placement, Prev: Configuration Files, Up: Configuration
-
-Configuration File Placement
-============================
-
-Bobot++ will look in `/etc/bobotpp/default/' for its default config if
-none is specified on the command line. Put the configuration files you
-want to be loaded by default in this directory. If you are not root or
-you want to have your own personal configuration, put it in
-`~/.bobotpp/config/default/'.
-
\1f
File: bobot++.info, Node: Using the Bot, Next: Scripting, Prev: Configuration, Up: Top
-Using Bobot++
-*************
+3 Using Bobot++
+***************
FIXME: stuff here...
* Menu:
+* Starting the Bot::
* User Levels::
* Protection::
* Automatic Op::
+* Built-In Commands::
\1f
-File: bobot++.info, Node: User Levels, Next: Protection, Prev: Using the Bot, Up: Using the Bot
+File: bobot++.info, Node: Starting the Bot, Next: User Levels, Prev: Using the Bot, Up: Using the Bot
+
+3.1 Starting the Bot
+====================
+
+The bot is usually installed with the binary name `bobotpp'. It accepts
+the following command line arguments:
+
+ * `[--help][-h]' - Shows detailed help and exits
-User Levels
-===========
+ * `[--version][-v]' - Shows version information and exits
+
+ * `[--no-background][-b]' - Run bobot++ in the foreground
+
+ * `[--config-file file][-f]' - Use file instead of `bot.conf'
+
+ * `[--config-dir dir][-d]' - Use dir as dir to load config file from
+
+ * `[--config dir][-c]' - Search your config path (defaults to
+ `$HOME/.bobotpp/config/' and then `/etc/bobotpp/') for dir and
+ then loads your config data using dir
+
+ * `[--sys-config dir][-s]' - Looks for config in `/etc/bobotpp/dir'.
+ Note that the user dir is still searched first
+
+ * `[--user-config dir][-u]' - Looks for config in
+ `$HOME/.bobotpp/config/dir/'. Note that the system dir is still
+ searched after this if dir is not found.
+
+ * `[--debug][-D]' Makes Bobot++ print debugging info and run in the
+ foreground
+
+ * `[--debug-scripts][-S]' Enabled the Guile debugging evaluator for
+ verbose script errors and backtraces while still running the bot
+ in the background.
+
+ The default configuration is read from
+`$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if
+the user config is not found.
+
+ The bot defaults to running in the background as a daemon.
+
+\1f
+File: bobot++.info, Node: User Levels, Next: Protection, Prev: Starting the Bot, Up: Using the Bot
+
+3.2 User Levels
+===============
There are several user levels available in Bobot++ to provide gradated
access to commands. `!adduser' and `bot.users' use the numeric code;
Scheme uses the textual name for the level. By default (if no catch-all
-setting is found in *Note bot.users::.) a user is not even a
-`bot:user-none' and cannot execute *any* commands, even commands
-available to `bot:user-none'.
+setting is found in *Note bot.users::.) a user has access to commands
+with the level `bot:user-none'.
0. `bot:user-none' - No *built-in* commands may be executed _by
default_ (commands may be added from Scheme that can be executed
\1f
File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Using the Bot
-Protection
-==========
+3.3 Protection
+==============
A user added via Scheme, the `bot.users' file, or `!adduser' may be
protected from being deoped, kicked, or banned. There are currently no
3. No deop. The bot will ensure that the user always maintains
operator status.
-
\1f
-File: bobot++.info, Node: Automatic Op, Prev: Protection, Up: Using the Bot
+File: bobot++.info, Node: Automatic Op, Next: Built-In Commands, Prev: Protection, Up: Using the Bot
-Automatic Op
-============
+3.4 Automatic Op
+================
A user may be automatically given operator status upon entering a
channel. Set the AOP field to "0" to disable auto-op or "1" to enable
auto-op.
+\1f
+File: bobot++.info, Node: Built-In Commands, Prev: Automatic Op, Up: Using the Bot
+
+3.5 Built-In Commands
+=====================
+
+Bobot++ has many built-in commands that make it useful without
+scripting support. The reference leaves off the command char; remember
+to use whatever you defined the command char to be in `bot.conf'. If a
+command needs the channel name then you must specify the channel as the
+first argument to the command when private messaging the bot a command.
+
+COMMAND NEEDS MIN LEVEL DESCRIPTION
+ CHANNEL TO USE
+`action' `do' Yes USER Causes the bot to perform the
+ action `do' in the current channel.
+`adduser'
+`addserver' Adds the server specified by HOST
+ NAME or IP ADDRESS to the server
+ list.
+`addshit'
+`alias' Makes an alias, and adds the
+ function NEW NAME, that will do
+ exactly the same command as OLD
+ NAME.
+`ban' Bans MASK or NICK from CHANNEL. You
+ need to be a trusted user to ban
+ with a MASK.
+`banlist'
+`channels' Prints the channel(s) where the bot
+ is currently.
+`cycle' Yes Makes the bot leave and join
+ CHANNEL.
+`dcclist' Gives the list of all DCC Chat
+ connections.
+`deban' Yes Debans MASK or NICK from CHANNEL.
+ You need to be a trusted user to
+ deban with a MASK.
+`delserver' Deletes server from server list
+ whose number in the server list is
+ SERVER NUMBER.
+`deluser' Removes NICK or MASK from the
+ userlist.
+`delshit' Removes NICK or MASK from the
+ shitlist.
+`deop' Yes Deops MASK or NICK on CHANNEL.
+`die' Makes the bot stop immediately.
+`do'
+`execute' *Only available if scripting
+ support is enabled*
+`help'
+`ident' Identifies you on the bot. Note
+ that you should not use this
+ command in public ...
+`invite' Yes Invites NICK on CHANNEL.
+`join' Makes the bot join CHANNEL.
+`keep' Yes Sets the MODES that the bot will
+ keep for CHANNEL.
+`kick' Yes Kicks MASK or NICK out of CHANNEL,
+ because of REASON. You need to be a
+ trusted user to use a MASK.
+`kickban' Yes Bans then kicks MASK or NICK out of
+ CHANNEL, because of REASON. You need
+ to be a trusted user to use a MASK.
+`load' Reloads the userlist from disk.
+`loadscript' *Only available if scripting
+ support is enabled*
+`lock' Locks topic on CHANNEL.
+`mode' Yes Sends MODE STRING as mode for
+ CHANNEL.
+`msg'
+`names' Yes Shows the nicknames and status of
+ users on CHANNEL.
+`nextserver' Makes the bot connect to the next
+ server in its server list.
+`nick' Makes the bot use nickname NICK.
+`nslookup' Does a nameserver query about NICK
+ host, HOST or IP ADDRESS.
+`op' Yes Ops NICK on CHANNEL.
+`part' Yes Makes the bot leave CHANNEL.
+`password' Changes your password on the bot.
+ Use `NONE' as password if you want
+ to clear it. Do not use this
+ command in public!
+`reconnect' Makes the bot reconnect to its
+ current server.
+`rspymessage' Removes you from the spy list.
+`save' Saves the userlist.
+`say' Yes Makes the bot say MESSAGE on
+ CHANNEL.
+`server' Select the server to connect to.
+ SERVER NUMBER is the number of the
+ server in the serverlist.
+`serverlist' Shows the bot's serverlist.
+`setfloodrate'
+`setversion'
+`shitlist' Shows the bot's shitlist.
+`spylist' Shows the bot's spylist.
+`spymessage' Adds you to the spylist
+`stats' Yes Gives CHANNEL's statistics.
+`tban' Yes Bans NICK or MASK from CHANNEL for
+ TIME seconds.
+`tkban' Yes Bans NICK or MASK from CHANNEL for
+ TIME seconds, then kicks him/them
+ because of REASON.
+`topic' Yes If no TOPICis given, prints
+ CHANNEL's topic. Otherwise, the bot
+ will change CHANNEL's topic to
+ TOPIC.
+`unlock' Yes Makes the bot unlock topic on
+ CHANNEL
+`userlist' Shows the bot's userlist
+`who' Yes Show your level on CHANNEL
+`whois' Yes Shows information about NICK on
+ CHANNEL
+
\1f
File: bobot++.info, Node: Scripting, Next: Concept Index, Prev: Using the Bot, Up: Top
-Scripting
-*********
+4 Scripting
+***********
Bobot++'s most powerful feature is its scripting system. You write
scripts using Guile Scheme. This manual does not cover how to use Guile
or how to learn Scheme. *Note Guile Reference Manual: (guile)Top, for
the Guile reference manual and
-<http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html> for a
+`http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html' for a
good tutorial on Scheme.
Note that in previous versions the scripting commands where in the
The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough
to convert your code to use the new functions.
+ *NOTE*: All arguments to functions and hooks called by the bot are
+strings unless otherwise specified.
+
* Menu:
* Adding New Commands::
\1f
File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting
-Adding New Commands
-===================
+4.1 Adding New Commands
+=======================
Adding a new command is simple. To register a new command use
-`bot:addcommand'. The prototype for `bot:addcommand' is
-`(bot:addcommand name func needs-channel? num-of-args min-level)'. The
-`name' is a string representing the name of the command being added.
-`func' is a function accepting `num-of-args' arguments.
-`needs-channel?' is a bool that is true if the function needs the
-channel name as its first arg, and false otherwise. `num-of-args' is
-the number of args `func' will take and must be within zero (0) and
-twenty (20). `min-level' is one of the *Note Scheme User Levels::. A
-user must be at least a `min-level' user to use the new command. None
-of the arguments are guaranteed to be passed; if they aren't they are
-set to the empty string `""'. An example of a new command would be:
-
- (define (hello channel name)
- (if (string=? name "")
- (bot:say channel "Hello world!")
- (bot:say channel (string-append "Hello " name "!")))
-
- (bot:addcommand "hello" hello #t 2 0)
-
- This will display "Hello World!" if called as `!hello' and "Hello
-World `USER'" if called as `!hello USER'.
+`bot:addcommand'.
+
+ -- Function: bot:addcommand name func needs-channel? num-of-args
+ min-level
+ The NAME is a string representing the name of the command being
+ added. FUNC is a function accepting NUM-OF-ARGS arguments.
+ NEEDS-CHANNEL? is a bool that is true if the function needs the
+ channel name as its first arg, and false otherwise. NUM-OF-ARGS
+ is the number of args FUNC will take and must be within zero (0)
+ and twenty (20). MIN-LEVEL is one of the *Note Scheme User
+ Levels::. A user must be at least a `min-level' user to use the
+ new command. None of the arguments are guaranteed to be passed;
+ if they aren't they are set to the empty string `""'. An example
+ of a new command would be:
+
+ (define (hello channel name)
+ (if (string=? name "")
+ (bot:say channel "Hello world!")
+ (bot:say channel (string-append "Hello " name "!")))
+
+ (bot:addcommand "hello" hello #t 2 0)
+
+ This will display "Hello World!" if called as `!hello' and "Hello
+ World USER" if called as `!hello USER'.
\1f
File: bobot++.info, Node: Hooks, Next: Scheme User Levels, Prev: Adding New Commands, Up: Scripting
-Hooks
-=====
+4.2 Hooks
+=========
Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII
and tiny fugue (a MUD bot) hooks with a little bit of extra stuff added
-in. The basic idea of a hook if that you match a text against regular
-expression and call a function if text in a message matches that regex.
-The different types of hooks provided by Bobot++ correspond to the
-different classes of messages that Bobot++ can recieve. A Hook also has
-several properties, including its priority and whether or not it is a
-fallthrough hook. Higher priority hooks are executed before lower
-priority hooks and fallthrough hooks are executed before
-non-fallthrough hooks of the same priority. A fallthrough hook can
-match and processing of hooks will continue; as soon as the first
-non-fallthrough hooks matches processing of hooks stops.
+in. A hook is called when a regular expression is matched against a
+message sent to or by the bot.
+
+ Bobot++ uses different hook types for each IRC message type, and also
+includes a hook for accessing raw irc messages. Hooks are tagged with a
+priority and a flag that specifies whether to call the next hook that
+matches after calling the current one or to stop processing.
+
+ Hooks are processed from the highest to lowest priority, with
+fallthrough hooks of equal priority to non-fallthrough hooks being
+executed first.
* Menu:
\1f
File: bobot++.info, Node: Creating a Hook, Next: Hook Types, Prev: Hooks, Up: Hooks
-Creating a Hook
----------------
+4.2.1 Creating a Hook
+---------------------
+
+To add a new hook you use the function `bot:addhook'.
+
+ -- Function: bot:addhook type regex function [pri fall name]
+ TYPE specifies the type of hook (the types of hooks are listed in
+ *Note Hook Types::).
+
+ REGEX is a standard regular expression. If REGEX is matched,
+ FUNCTION will be called.
-To add a new hook you use the function `bot:addhook'. `bot:addhook' is
-prototyped as `(bot:addhook type regex function pri fall name)'. `type'
-specifies the type of hook (the types of hooks are listed in *Note Hook
-Types::). `regex' is a standard regular expression. If `regex' is
-matched, `function' will be called. `function' will take a different
-number of args depending on the hook type. `pri' specifies the priority
-of the hook--higher priority hooks are executed first. This argument is
-optional and defaults to `0'. `fall' is `#t' if the hook is a
-fallthrough hook and `#f' is the hook is not a fallthrough hook. This
-arg is also optional and default to `#t'. `name' is the optional name
-of the hook that defaults to "DEFAULT". If you set the name then you
-can have more than one hook that matches the same regexp, as long as
-they have the same name. E.g. in a log script you could have the
-regexps for the log function all be `".*"' and set their names to
-`"log"' to avoid a conflict with other hooks.
+ FUNCTION will take a different number of args depending on the
+ hook type.
+
+ PRI specifies the priority of the hook--higher priority hooks are
+ executed first. This argument is optional and defaults to `0'.
+
+ FALL is `#t' if the hook is a fallthrough hook and `#f' is the
+ hook is not a fallthrough hook. This arg is also optional and
+ defaults to `#t'.
+
+ NAME is the optional name of the hook that defaults to
+ `"DEFAULT"'. If you set the name then you can have more than one
+ hook that matches the same regexp, as long as they have the same
+ name. E.g. in a log script you could have the regexps for the log
+ function all be `".*"' and set their names to `"log"' to avoid a
+ conflict with other hooks.
\1f
File: bobot++.info, Node: Hook Types, Prev: Creating a Hook, Up: Hooks
-Hook Types
-----------
+4.2.2 Hook Types
+----------------
+
+The following sections document the different hooks Bobot++ exposes.
-Here is a list of the various hooks are notes on each one. The general
-format of a hook is:
+ The general format of each hook description is as if it were a
+function to be defined, but these describe the function to be passwd to
+`bot:add-hook'. Do _not_ name your functions these names.
- * `hooks/name' (this is the Scheme variable name of the hook)
- - Description of the hook
+ That said, here is the list of available hooks functions. FIXME:
+write docs
- - ARG1 ARG2 ... ARGN
- - ARG1: desc
+* Menu:
+
+* Received Message Hooks::
+* Sent Message Hooks::
+* DCC CHAT Hooks::
+* Miscellaneous Hooks::
+
+\1f
+File: bobot++.info, Node: Received Message Hooks, Next: Sent Message Hooks, Prev: Hook Types, Up: Hook Types
+
+4.2.2.1 Receieved Message Hooks
+...............................
+
+The following hooks are triggered when a mesage is received by the bot.
+
+ -- Function: hooks/action from to action
+ This hook is triggered when someone performs an action.
+
+ FROM is the nickname the person that performed the action.
+
+ TO is the target of the action, which is either a channel or the
+ Bot's nick if the user private messages the bot.
+
+ ACTION is the text of the action. E.g. if someone did `* foobar
+ does baz', then ACTION would be the string `"does baz"'.
+
+ -- Function: hooks/nickname old-nick new-nick
+ This hook is called when someone changes his nickname from
+ OLD-NICK to NEW-NICK.
+
+ -- Function: hooks/signoff nick message
+ This hook is called when someone signs off of IRC.
- - ARG2: desc
+ NICK is the nickname of the person signing off.
- - ...
+ MESSAGE is his quit message
- - ARGN: desc
+ -- Function: hooks/ctcp nick to command rest
+ This hook is called when a CTCP request is received by the bot.
- That said, here is the list of available hooks: FIXME: write docs
+ NICK is the nickname of the sender.
- * `hooks/action'
- - This hook is triggered when someone performs an action.
+ TO is the target of the CTCP request. This will either be a
+ channel the bot is in, or the nickname of the bot.
- - FROM, TO, ACTION
- - FROM: this is the address of the person that performed
- the action in the form `NICK ! USER @ HOST' (without the
- spaces).
+ COMMAND is the CTCP command issued.
- - TO: This is the target of the action, which is either a
- channel or the Bot's nick.
+ REST contains the arguments to the CTCP command.
- - ACTION: This is the text of the action. E.g. if someone
- did `* foobar does baz', then ACTION would be the string
- `"does baz"'.
+ -- Function: hooks/ctcp-reply nick command rest
+ This hook is called when a CTCP REPLY is received. This occurs when
+ the bot has sent a CTCP request to another client. The CTCP REPLY
+ is always addressed to the bot directly.
- * `hooks/nickname'
- - Description of the hook
+ NICK is the nickname of the person who replied.
- - # of args
- - `arg1': desc
+ COMMAND is the command to which NICK is replying.
- * `hooks/signoff'
- - Description of the hook
+ REST contains the body of the reply.
- - # of args
- - `arg1': desc
+ -- Function: hooks/disconnect server intentional
+ This is called when the bot is disconnected from a server.
- * `hooks/ctcp'
- - Description of the hook
+ SERVER is the hostname of the server from which the bot was
+ disconnected.
- - # of args
- - `arg1': desc
+ INTENTIONAL is a flag set to `#t' when the bot disonnected from
+ the server as the result of a command (issued by a user from IRC,
+ SIGHUP, or from a script), or `#f' when the bot disconnected from
+ the server unintentionally..
- * `hooks/ctcp-reply'
- - Description of the hook
+ -- Function: hooks/invite nick channel
+ This hook is called when a user invited the bot to join a channel.
- - # of args
- - `arg1': desc
+ NICK is the nickname of the user who sent the invite.
- * `hooks/disconnect'
- - Description of the hook
+ CHANNEL is the channel to which the bot was invited.
- - # of args
- - `arg1': desc
+ -- Function: hooks/join nick channel
+ This is called when a user or the bot joins a channel.
- * `hooks/flood'
- - Description of the hook
+ NICK is the nickname of the user who joined CHANNEL. This may be
+ the bot's nickname (the IRC server sends the JOIN command back to
+ the the bot after it joins a channel).
- - # of args
- - `arg1': desc
+ CHANNEL is the channel that was joined
- * `hooks/invite'
- - Description of the hook
+ -- Function: hooks/kick target from channel reason
+ This hook is called when a user, including the bot, is kicked out
+ of a channel.
- - # of args
- - `arg1': desc
+ TARGET is the nick of the user who was kicked. This may be the
+ bot's nick.
- * `hooks/join'
- - Description of the hook
+ FROM is the nick of the user who issued the kick. This may also be
+ the bot's nick.
- - # of args
- - `arg1': desc
+ CHANNEL is the channel the kick was issued in.
- * `hooks/kick'
- - Description of the hook
+ REASON is the reason the user was kicked.
- - # of args
- - `arg1': desc
+ -- Function: hooks/part nick channel
+ This hook is called when a user parts a channel.
- * `hooks/part'
- - Description of the hook
+ NICK is the user who parted the channel. This may be the bot.
- - # of args
- - `arg1': desc
+ CHANNEL is the channel from which the user parted.
- * `hooks/mode'
- - Description of the hook
+ -- Function: hooks/mode nick target modes
+ This hook is called when someone sets the modes of TARGET.
- - # of args
- - `arg1': desc
+ NICK is the user who set the modes. This may be the bot.
- * `hooks/message'
- - Description of the hook
+ TARGET is the target of the MODE command. This may be a channel or
+ a user. If it is a user, it may be the bot.
- - # of args
- - `arg1': desc
+ MODES is the MODE string.
- * `hooks/notice'
- - Description of the hook
+ -- Function: hooks/message nick message
+ This hook is called when someone sends a private message to the
+ bot.
- - # of args
- - `arg1': desc
+ NICK is the nickname of the user who sent the message.
- * `hooks/public'
- - Description of the hook
+ MESSAGE is the message the user sent.
- - # of args
- - `arg1': desc
+ -- Function: hooks/notice nick message
+ This hook is called when a user send a private notice to the bot.
- * `hooks/public-notice'
- - Description of the hook
+ NICK is the user who sent the notice.
- - # of args
- - `arg1': desc
+ MESSAGE is the message the user sent.
- * `hooks/raw'
- - Description of the hook
+ -- Function: hooks/public nick channel message
+ This hook is called when a user sends a normal message to a
+ channel.
- - # of args
- - `arg1': desc
+ NICK is the user who sent the message.
- * `hooks/timer'
- - Description of the hook
+ CHANNEL is the channel to which the message was sent.
- - # of args
- - `arg1': desc
+ MESSAGE is the message that was sent.
- * `hooks/topic'
- - Description of the hook
+ -- Function: hooks/public-notice nick channel message
+ This hook is called when a user send a notice to a channel.
- - # of args
- - `arg1': desc
+ NICK is the user who sent the notice.
- * `hooks/dcc/begin'
- - This hook is triggered when a user begins a DCC CHAT with the
- bot.
+ CHANNEL is the channel to which the notice was sent.
- - FROM
- - FROM: This is the user's address in the form
- `nick!user@host'.
+ MESSAGE is the message that was sent.
- * `hooks/dcc/message'
- - This hook is triggered when a user sends a message to the bot
- through a DCC CHAT
+ -- Function: hooks/raw raw-message
+ This hook is called every time a message is received. This matches
+ on the raw message text and passes the hook function the raw IRC
+ message.
- - FROM MESSAGE
- - FROM: This is the user's address in the form
- `nick!user@host'.
+ RAW-MESSAGE is the raw IRC message.
- - MESSAGE: This is the message the user sent to the bot.
+ -- Function: hooks/topic nick channel new-topic
+ This hook is called when a user changes the topic in a channel.
+
+ NICK is the user who set the topic. This may be the bot.
+
+ CHANNEL is the channel that's topic was changed.
+
+ NEW-TOPIC is the new topic.
+
+\1f
+File: bobot++.info, Node: Sent Message Hooks, Next: DCC CHAT Hooks, Prev: Received Message Hooks, Up: Hook Types
+
+4.2.2.2 Sent Message Hooks
+..........................
+
+These hooks are called when the bot sends a message. MYNICK is always
+the bot's nick and will not be documented in each hook description.
+
+ -- Function: hooks/send/public mynick channel message
+ This hook is called when the bot sends a normal message to a
+ channel.
+
+ CHANNEL is the channel to which the bot sent the message.
+
+ MESSAGE is the message the bot sent.
+
+ -- Function: hooks/send/message mynick to message
+ This hook is called when the bot sends a private message to a user.
+
+ TO is the nick of the user to whom the message was sent.
+
+ MESSAGE is the message that was sent.
+
+ -- Function: hooks/send/action mynick to message
+ This hook is called when the bot sents an action to a channel or a
+ user.
+
+ TO is the channel or nick of the user to which the action was sent.
+
+ MESSAGE is the text of the action.
+
+ -- Function: hooks/send/ctcp mynick to command message
+ This hook is called when the bot sends a CTCP message _other than_
+ an ACTION to a channel or user.
+
+ TO is the channel or nick of the user to which the CTCP was sent.
+
+ COMMAND is the CTCP command that was sent.
+
+ MESSAGE is a string containing the arguments to the CTCP command.
+
+\1f
+File: bobot++.info, Node: DCC CHAT Hooks, Next: Miscellaneous Hooks, Prev: Sent Message Hooks, Up: Hook Types
+
+4.2.2.3 DCC CHAT Hooks
+......................
+
+These hooks are called when a user initializes a DCC CHAT and when the
+bot receives messages from the user in a DCC CHAT.
+
+ -- Function: hooks/dcc/chat-begin from
+ This hook is called when a user begins a DCC CHAT with the bot.
+ FROM is the user's address in the form `nick!user@host'.
+
+ -- Function: hooks/dcc/chat-message from message
+ This hook is called when a user sends a message to the bot through
+ a DCC CHAT.
+
+ FROM is the user's address in the form `nick!user@host'.
+
+ MESSAGE is the message the user sent to the bot.
+
+\1f
+File: bobot++.info, Node: Miscellaneous Hooks, Prev: DCC CHAT Hooks, Up: Hook Types
+
+4.2.2.4 Miscellaneous Hooks
+...........................
+
+ -- Function: hooks/flood nick
+ This hook is called when a user is detected flooding the bot.
+
+ NICK is the nickname of the user flooding the bot.
+
+ -- Function: hooks/timer time
+ This hook is called once a minute. The regex is *not* used.
+
+ TIME is the in zero-padded `hh:mm' format.
\1f
File: bobot++.info, Node: Scheme User Levels, Next: Sending Messages, Prev: Hooks, Up: Scripting
-Scheme User Levels
-==================
+4.3 Scheme User Levels
+======================
There are five levels that a user may be when interfacing with a bot:
NONE, USER, TRUSTED_USER, FRIEND, MASTER. The Scheme variables for the
\1f
File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Scheme User Levels, Up: Scripting
-Sending Messages
-================
+4.4 Sending Messages
+====================
There are several types of messages you can send with Bobot++ from
scripts. There is the simple, but rather limited, `bot:say',
\1f
File: bobot++.info, Node: High Level Message Functions, Next: Low Level Message Functions, Prev: Sending Messages, Up: Sending Messages
-"High Level" Message Functions
-------------------------------
+4.4.1 "High Level" Message Functions
+------------------------------------
+
+ -- Function: bot:say channel message
+ Send a public or private MESSAGE to CHANNEL.
+
+ Sends a normal text message, as if a user had typed it in. The
+ DEST can be a nickname or a channel.
+
+ -- Function: bot:action channel message
+ Send an "action" type MESSAGE to CHANNEL
-...
+ -- Function: bot:msg nick message
+ The same as if a user typed `/msg nick message' to their IRC
+ client.
+
+ -- Function: bot:notice target message
+ Sends MESSAGE as a NOTICE to TARGET. TARGET may be a user (nick)
+ or a channel. This returns 0 on success.
\1f
File: bobot++.info, Node: Low Level Message Functions, Prev: High Level Message Functions, Up: Sending Messages
-"Low Level" Message Functions
------------------------------
+4.4.2 "Low Level" Message Functions
+-----------------------------------
The "Low Level" messaging functions allow you to do things like send
CTCP messages. You probably want to read rfc 2812 and the CTCP spec
(IRC Client Protocol) and CTCP spec. These functions all return
`*unspecified*' always, so don't use the return value for anything.
- * `bot:send-CTCP to command message' `to' is the target of your CTCP
- message, `command' is the CTCP command, and `message' is the
- message (or arguments) of the command. Make sure to
- `bot:ctcp-quote' the message!
+ -- Function: bot:send-ctcp to command message
+ TO is the target of your CTCP message, COMMAND is the CTCP
+ command, and MESSAGE is the message (or arguments) of the command.
+ Make sure to `bot:ctcp-quote' the message!
+
+ -- Function: bot:send-ctcp-reply to command message
+ TO is the target of your CTCP reply, COMMAND is the CTCP command,
+ and MESSAGE is the message (or arguments) of the command. Make
+ sure to `bot:ctcp-quote' the message!
+ This is used to reply to a ctcp that the bot has received.
\1f
File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting
-Misc. Scripting Stuff
-=====================
+4.5 Misc. Scripting Stuff
+=========================
These are a few useful things that I thought people writing scripts
might want to know.
bot:exit-hook THUNK' where THUNK is an argumentless procedure (a
thunk). When the bot exits your thunk will be called.
+ [ I didn't know where to put any of these, so I just stuck them in
+ here.
+
+ There probably needs to be several sections added, like dealing
+ with users (kicking, added, etc), dealing with the bot (channels,
+ nickname of the bot, etc), server issues (serverlist), useful
+ tools (nslookup, whois), and do on. ]
+
+ -- Function: bot:adduser nick-or-mask cbannel-mask level prot auto-op
+ Adds an user to the userlist, for a `nick!user@host' matching the
+ one given, on a channel matching the CHANNELMASK given.
+
+ The LEVEL can be: The PROT can be: The AUTO-OP can be:
+ 0 - No level 0 - No protection 0 - No auto-op
+ 1 - User 1 - No ban 1 - Op on join
+ 2 - Trusted User 2 - No kick
+ 3 - Friend 3 - No deop
+ 4 - Master
+
+
+ -- Function: bot:addserver hostname ip-address [portnumber]
+ Adds the server specified by HOSTNAME or IP-ADDRESS to the server
+ list.
+
+ -- Function: bot:addshit nick-or-mask channel-mask level [time reason]
+ Adds an user to the shitlist, for a nick!user@host matching the
+ one given, on a channel matching the CHANNELMASK given.
+
+ The LEVEL can be:
+ 0 - No shit
+ 1 - No op
+ 2 - Kick and Ban on join
+ 3 - Kick and Ban on join, no deban
+
+
+ -- Function: bot:ban channel mask-or-nick
+ Bans MASK or NICK from CHANNEL. You need to be a trusted user to
+ ban with a MASK.
+
+ -- Function: bot:change-command-level nick-or-mask channel-mask
+ new-level
+ Gives NICK or MASK level NEW-LEVEL on channel(s) CHANNEL-MASK.
+ Note that you can not change level for someone whose level is
+ greater than yours, and that you can not give a level greater than
+ yours.
+
+ -- Function: bot:cycle channel
+ Makes the bot leave and join CHANNEL.
+
+ -- Function: bot:deban channel mask-or-nick
+ Debans MASK or NICK from CHANNEL. You need to be a trusted user to
+ deban with a MASK.
+
+ -- Function: bot:delserver server-number
+ Deletes server from server list whose number in the server list is
+ SERVER-NUMBER
+
+ -- Function: bot:deluser nick-or-mask channel-mask
+ Removes NICK or MASK from the userlist.
+
+ -- Function: bot:delshit nick-or-mask channel-mask
+ Removes NICK or MASK from the shitlist.
+
+ -- Function: bot:deop channel mask-or-nick
+ Deops MASK or NICK on CHANNEL.
+
+ -- Function: bot:die reason
+ Makes the bot stop immediately.
+
+ -- Function: bot:do ?
+
+ -- Function: bot:invite channel nick
+ Invites NICK on CHANNEL.
+
+ -- Function: bot:join channel
+ Makes the bot join CHANNEL.
+
+ -- Function: bot:keep channel modes
+ Sets the MODES that the bot will keep for CHANNEL. See also STATS.
+
+ -- Function: bot:kick channel mask-or-nick [reason]
+ Kicks MASK or NICK out of CHANNEL, because of REASON. You need to
+ be a trusted user to use a MASK.
+
+ -- Function: bot:kickban channel mask-or-nick [reason]
+ Bans then kicks MASK or NICK out of CHANNEL, because of REASON.
+ You need to be a trusted user to use a MASK.
+
+ -- Function: bot:lock channel
+ Locks topic on CHANNEL.
+
+ -- Function: bot:logport
+ [ Probably returns the log port? ]
+
+ -- Function: bot:mode channel mode-string
+ Sends MODE-STRING as mode for CHANNEL.
+
+ -- Function: bot:nextserver
+ Makes the bot connect to the next server in its server list.
+
+ -- Function: bot:nick nick
+ Makes the bot use nickname NICK.
+
+ -- Function: bot:op channel nick
+ Ops NICK on CHANNEL.
+
+ -- Function: bot:part channel
+ Makes the bot leave CHANNEL.
+
+ -- Function: bot:reconnect
+ Makes the bot reconnect to its current server.
+
+ -- Function: bot:server server-number
+ Select the server to connect to. SERVER-NUMBER is the number of
+ the server in the serverlist.
+
+ -- Function: bot:setfloodrate ?
+
+ -- Function: bot:setversion ?
+
+ -- Function: bot:tban channel nick-or-mask time
+ Bans NICK or MASK from CHANNEL for TIME seconds.
+
+ -- Function: bot:tkban channel nick-or-mask time [reason]
+ Bans NICK or MASK from CHANNEL for TIME seconds, then kicks
+ him/them because of REASON.
+
+ -- Function: bot:topic channel topic
+ If no TOPIC is given, prints CHANNEL's topic. Otherwise, the bot
+ will change CHANNEL's topic to TOPIC.
+
+ -- Function: bot:unlock channel
+ Makes the bot unlock topic on CHANNEL.
+
+ -- Function: bot:getnickname
+ [ Gets the bot's nickname? ]
+
+ -- Function: bot:getserver
+
+ -- Function: bot:getserverlist
+
+ -- Function: bot:flush
+ [ Flushes the socket to the server? ]
+
+ -- Function: bot:flushport
+ [ Flushes the log port? ]
+
+ -- Function: bot:random ?
+ [ Returns a random number? What range? Why? ]
+
+ -- Function: bot:delcommand
+ [ Probably deletes a command added with `bot:addcommand' ? ]
+
+ -- Function: bot:addtimer ? ?
+
+ -- Function: bot:deltimer ?
+
+ -- Function: bot:dcc-chat-send ? ?
+
+ [ And what about the stuff defined in `bobot-utils.scm' ? I just
+ added it here so it could be somewhere. There should also be a
+ section dealing with modules. How to use them. What module
+ scripts are in. What module bobot++ provided primites are in.
+ And so on. ]
+
+ -- Function: bot:log . messages
+ Write as many MESSAGES as you want to the log. If the arg is a
+ thunk it will be executed and it's output will be written to the
+ log.
+
+ -- Function: bot:load file
+
+ -- Function: bot:load-module module-spec
+
+ -- Function: bot:use-module module-spec
+
+ -- Function: bot:match-not-channel regex
+ match-not-channel adds a prefix regex to your REGEX so it doesn't
+ match the sender or channel in a PUBLIC message
+
+ -- Function: bot:match-to-me regex
+ match-to-me matches text that was addressed to the bot with a ':',
+ ',', or nothing after the bot name.
+
+ -- Function: bot:sent-to-me? message
+
+ -- Function: bot:ctcp-quote message
+ Returns the CTCP quoted message Input _MUST NOT_ contain the
+ trailing `\r\n' (it is added by the message sending code).
+
+ -- Variable: %bot:loadpath
+
+ -- Function: %bot:load-extensions
+
\1f
File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top
Concept Index
*************
+\0\b[index\0\b]
* Menu:
-* Background on Hooks: Hooks.
+* Background on Hooks: Hooks. (line 6)
\1f
File: bobot++.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top
Function Index
**************
+\0\b[index\0\b]
* Menu:
-* addcommand: Adding New Commands.
-* addhook: Creating a Hook.
+* %bot:load-extensions: Misc Scripting Stuff.
+ (line 206)
+* bot:action: High Level Message Functions.
+ (line 13)
+* bot:addcommand: Adding New Commands. (line 11)
+* bot:addhook: Creating a Hook. (line 9)
+* bot:addserver: Misc Scripting Stuff.
+ (line 34)
+* bot:addshit: Misc Scripting Stuff.
+ (line 38)
+* bot:addtimer: Misc Scripting Stuff.
+ (line 167)
+* bot:adduser: Misc Scripting Stuff.
+ (line 22)
+* bot:ban: Misc Scripting Stuff.
+ (line 49)
+* bot:change-command-level: Misc Scripting Stuff.
+ (line 54)
+* bot:ctcp-quote: Misc Scripting Stuff.
+ (line 200)
+* bot:cycle: Misc Scripting Stuff.
+ (line 60)
+* bot:dcc-chat-send: Misc Scripting Stuff.
+ (line 171)
+* bot:deban: Misc Scripting Stuff.
+ (line 63)
+* bot:delcommand: Misc Scripting Stuff.
+ (line 164)
+* bot:delserver: Misc Scripting Stuff.
+ (line 67)
+* bot:delshit: Misc Scripting Stuff.
+ (line 74)
+* bot:deltimer: Misc Scripting Stuff.
+ (line 169)
+* bot:deluser: Misc Scripting Stuff.
+ (line 71)
+* bot:deop: Misc Scripting Stuff.
+ (line 77)
+* bot:die: Misc Scripting Stuff.
+ (line 80)
+* bot:do: Misc Scripting Stuff.
+ (line 83)
+* bot:flush: Misc Scripting Stuff.
+ (line 155)
+* bot:flushport: Misc Scripting Stuff.
+ (line 158)
+* bot:getnickname: Misc Scripting Stuff.
+ (line 148)
+* bot:getserver: Misc Scripting Stuff.
+ (line 151)
+* bot:getserverlist: Misc Scripting Stuff.
+ (line 153)
+* bot:invite: Misc Scripting Stuff.
+ (line 85)
+* bot:join: Misc Scripting Stuff.
+ (line 88)
+* bot:keep: Misc Scripting Stuff.
+ (line 91)
+* bot:kick: Misc Scripting Stuff.
+ (line 94)
+* bot:kickban: Misc Scripting Stuff.
+ (line 98)
+* bot:load: Misc Scripting Stuff.
+ (line 184)
+* bot:load-module: Misc Scripting Stuff.
+ (line 186)
+* bot:lock: Misc Scripting Stuff.
+ (line 102)
+* bot:log: Misc Scripting Stuff.
+ (line 179)
+* bot:logport: Misc Scripting Stuff.
+ (line 105)
+* bot:match-not-channel: Misc Scripting Stuff.
+ (line 190)
+* bot:match-to-me: Misc Scripting Stuff.
+ (line 194)
+* bot:mode: Misc Scripting Stuff.
+ (line 108)
+* bot:msg: High Level Message Functions.
+ (line 16)
+* bot:nextserver: Misc Scripting Stuff.
+ (line 111)
+* bot:nick: Misc Scripting Stuff.
+ (line 114)
+* bot:notice: High Level Message Functions.
+ (line 20)
+* bot:op: Misc Scripting Stuff.
+ (line 117)
+* bot:part: Misc Scripting Stuff.
+ (line 120)
+* bot:random: Misc Scripting Stuff.
+ (line 161)
+* bot:reconnect: Misc Scripting Stuff.
+ (line 123)
+* bot:say: High Level Message Functions.
+ (line 7)
+* bot:send-ctcp: Low Level Message Functions.
+ (line 13)
+* bot:send-ctcp-reply: Low Level Message Functions.
+ (line 18)
+* bot:sent-to-me?: Misc Scripting Stuff.
+ (line 198)
+* bot:server: Misc Scripting Stuff.
+ (line 126)
+* bot:setfloodrate: Misc Scripting Stuff.
+ (line 130)
+* bot:setversion: Misc Scripting Stuff.
+ (line 132)
+* bot:tban: Misc Scripting Stuff.
+ (line 134)
+* bot:tkban: Misc Scripting Stuff.
+ (line 137)
+* bot:topic: Misc Scripting Stuff.
+ (line 141)
+* bot:unlock: Misc Scripting Stuff.
+ (line 145)
+* bot:use-module: Misc Scripting Stuff.
+ (line 188)
+* hooks/action: Received Message Hooks.
+ (line 9)
+* hooks/ctcp: Received Message Hooks.
+ (line 31)
+* hooks/ctcp-reply: Received Message Hooks.
+ (line 43)
+* hooks/dcc/chat-begin: DCC CHAT Hooks. (line 10)
+* hooks/dcc/chat-message: DCC CHAT Hooks. (line 14)
+* hooks/disconnect: Received Message Hooks.
+ (line 54)
+* hooks/flood: Miscellaneous Hooks. (line 7)
+* hooks/invite: Received Message Hooks.
+ (line 65)
+* hooks/join: Received Message Hooks.
+ (line 72)
+* hooks/kick: Received Message Hooks.
+ (line 81)
+* hooks/message: Received Message Hooks.
+ (line 112)
+* hooks/mode: Received Message Hooks.
+ (line 102)
+* hooks/nickname: Received Message Hooks.
+ (line 20)
+* hooks/notice: Received Message Hooks.
+ (line 120)
+* hooks/part: Received Message Hooks.
+ (line 95)
+* hooks/public: Received Message Hooks.
+ (line 127)
+* hooks/public-notice: Received Message Hooks.
+ (line 137)
+* hooks/raw: Received Message Hooks.
+ (line 146)
+* hooks/send/action: Sent Message Hooks. (line 25)
+* hooks/send/ctcp: Sent Message Hooks. (line 33)
+* hooks/send/message: Sent Message Hooks. (line 18)
+* hooks/send/public: Sent Message Hooks. (line 10)
+* hooks/signoff: Received Message Hooks.
+ (line 24)
+* hooks/timer: Miscellaneous Hooks. (line 12)
+* hooks/topic: Received Message Hooks.
+ (line 153)
\1f
File: bobot++.info, Node: Variable Index, Prev: Function Index, Up: Top
Variable Index
**************
+\0\b[index\0\b]
* Menu:
+* %bot:loadpath: Misc Scripting Stuff.
+ (line 204)
* exit-hook: Misc Scripting Stuff.
-* hooks/action: Hook Types.
-* hooks/ctcp: Hook Types.
-* hooks/ctcp-reply: Hook Types.
-* hooks/dcc/begin: Hook Types.
-* hooks/dcc/message: Hook Types.
-* hooks/disconnect: Hook Types.
-* hooks/flood: Hook Types.
-* hooks/invite: Hook Types.
-* hooks/join: Hook Types.
-* hooks/kick: Hook Types.
-* hooks/message: Hook Types.
-* hooks/mode: Hook Types.
-* hooks/nickname: Hook Types.
-* hooks/notice: Hook Types.
-* hooks/part: Hook Types.
-* hooks/public: Hook Types.
-* hooks/public-notice: Hook Types.
-* hooks/raw: Hook Types.
-* hooks/signoff: Hook Types.
-* hooks/timer: Hook Types.
-* hooks/topic: Hook Types.
-* user-friend: Scheme User Levels.
-* user-master: Scheme User Levels.
-* user-none: Scheme User Levels.
-* user-trusted: Scheme User Levels.
-* user-user: Scheme User Levels.
+ (line 9)
+* user-friend: Scheme User Levels. (line 6)
+* user-master: Scheme User Levels. (line 6)
+* user-none: Scheme User Levels. (line 6)
+* user-trusted: Scheme User Levels. (line 6)
+* user-user: Scheme User Levels. (line 6)
\1f
Tag Table:
-Node: Top\7f522
-Node: Introduction\7f1768
-Node: Configuration\7f1956
-Node: Configuration Files\7f2239
-Node: bot.conf\7f2446
-Node: server syntax\7f3872
-Node: channel syntax\7f4720
-Node: bot.users\7f5547
-Node: Configuration File Placement\7f6438
-Node: Using the Bot\7f6908
-Node: User Levels\7f7111
-Node: Protection\7f8556
-Node: Automatic Op\7f9157
-Node: Scripting\7f9412
-Node: Adding New Commands\7f10373
-Node: Hooks\7f11637
-Node: Creating a Hook\7f12608
-Node: Hook Types\7f13744
-Node: Scheme User Levels\7f17215
-Node: Sending Messages\7f18341
-Node: High Level Message Functions\7f18949
-Node: Low Level Message Functions\7f19160
-Node: Misc Scripting Stuff\7f19910
-Node: Concept Index\7f20326
-Node: Function Index\7f20508
-Node: Variable Index\7f20769
+Node: Top\7f527
+Node: Introduction\7f1925
+Node: Configuration\7f2117
+Node: Configuration File Placement\7f2404
+Node: Configuration Files\7f2904
+Node: bot.conf\7f3097
+Node: server syntax\7f4535
+Node: channel syntax\7f5399
+Node: bot.users\7f6242
+Node: Using the Bot\7f7145
+Node: Starting the Bot\7f7395
+Node: User Levels\7f8904
+Node: Protection\7f10306
+Node: Automatic Op\7f10914
+Node: Built-In Commands\7f11203
+Node: Scripting\7f18182
+Node: Adding New Commands\7f19254
+Node: Hooks\7f20575
+Node: Creating a Hook\7f21415
+Node: Hook Types\7f22621
+Node: Received Message Hooks\7f23185
+Node: Sent Message Hooks\7f28412
+Node: DCC CHAT Hooks\7f29809
+Node: Miscellaneous Hooks\7f30526
+Node: Scheme User Levels\7f30975
+Node: Sending Messages\7f32109
+Node: High Level Message Functions\7f32725
+Node: Low Level Message Functions\7f33505
+Node: Misc Scripting Stuff\7f34568
+Node: Concept Index\7f41144
+Node: Function Index\7f41363
+Node: Variable Index\7f52526
\1f
End Tag Table