Dancer is an IRC (Internet Relay Chat) bot made by Bjørn Reese (breese) with the aim to provide useful services to the users on the channel. Many nice and complex features were added by Daniel Stenberg (Bagder). This documentation covers version 4.0- it is very incomplete though.
A few notes on the examples below
All commands are case-insensitive. In the following assume that the nickname of the bot is robot.
The syntax and a short description of each command is available directly from the bot. To get the syntax of a command write
/msg robot syntax <command>
To get the short description of a command write
/msg robot help <command>
The on-line help is always more up-to-date than this document.
As it is fairly easy to fake the username on many sites, this bot requires authentication by password for most higher-level commands. You only need to register once, as long as the bot is able to keep track of you. This is possible as long as you are on the same channel (provided you don't split) and/or if you have an active dcc chat connection to the bot. To authenticate use the PASS command.
/msg robot pass <your-password>
To change the password use the NEWPASS.
/msg robot newpass <your-new-password>
The bot uses MD5 for encryption, which is an even stronger encryption than the one used at login on Unix systems.
You can establish a dcc chat connection with the bot. A dcc chat connection bypasses the servers and is hence not subject to lag, netsplit or the other meanies that curse IRC. All usual messages from the bot are delayed, but not on a dcc chat.
/dcc chat robot /msg =robot <cmd>
NB: The '=' is important, as it means that the /msg will be sent though a dcc chat connection.
To disconnect type
/dcc close chat robot
or quit your IRC client.
If you are behind a firewall (or similar) that prevents you from invoking the DCC chat yourself, you can ask the bot to do it by using the CLIENT command. See closer details below.
Most commands take several arguments per command. These should be seperated by a comma (,)
SYNTAX help,syntax
performs a "SYNTAX help", followed by a "SYNTAX syntax".
Please note that these are the default levels. A command may be assigned to any other level with CHGCMDLEV.
TBD = To Be Done. Not yet documented.This list was compiled for version 4.6.4
Synopsis: (0) ALIAS <command>
Lists all possible aliases for a command.
Synopsis: (50) BAN [-E] [*]<nick> [<time>] [<reason>];
Bans a person from the channel for the specified time. Option -E enforces a ban, ie. if someone removes it it will be put back on. Prepend a '*' to the nick to make a siteban. If <time> is 0 the ban is permanent. The format of <time> is [[HH:]MM:]SS.
<time> and <reason> may be omitted, but it is recommended that they are specified anyway.
To put a ban for default bot ban time on breese with a reason the bot selects
BAN breese
To put a ban on breese for 30 minutes, without a reason of your own
BAN breese 30:
To put a ban on breese for 1 hour and 5 seconds with the reason "Don't drink and irc"
BAN breese 1::5 Don't drink and irc
To put an enforced permanent ban on all from the site where breese comes from, with the reason "Get out"
BAN -e *breese Get out
Synopsis: (50) BANLIST [<options>] [<ban number>]
List the bans. If <options> is -A, more detail will be listed (how long ago the ban was set, and the reason.) If a number is specified, only that ban is displayed.
Synopsis: (10) BUG <description>
Puts the <description> into a bug file which can be read by the bot owner.
Synopsis: (10) CALC <expression>
Arbitrary-precision arithmetic language. Can be used as a simple calculator. This is really the Unix 'bc' command.
Synopsis: (50) CHBAN <ban number> <new time>
Change the banning period of a specific ban. If <new time> is -1 the ban is removed; 0 makes the ban permanent.
Synopsis: (242) CHGCMDLEV ...
Synopsis: (100) CKEY [<key>|-]
Locks a channel key (if lock is on.)
Synopsis: (100) CLIENTLIST
Lists all users who has an active /dcc chat connection with the bot.
Synopsis: (0) CMD
Show a list of available commands. Some commands have [<code>] appended. The code means
Synopsis: (100) CMODE [<modes>]
Locks a set of channel modes on a channel (if lock is on.) If someone changes the channel modes, the bot will restore the modes specified by this command.
Synopsis: (10) COMMENT <text>
Sets the comment field of your database entry. Only usable for registered users.
Synopsis: (10) CONVERT <value> [<prefix>]<unit> [ # of decimals ]
Converts length, weight, volume, area, and temperature of different units.
Supported are:
<unit> may be prefixed with the following:
Synopsis: (10) CUT
Synopsis: (242) CUT [<nick>]
Disconnects a dcc chat connection
Synopsis: (200) DEFPASS <nick>
Install default password for <nick>. This should only be used at the request of <nick>.
Synopsis: (10) COUNTRY [.<country-code> | <nick> | <country>]
Show which country <nick> is from. If the argument starts with a dot (.) it looks for the country-code. If not preceeded by a dot and nickname is not found on the channel, it assumes that the argument is the name of a country and tries to find the closest match.
To show the name of the country which has the country-code .dk
COUNTRY .dk
To show which country breese is from
COUNTRY breese
To show the information on the country China
COUNTRY china
Synopsis: (200) DEBUGADD
Synopsis: (200) DEBUGDEL
Synopsis: (200) DO <raw irc cmd>
The bot sends the <raw irc cmd> to the server. See RFC1459
Synopsis: (10) EMAIL <nick>
Views the email address of the nick, if the bot has knowledge about it.
Synopsis: (200) EXPADD <word>=<explaination>
Adds an explaination, which can be displayed with the EXPLAIN command. <word> must be seperated from <explaination> with a '=' or a whitespace.
Synopsis: (200) EXPDEL <word>
Removes the word and its attached explanation
Synopsis: (10) EXPLAIN [-S] [<subject[*]>]
Shows an explaination to a subject. A trailing asterisk (*) in <subject> acts as a wildcard (name compleation.) If -S is used, it searches the explanations for the specified keyword.
To show all words in the vocabulary
EXPLAIN *
To show all words in the vocabulary that starts with the letter 'b'
EXPLAIN b*
To show the explaination on breese.
EXPLAIN breese
Synopsis: (10) FIND <regex>
Find a line in an index file.
Synopsis: (50) FINGER [options] [<nick>|<host>]
Retrieve remote information about a user.
Synopsis: (100) GUESTLIST ...
Synopsis: (0) HELP [<cmd>]
If no arguments are passed this cmd shows a general help. If the argument is the name of a command, it shows a short description of that particular command.
Synopsis: (50) HOST [options] [<nick>|<host>]
Query nameserver about domain names and zones.
Synopsis: (50) JOIN <channel> [<key>]
Joins a channel. If the channel has a channel key it can be provided as well. If the bot already is on a channel it leaves this first.
Synopsis: (20) INVITE <passwd>
Get an invitation from the bot if it is on an invite-only channel.
Synopsis: (20) KICKLIST ...
Synopsis: (20) LAG
Shows the last ping time between the bot and its server.
Synopsis: (50) LEAVE
Leaves the current channel.
Synopsis: (242) LOG ...
Synopsis: (20) ME <phrase>
Let the bot make a public action.
Synopsis: (242) MODERATE [ ON | OFF ]
Enable or disable moderation mode. If enabled the bot will make the channel moderated (+m) and give all non-chanops a voice (+v). Whenever someone joins they are automatically given a voice.
Synopsis: (100) MUTE ...
Synopsis: (10) MYNICK <nick>
This is an exotic command which you probably never have to use.
There are two types of authentication. One for /dcc chat connections and one for normal /msg. Normally, this distinction is unrelevant, because when you authenticate both types gets authenticated at the same time.
If the bot cannot see you on the channel (either because you aren't on the channel or you are on the other side of a netsplit) you loose the /msg authentication. If you don't change your nick the /dcc chat authentication gets transfered to the /msg authentication when it sees you again.
However, if you change your nick while the bot cannot see you, the /msg doesn't get authenticated automatically. Use this command to make the bot aware of your new nick. If we assume that your new nick is breese, send this though the /dcc chat connection.
MYNICK breese
Synopsis: (10) NEWPASS <passwd>
The password is encrypted and stored in a seperate file. It is not possible for the user who runs the bot to see it. Arguments to PASS and NEWPASS are hidden both for spylinks and the logfile.
If you should forget your own password, the user who runs the bot can install a new for you.
Synopsis: (50) NICK [<newnick>|+]
Changes nickname to <newnick> or if the argument is + the next nick specified by the nickmask is choosen.
Synopsis: (20) OP [<passwd>]
Grants chanop status to you. If an argument is provided it is assumed to be your password, and PASS is called before OP.
Synopsis: (10) PASS <passwd>
A registered user must use this command to authenticate. Many of the higher level commands requires authentication to avoid misuse.
Synopsis: (20) QUIET
Makes the bot silent.
Synopsis: (242) QUIT [<msg>]
Makes the bot give up it's virtual life.
Synopsis: (242) RELOAD [<userfile>]
Reloads the userfile.
Obsolete command. See USERADD and USERMOD.
Synopsis: (20) REPORTADD
Synopsis: (20) REPORTDEL
Synopsis: (0) RULES
Shows the rules as defined in the config file.
Synopsis: (20) SAY <phrase>
Let the bot say a phrase in public.
Synopsis: (0) SEEN [<options>] <nick>
Synopsis: (20) SEEN [<options>] ( <nick> | <host> )
Synopsis: (Public) SEEN <nick>
Reports when the bot last has seen someone. Unregistered users can only use <nick>. Chanops may also use <host>, which can contain wildcards (asterisks and questionmarks.)
Following <options> are supported
To show when the nick breese last was seen
SEEN breese
To show all occurences of nick breese
SEEN -A breese
To show when the user breese last was seen from any machine at imada.ou.dk
SEEN breese@*.imada.ou.dk
To show when anyone from imada.ou.dk last was seen
SEEN *.imada.ou.dk
Please note: This command was quite complex to built because everybody can call themselves anything, and many users use multiple accounts. The real problem is when several people use the same account. It is impossible to distinguish between several users from the same account (remember that each user can use whatever nick they like.) Therefore, once the bot registers a nick it puts it into the same bucket as all other nicks from that account, but it only uses one datestamp. Hence, the -A option can give you a wrong reply.
Synopsis: (200) SERVER [<server>]
Changes to another server. If no arguments is supplied it returns the name of the server it is currently using.
Synopsis: (200) SERVERADD <server> [<port>] [<passwd>]
Adds the specified server with the optional options to the bot's list of servers.
Synopsis: (200) SERVERDEL <server>
Removes the specified server from the list. The specified parameter can be the ID shown in the SERVERLIST command. If the server was added in the bots .config file, it can't be removed completely, but will only get disabled.
Synopsis: (200) SERVERLIST [<match>]
Displays all, or the matching servers from the serverlist. It also shows port number, if a password is used, a unique ID (that can be used with SERVERSTAT or SERVERDEL) and if the server is currently disabled.
Synopsis: (200) SERVERSTAT [-e] [-d] [<server>]
Without argument, it shows the status of the current server (if it exists in the serverlist). With a server specified, it shows the selected server's status.
-e enables the server (if it was previously disabled)
-d disables the server (it it previously wasn't)
Synopsis: (100) SET [<group>.] [<item>] [<value>]
Sets the value of a certain item.
Synopsis: (10) SETEMAIL <address>
Sets your own email field in the bot's user database.
Synopsis: (0) SHOW <nick> <cmd>
Redirect all output (except error messages) to <nick> (can also be a channel.)
Synopsis: (242) SHUTDOWN ...
Synopsis: (10) SPELL <sentence>
Spell-checks <sentence> (using ispell)
Synopsis: (0) SPLIT
Reports about the latest netsplits.
Synopsis: (200) SPYADD
Establishes a spylink. A spylink relays all commands sent to the bot. All passwords (from PASS, NEWPASS and OP) are hidden before being sent to the spylink.
Synopsis: (200) SPYDEL
Removes a spylink.
Synopsis: (200) SPYLIST
Lists all users who have an active spylink.
Synopsis: (100) STATUS [<options>]
Returns various information (including uptime.) As much information as possible is send if you specify the -A option.
Synopsis: (0) SVIEW
Synopsis: (20) SVIEW [<options>] [<nick>]
This description is outdated!
Returns various information and statistics on a user.
Shows the status of a registered user. First it looks for the nick with which the user has been registered, and if that fails it looks for someone on the channel. If no arguments are supplied it returns information on yourself. Option -A also returns all registered accounts of that user. Option -S only returns a small number of information.
Synopsis: (0) SYNTAX <cmd>
Shows a synopsis of the syntax of a command (much like these entries.)
Synopsis: (20) TALK
Make the bot talkative. It will (with a certain percentage probability) reply to certain public patterns.
Synopsis: (10) TELL <nick> <message>
Leave a <message> for <nick>, who will receive it the next time (s)he joins. Although you specify a nickname, the bot wil do the recognition by host.
To leave the message "just do it" for breese
TELL breese just do it
Synopsis: (10) TELLDEL ( <who> | <tellID> )
Removes a message stored by you.
Synopsis: (10) TELLLIST
Shows all messages that you have stored for other people.
Synopsis: (0) TELLME [<options>]
Relays the first unread message stored for you. Option -A relays all messages at once.
Synopsis: (10) TOP ...
Synopsis: (20) TOPIC
Shows when and by whom the topic was set.
Synopsis: (10) TZ [<time> | now | list ] <country #1> [<country #2>]
Synopsis: (50) UNBAN <banID | nick | pattern>
Removes a ban from the banlist.
Synopsis: (0) UPTIME
Returns how long ago the bot was started.
Synopsis: (200) USERADD [-r <regnick>] [-p <pattern>] <nick> <level> [<email/real name>]
This command adds the specified user to the bots database. A user must have certain fields of information. They are: a registered nick name, a host pattern that the user must match and a status level. By default, the person will get his/hers current nick as registered, and the host pattern the user is currently using will be set as recognized pattern.
usermod foobar 10 foo@mail.bar.com
If the defaults aren't what you want, you may change them with the flags when adding
usermod -r FooBarbar -p foo@*.barbar.com foobar 10 foo@mail.bar.com
Or you can change the users properties after the user has been added with the USERMOD command.
Synopsis: (200) USERMOD [-r <regnick>] [-p <pattern>] [-d <pattern>] [-e <email>] [-f <flags>] <nick> [<level>]
Change a user's entry in the database.
Synopsis: (20) USERLIST [<options>]
Shows the list of registered users and their level. If the option -A is specified it also shows all the registered accounts for each user.
Synopsis: (50) VRFY [options] ( <nick> | <host> )
Used to verify an email address. "man vrfy" from Unix shell.
Synopsis: (242) WALL ...
Synopsis: (100) WARNADD [*]<nick> <description>
Add a warning
Synopsis: (100) WARNDEL <warn number>
Remove a warning
Synopsis: (100) WARNLIST
Show the warnings
Synopsis: (0) WHOLEFT [<options>]
Lists the people are on the other side of a netsplit. If option -A is specified it will also show the accounts of the splitted users.
This section is about running the bot and is of little or no use to it's normal users.
Enter 'make install' in the dancer directory and let the script to the work for you. Answer the questions and you'll have an easy and smooth start of your life as botrunner.
robot[|_|A|2|two]
gives 'robot'. If this nick is in use it tries 'robot_', then 'robotA', 'robot2', 'robottwo', and then starts again from the beginning.
r[o|o|y|a]b[o|er||bi]t
gives 'robot', 'robert', 'rybt', and 'rabbit'.
File formats:
Please look at the example file "dancer.config.example".
Blank lines and lines starting with a hash (#) are ignored.
<label> = <value>
Example:
userfil = ./dancer.users logfile = ./newlog server = bot.server.org:6667 channel = #bot nick = bot[|_|0|tie] name = An IRC bot
Use USERADD to add users.
Blank lines and lines starting with a hash (#) are ignored.
<Registered nick> <Level> <Email Address> ! <Masked host> ...
Example:
# This is the entry of breese breese 200 (Bjorn Reese <breese@imada.ou.dk>) !breese@*.imada.ou.dk !breese@130.225.128.*
Author: Daniel.Stenberg@sth.frontec.se
(Bagder)
Date: 96-12-06
Version: 1.1
1. What is flooding
1.1 Server Flood Control
2. Different Flood Attacks
2.1 Standard Message Flood
2.2 Nick Flood
2.3 Ctcp Flood
3. Warning On Join
3.1 Autkickban
5. Ban On Multiple Kicks
5.1 Trying Sitebans
7. Flood Kick
7.1 Ban Flooders
7.2 Ignoring Floods
8. Kick Queue
flood: v. [IRC] To dump large amounts of text onto an {IRC} channel. This is especially rude when the text is uninteresting and the other users are trying to carry on a serious conversation. Flooding can also be done with all sorts of messages.
Generally, doing anything too much too fast is called 'to flood'. When an IRC client receives a querying message, it answers it. If the client answers too rapidly the IRC server closes connection to the client. Thus, if a lot of bots ask a single client or publicly asking all clients in a channel lots of times within a short period, all the clients that reply to the questions will get cut off from their servers.
[TECH TALK DETECTED] The server holds a few variables that directly concern us. The first and most important is the 'since'. It always holds the time of our last package sent to the server. At least. When our package is processed, the 'since' variable gets increased with the 'penalty' value of the particular command we use. (1-3 is normal, but 5 and higher is far from hard to achieve.)
Incoming packages to the server are only processed if 'since' is less than 10 seconds ahead of the current time. If it isn't, the message will remain in the queue. If the queue size gets bigger than 1000 bytes (by default, may vary in different servers), the client is cut off ("Excess Flood").
Evidently, you can use a command with a very high penalty value (i.e "KICK #channel nick1,nick2,nick3,nick4,nick5,nick6 :go home") without suffering, but with such a high penalty (2*nick + default sums up around 15) your input queue in the server won't get read within the following 5 seconds and thus any command sent to the server in the meantime are simply taking you closer to the edge.
The ways of the flooders are unpredictable. Most flooders use some kind of script or program they download from somewhere. The internet drowns in offensive programs and scripts. Floods can and are done with one or many clients/bots/programs. And of course all the types below can be mixed in any way.
2.1 Standard Message Flood
Paste lots of text in a channel. The most common case, some loser repeats the same line [with offensive language] a large number of times. Reason is to confuse (or simply annoy) other users.
2.2 Nick Flood
Keep changing nick in the channel very fast. Reason is to
2.3 Ctcp Flood
Send lots of various CTCP messages to users and/or to channel. The purpose of ctcp is to handle automated requests. Hence a ctcp request to a user, is automatically replied by the client of that user. By sending lots of requests, a lot of replies will be generated resulting in an Excess Flood of the replying user.
Users that join the channel and match a pattern stored in the WARNLIST makes the bot make a public "<bot> ALERTS: <nick> is <description>". The description is stored together with the userpattern in the WARNLIST. When a warning has been issued, the same warning won't show the following hour.
3.1 Autkickban
Users in the WARNLIST can be marked as [KICKBANNED] which will make Dancer kick and ban the user on join. The matching pattern from the WARNLIST will be used as banpattern as well. The delay that standard warnings have is not affecting this kind of warnings.
The regular IRC networks only allows 20 bans in a single channel. Dancer presents an ALERT message when the amount of bans reaches 18 to make the users aware of the problem. Since version 4.0 (beta 3), Dancer is capable of removing the least important ban instead of making the alert. This, if the autounban switch is enabled.
If a user has been kicked off the channel X times within Y seconds, Dancer puts a ban on him/her. Bot kicks and kicks by users with high status level are considered more important and enforce a ban earlier. "Intended" kicks that Dancer tries or wants to perform but doesn't succeed with, due to lag or nick change, are also counted.
5.1 Trying sitebans
If a ban due to multiple kicks is about to get set, and ONE ban already is set on the same site, Dancer will unban the previous ban and ban their whole site. If there is MORE THAN ONE ban already set on that site, just another userban is set. No matter what ban is set, all users currently joined from that site is marked to get kicked!
During a netsplit users can gain ops, set bans, change channel modes, etc. When the servers heal again, the split server will set the new modes in the healed channel. Dancer undoes all server bans and channel modes. All users that are opped by the server are carefully checked against the userlist and those who weren't opped before the split and are unknown to the bot, are deopped.
Dancer checks and discovers all sorts of floods. Unrecognized users are kicked instantly when a flood is triggered. Known, low-level users get 3 warnings before getting kicked. High-level users are left alone.
7.1 Ban flooders
The "Ban On Multiple Kicks" makes Dancer ban frequent flooders.
7.2 Ignoring floods
Floods that are dangerous to the bot are ignored. Anything more frequent than normal usage allows will enable the ignore mode.
Dancer never kicks many users too fast since that would flood it off its server. It marks all users that are supposed to get kicked and kicks them one after another fast enough to remain connected. It doesn't matter if the user changes nick, since the KICK-mark follows to the new nick. If a user marked for KICK is kicked by another user before the bot does it, Dancer will not attempt to kick it.
The really big flood attacks are done with a large number of bots joining the channel. Dancer can be set to KICK any user that joins with more than 3 clients with the same hostpattern. This makes Dancer start acting earlier and thus being able to clean off the attackers quicker.
Due to lagged and/or desynched servers, some users manage to join channels even when they are banned. Dancer checks all joined users against the current list of bans in the channel and if they match, they are kicked.
A few minor things you can do to improve Dancer's capabilities of keeping your channel a fun place to be in.
IRC nick: breese
IRC channel: #Danmark or #FrexxEd