NAME
Bot::BasicBot::Pluggable::Module::Karma - tracks karma for various concepts
VERSION
version 1.30
IRC USAGE
- <thing>++ # <comment>
-
Increases the karma for <thing>.
Responds with the new karma for <thing> unless
karma_change_response
is set to a false value. - <thing>-- # <comment>
-
Decreases the karma for <thing>.
Responds with the new karma for <thing> unless
karma_change_response
is set to a false value. - karma <thing>
-
Replies with the karma rating for <thing>.
- explain <thing>
-
Lists three each good and bad things said about <thing>:
<user> explain Morbus <bot> positive: committing lots of bot documentation; fixing the fisher_yates; negative: filling the dev list. overall: 5
METHODS
- get_karma($username)
-
Returns either a string representing the total number of karma points for the passed
$username
or the total number of karma points and subroutine reference for good and bad karma comments. These references return the according karma levels when called in scalar context or a array of hash reference. Every hash reference has entries for the timestamp (timestamp), the giver (who) and the explanation string (reason) for its karma action. - add_karma($thing, $good, $reason, $who)
-
Adds or subtracts from the passed
$thing
's karma.$good
is either 1 (to add a karma point to the$thing
or 0 (to subtract).$reason
is an optional string commenting on the reason for the change, and$who
is the person modifying the karma of$thing
. Nothing is returned.
VARS
- ignore_selfkarma
-
Defaults to 1; determines whether to respect selfkarmaing or not.
- num_comments
-
Defaults to 3; number of good and bad comments to display on explanations. Set this variable to 0 if you do not want to list reasons at all.
- show_givers
-
Defaults to 1; whether to show who gave good or bad comments on explanations.
- randomize_reasons
-
Defaults to 1; whether to randomize the order of reasons. If set to 0, the reasons are sorted in reversed chronological order.
- karma_change_response
-
Defaults to 1; whether to show a response when the karma of a thing is changed. If true, the bot will reply with the new karma. If set to 0, the bot will silently update the karma, without a response.
AUTHOR
Mario Domgoergen <mdom@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.