Bot::B...::Karma(3pm)

πŸ“¦
version 1.30 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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. $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. nothing. zero. zilch. 😌

πŸŽ€ VARS πŸŽ€

the knobs you can turn, bestie:

  • ignore_selfkarma β€” defaults to 1; determines whether to respect selfkarmaing or not. so like, do we let people hype themselves up? by default, no. πŸ™ˆ
  • num_comments β€” defaults to 3; the 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. zero reasons, zero drama.
  • show_givers β€” defaults to 1; whether to show who gave the good or bad comments on explanations. snitching is ON by default. πŸ‘‘
  • randomize_reasons β€” defaults to 1; whether to randomize the order of reasons. if you set it to 0, the reasons are sorted in reversed chronological order. fresh tea first, basically. πŸ“
  • 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. 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