mattdees / GeckBot

GeckBotIRC
4 stars 7 forks source link

Karma reasons #6

Open zmughal opened 11 years ago

zmughal commented 11 years ago

Support the syntax for karma:

nick++ # reason
mattdees commented 11 years ago

Should this be stored in the DB? I see it being possible, but also a pain in the ass (as I'd then have to index all of the karma)

mattdees commented 11 years ago

Implementation:

add karma_id to Karma schema has_many reasons

reasons table:

karma_id int, operation enum(inc, dec), reason varchar 160

on !reason $karma_key

select three random reasons for karma_id that have inc, another three for karma_id that have dec, return to channel.