diff options
Diffstat (limited to 'Plugin')
-rw-r--r-- | Plugin/Thanks.pm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Plugin/Thanks.pm b/Plugin/Thanks.pm new file mode 100644 index 0000000..c005271 --- /dev/null +++ b/Plugin/Thanks.pm @@ -0,0 +1,32 @@ +package Plugin::Thanks; + +use strict; +use warnings; + +my %config; + +sub configure { + my $self = shift; + my $cmdref = shift; + + $cmdref->("thanks", sub { $self->thanks(@_); } ); + $cmdref->("thanks.", sub { $self->thanks(@_); } ); + $cmdref->("thanks!", sub { $self->thanks(@_); } ); + $cmdref->("thanks?", sub { $self->thanks(@_); } ); + + return $self; +} + +sub thanks { + my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_; + my $nick = (split /!/, $who)[0]; + my @responses = ( + "No problem", + "No problem!", + "Pas de problème", + "Don\'t worry about it", + "That's fine dude" + ); + return "$nick: " . $responses[rand(@responses)]; +} +1; |