diff options
author | David Phillips <david@sighup.nz> | 2018-04-10 16:22:15 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-04-10 16:22:15 +1200 |
commit | 13be301fab6a21e35b1203ced76e0036b8473e82 (patch) | |
tree | ad1e1aedba64ae67cec21d525deda9acbfb08804 | |
parent | 25be5288687f6aff2e269b04d552fea03671d4e4 (diff) | |
download | idalius-13be301fab6a21e35b1203ced76e0036b8473e82.tar.xz |
Add Ping module
-rw-r--r-- | Plugin/Ping.pm | 24 |
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; |