aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Thanks.pm
blob: 0ccf319119b8ecc30941e542b7c416691602cc96 (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
25
26
27
28
29
30
package Plugin::Thanks;

use strict;
use warnings;

sub configure {
	my $self = shift;
	my $cmdref = shift;

	$cmdref->($self, "thanks", sub { $self->thanks(@_); } );
	$cmdref->($self, "thanks.", sub { $self->thanks(@_); } );
	$cmdref->($self, "thanks!", sub { $self->thanks(@_); } );
	$cmdref->($self, "thanks?", sub { $self->thanks(@_); } );

	return $self;
}

sub thanks {
	my ($self, $irc, $logger, $who, $where, $ided, $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;