download Cool.pm
Language: Perl
LOC: 25
Project Info
Amethyst
Server: CPAN
Type: zip
...thyst\Brain\Infobot\Module\
   BabyTime.pm
   Cool.pm
   Exchange.pm
   Excuse.pm
   Fortune.pm
   Google.pm
   Help.pm
   Insult.pm
   Karma.pm
   Math.pm
   Nslookup.pm
   Purldoc.pm
   Statement.pm
   Time.pm
   Zappa.pm
   Zippy.pm

package Amethyst::Brain::Infobot::Module::Cool;

use strict;
use vars qw(@ISA);
use Amethyst::Message;
use Amethyst::Brain::Infobot;
use Amethyst::Brain::Infobot::Module;

@ISA = qw(Amethyst::Brain::Infobot::Module);

sub new {
	my $class = shift;
	my $self = $class->SUPER::new(
					Name		=> 'Cool',
					Regex		=> qr/^(?:neat|cool)(?:[!.])?$/i,
					Usage		=> 'cool',
					Description	=> "Be Cool",
					@_
						);

	return bless $self, $class;
}

sub action {
    my ($self, $message) = @_;

	my $reply = $self->reply_to($message, 'cool ' x (2 + rand(5)));
	$reply->send;

	return 1;
}

1;

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us