NAME

Chatbot::TalkerBotCommands - Some builtin command handling for the TalkerBot to use

SYNOPSIS

my $handler = new Chatbot::TalkerBotCommands;
$boolean = $handler->isCommand( 'help' );
$rv = $handler->doCommand( $talker, $person, $command, @args );
$handler->installCommandHelp( 'foo',  ['Syntax: foo <number>', 'Returns the foo function'] );

$rv is 0 unless the command wants to stop the bot, in which case a return value of 1 will kill the bot. Hence, almost all commands should return 0.

$talker in the above should be a Chatbot::TalkerBot object.

DESCRIPTION

This module is intended to be used from inside Chatbot::TalkerBot, and not directly by anyone. It has only three object methods - one that discovers whether a command is handled by this module, one actually runs the command, and one is used to install help information for use by the 'help' builtin command handler.

See Chatbot::TalkerBot docs section COMMANDS - INTERNAL AND EXTERNAL, to see when this object is called upon to handle a command.

BUILTIN COMMANDS

help

The most basic command. If called with no args (e.g. a user typed '> talkerbot help') it returns a minimal help syntax message; if called with the argument 'commands' if whispers back the full list of available commands (well, all commands that have been registered with installCommandHelp); else it tries to return help for the command whose name is the given argument. E.g. '> talkerbot help foo' returns help for the foo command.

version

Returns version number and some basic stats - age, I/O amounts - for the talkerbot object.

process

Return information about the talkerbot's controlling process - memory usage and pid.

echo <password> <some text>

Requires that the first argument is a password, although if your talkerbot has an admin group defined members of that group can enter the wrong password. This command forces the bot to say something.

die <password>

Requires a correct password. Makes the bot gracefully leave the event loop.

VERSION

$Id: TalkerBotCommands.pm,v 1.4 2001/12/16 06:10:44 piers Exp $