Skip to content

Instantly share code, notes, and snippets.

@jegade
Created March 18, 2011 09:59
Show Gist options
  • Save jegade/875842 to your computer and use it in GitHub Desktop.
Save jegade/875842 to your computer and use it in GitHub Desktop.
sub said {
my ( $self, $mess ) = @_;
my $who = $mess->{who};
my $body = $mess->{body};
sleep(1);
if ( $body =~ /botsnack/i ) {
my @answers = ( "sweet, thanks $who", "one more please :-)", "sorry, $who, i had enough snacks", "noch einer und ich platze", "$who please don't feed me more", "geplatzt .... " );
return $answers[ rand @answers ];
}
if ( $body =~ /botbeer/i ) {
my @answers = ( "cheers, $who", "sorry, $who, it's to late", "$who please don't drinkt and chat", "Hicks ..." );
return $answers[ rand @answers ];
}
if ( $body =~ /^re$/i ) {
my @answers = ( "wz $who", "moin $who", "Gude $who", "$who - schön das du da bist!", "Tach $who", "Hi $who", "bonjour $who", "Salut $who" );
return $answers[ rand @answers ];
}
if ( $body =~ /^wb \s*(.*)/i ) {
return "welcome back $1 ";
}
if ( $body =~ /^Gute Nacht$/i ) {
my @answers = ( "schlaf gut, $who", "Bis morgen $who", "$who, jetzt schon? Bleibt doch noch etwas!", "Schön das du heute abend da warst" );
return $answers[ rand @answers ];
}
if ( $body =~ /^M(a+)hlzeit$/i ) {
my @answers = ( "Guten Hunger $who", "bringst du mir was mit?", "$who, was gibt es denn Gutes?", "$who, achte auf die Kalorien!" );
return $answers[ rand @answers ];
}
if ( $body =~ /^Prost/i ) {
my @answers = ( "Prost $who", "Es reicht langsam :D", "$who, das nächste mal eine Runde für alle?", "Mehr!" );
return $answers[ rand @answers ];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment