From 13be301fab6a21e35b1203ced76e0036b8473e82 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 10 Apr 2018 16:22:15 +1200 Subject: Add Ping module --- Plugin/Ping.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Plugin/Ping.pm (limited to 'Plugin') 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; -- cgit v1.1