aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Ping.pm
blob: d935512958a16231fe8c3a1522c37a45ce7c0d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;