aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Shuffle.pm
blob: dc39898a885b598c4bddbb1994b81e7505f3cc25 (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
package Plugin::Shuffle;

use strict;
use warnings;

use List::Util;

my %config;

sub configure {
	my $self = shift;
	my $cmdref = shift;
	my $cref = shift;
	%config = %$cref;

	$cmdref->("shuffle", sub { $self->shuffle(@_); } );

	return $self;
}

sub shuffle {
	my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_;

	return join " ", List::Util::shuffle(@arguments);
}
1;