| 1 | package Amethyst::Brain::Infobot::Module::Cool; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use vars qw(@ISA); | ||
| 5 | use Amethyst::Message; | ||
| 6 | use Amethyst::Brain::Infobot; | ||
| 7 | use Amethyst::Brain::Infobot::Module; | ||
| 8 | |||
| 9 | @ISA = qw(Amethyst::Brain::Infobot::Module); | ||
| 10 | |||
| 11 | sub new { | ||
| 12 | my $class = shift; | ||
| 13 | my $self = $class->SUPER::new( | ||
| 14 | Name => 'Cool', | ||
| 15 | Regex => qr/^(?:neat|cool)(?:[!.])?$/i, | ||
| 16 | Usage => 'cool', | ||
| 17 | Description => "Be Cool", | ||
| 18 | @_ | ||
| 19 | ); | ||
| 20 | |||
| 21 | return bless $self, $class; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub action { | ||
| 25 | my ($self, $message) = @_; | ||
| 26 | |||
| 27 | my $reply = $self->reply_to($message, 'cool ' x (2 + rand(5))); | ||
| 28 | $reply->send; | ||
| 29 | |||
| 30 | return 1; | ||
| 31 | } | ||
| 32 | |||
| 33 | 1; |