Bot::B...::Karma(3pm)
π Bot::B...::Karma β bestie edition π
okay so this is Bot::BasicBot::Pluggable::Module::Karma (yes the manual name is literally abbreviated like that, it's giving mysterious, iykyk) and it's a lil Perl module that tracks karma for various concepts. that's it. that's the whole vibe. someone says a thing, the thing gets points, we keep the receipts. π
it's part of the User Contributed Perl Documentation, so like, community-made, and I'm obsessed.
β¨ VERSION β¨
version 1.30</pruple> β yes that's the whole section, she's short and iconic.
π¦ IRC USAGE π¦
this is where the magic happens bestie, here's everything you can say in the channel:
<thing>++ # <comment>β bumps up the karma for<thing>. π
the bot replies with the new karma total for <thing>, UNLESS karma_change_response is set to a false value β then it's silent, no cap.
<thing>-- # <comment>β knocks the karma down for<thing>. π
same deal: bot replies with the new karma for <thing>, unless karma_change_response is falsy. then, silence. π€«
karma <thing>β the bot just tells you the karma rating for<thing>. simple. elegant. slay.explain <thing>β this one's the main character fr. it lists three good and three bad things that were said about<thing>:
<user> explain Morbus
<bot> positive: committing lots of bot documentation; fixing the
fisher_yates; negative: filling the dev list. overall: 5
look at that. a full character assessment in one line. π«Ά
πΈ METHODS πΈ
for the dev girlies who wanna poke at the internals:
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 plus a subroutine reference for good and bad karma comments. those references, when you call them in scalar context, hand you back the according karma levels; call them and you get an array of hash reference. and every single hash reference has entries for the timestamp (timestamp), the giver (who) and the explanation string (reason) for its karma action. yes, all three. no, we don't skip fields. πadd_karma($thing, $good, $reason, $who)β adds to or subtracts from the karma of the passed$thing.$goodis either1(to add a karma point to the$thing) or0(to subtract).$reasonis an optional string commenting on the reason for the change, and$whois the person modifying the karma of$thing. nothing is returned. nothing. zero. zilch. π
π VARS π
the knobs you can turn, bestie:
ignore_selfkarmaβ defaults to1; determines whether to respect selfkarmaing or not. so like, do we let people hype themselves up? by default, no. πnum_commentsβ defaults to3; the number of good and bad comments to display on explanations. set this variable to0if you do not want to list reasons at all. zero reasons, zero drama.show_giversβ defaults to1; whether to show who gave the good or bad comments on explanations. snitching is ON by default. πrandomize_reasonsβ defaults to1; whether to randomize the order of reasons. if you set it to0, the reasons are sorted in reversed chronological order. fresh tea first, basically. πkarma_change_responseβ defaults to1; 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 to0, the bot will silently update the karma, without a response. stealth mode unlocked. π§
heads up bestie: karma_change_response shows up in two places in this page β once in IRC USAGE and once here in VARS. that's not a typo, that's just how she is. π
β AUTHOR β
Mario Domgoergen <mdom@cpan.org> β thank you for your service, legend. π«‘
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so like, go wild, just keep it legal and keep the license. π
and that's the whole page bestie!! this doc shipped as part of perl v5.40.0, dated 2024-08-24, in the User Contributed Perl Documentation for Bot::B...::Karma (3pm) β tysm for reading, mwah, go give something a ++ π
β¨π
π¦ where this page comes from
- ubuntu resolute: libbot-basicbot-pluggable-perl 1.30+ds1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbot-basicbot-pluggable-perl 1.30+ds1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms