aboutsummaryrefslogtreecommitdiff
path: root/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin')
-rw-r--r--Plugin/Ping.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/Plugin/Ping.pm b/Plugin/Ping.pm
new file mode 100644
index 0000000..d935512
--- /dev/null
+++ b/Plugin/Ping.pm
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+
+package Plugin::Ping;
+
+use strict;
+use warnings;
+
+my %config;
+
+sub configure {
+ my $self = shift;
+ my $cmdref = shift;
+
+ $cmdref->("ping", sub { $self->ping(@_); } );
+
+ return $self;
+}
+
+sub ping {
+ my ($self, $logger, $who, $where, $rest, @arguments) = @_;
+ my $nick = (split /!/, $who)[0];
+ return "$nick: pong";
+}
+1;