|
Chatbot::TalkerBotCommands - Some builtin command handling for the TalkerBot to use |
Chatbot::TalkerBotCommands - Some builtin command handling for the TalkerBot to use
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.
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.
$Id: TalkerBotCommands.pm,v 1.4 2001/12/16 06:10:44 piers Exp $
|
Chatbot::TalkerBotCommands - Some builtin command handling for the TalkerBot to use |