App-RoboBot
view release on metacpan or search on metacpan
lib/App/RoboBot/Plugin/Social/Karma.pm view on Meta::CPAN
package App::RoboBot::Plugin::Social::Karma;
$App::RoboBot::Plugin::Social::Karma::VERSION = '4.004';
use v5.20;
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use App::RoboBot::Nick;
use Number::Format;
extends 'App::RoboBot::Plugin';
=head1 social.karma
Modifies and displays karma/reputation points.
In addition to the exported functions, this module inserts a pre-hook into the
message processing pipeline which looks for any karma giving/taking. Any
substrings in messages which match ``nick++`` or ``nick--`` are extracted and
used to automatically increment or decrement, respectively, the named person's
global karma.
A user's karma is calculated using a weighted formula that discourages a single
benefactor or detractor from completely dominating their target's reputation.
It is not a simple integer. Though this module would be much less obtuse if it
were, because karma currently calculates pretty weirdly in some circumstances.
The end goal is for the number of distinct benefactors/detractors to matter
more than the number of grants/revokes performed by a single entity. Stated
another way, "more distinct people liking me is more powerful than one person
really hating me."
=cut
has '+name' => (
default => 'Social::Karma',
);
has '+description' => (
default => 'Modifies and displays karma/reputation points.',
);
has '+before_hook' => (
default => 'update_karma',
);
=head2 karma
=head3 Description
Displays the named person's current karma. Multiple nicks may be provided and
they will all have their karma displayed.
=head3 Usage
[<nick> [<nick> ...]]
=head3 Examples
=head2 ++karma
=head3 Description
The explicit function call version of incrementing the named person's karma.
=head3 Usage
<nick>
=head3 Examples
=head2 --karma
=head3 Description
The explicit function call version of decrementing the named person's karma.
=head3 Usage
( run in 0.876 second using v1.01-cache-2.11-cpan-39bf76dae61 )