1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package Plugin::Thanks;
use strict;
use warnings;
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;
|