aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-09-07 23:27:52 +1200
committerDavid Phillips <david@sighup.nz>2018-09-07 23:27:52 +1200
commit7bf721b7720f05e44ac58df6f443702167a4f7d8 (patch)
treee3f5dc804cf78456a74ccd22e1d58d38a3685a4a
parentad2319935c1494cf2e67e75575fc3a743356672b (diff)
downloadidalius-7bf721b7720f05e44ac58df6f443702167a4f7d8.tar.xz
Add Thanks.pm
-rw-r--r--Plugin/Thanks.pm32
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;