Check me out, I'm open source!
I'm sure there are many inefficiencies, as this code has been embarrassingly hacked-together to a large extent. I hope to clean up the code over time, and hope to learn from anyone who wishes to participate.
My first task was to isolate all stat-tracking code. These blocks have been moved to a separate bot so I can update the bot people interact with without risking losing stats data.