Skip to content

Instantly share code, notes, and snippets.

@statico
Created October 27, 2010 23:02
Show Gist options
  • Save statico/650209 to your computer and use it in GitHub Desktop.
Save statico/650209 to your computer and use it in GitHub Desktop.
package Bot::BasicBot::Pluggable::Module::Maternity;
use base qw(Bot::BasicBot::Pluggable::Module);
use strict;
use warnings;
our @REPLIES = (
"slaps %s",
"slaps %s repeatedly",
"plays a rimshot",
"finds your comment hilarious, original.",
"writes that one down because it was awesome",
"thinks %s is probably the funniest person, ever.",
"is amazed at %s's prowess toward humor",
"crowns %s as the king of English literacy",
"thinks stagnant jokes are still funny, surprisingly",
"watches as the joke is exhumed and then beaten again",
);
sub help {
my ( $self, $message ) = @_;
return "Respects the sanctity of our mothers.";
}
sub said {
my ( $self, $message, $priority ) = @_;
return unless $priority == 2;
if ( $message->{body} =~ /\b ((yo)?ur|'s) \s* mom \b/sxi ) {
my $reply = $REPLIES[ rand @REPLIES ];
$reply =~ s/%s/$message->{who}/gs;
$self->bot->emote(
{ who => $message->{who},
channel => $message->{channel},
body => $reply
}
);
}
return;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment