diff options
Diffstat (limited to 'Plugin')
-rw-r--r-- | Plugin/Random.pm | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Plugin/Random.pm b/Plugin/Random.pm index 26d5250..03a050b 100644 --- a/Plugin/Random.pm +++ b/Plugin/Random.pm @@ -11,10 +11,15 @@ sub configure { $cmdref->($self, "shuffle", sub { $self->shuffle(@_); } ); $cmdref->($self, "choose", sub { $self->choose(@_); } ); + $cmdref->($self, "8ball", sub { $self->eight_ball(@_); } ); return $self; } +sub _choose { + return (List::Util::shuffle(@_))[0]; +} + sub shuffle { my ($self, $irc, $logger, $who, $where, $ided, $rest, $no_reenter, @arguments) = @_; @@ -23,6 +28,33 @@ sub shuffle { sub choose { my ($self, $irc, $logger, $who, $where, $ided, $rest, $no_reenter, @arguments) = @_; - return (List::Util::shuffle(@arguments))[0]; + return _choose(@arguments); +} + +sub eight_ball { + my ($self, $irc, $logger, $who, $where, $ided, $rest, $no_reenter, @arguments) = @_; + my @responses = ( + "It is certain.", + "Without a doubt.", + "You may rely on it", + "Yes. Definitely.", + "It is decidedly so.", + "As I see it, yes.", + "Most likely.", + "Yes.", + "Outlook good.", + "Signs point to yes.", + "Reply hazy, try again.", + "Better not tell you now.", + "Ask again later.", + "Cannot predict now.", + "Concentrate and ask again.", + "Don't count on it.", + "Outlook not so good.", + "My sources say no.", + "Very doubtful.", + "My reply is no.", + ); + return _choose(@responses); } 1; |