mutewinter / Showbot

🤖 An IRC Bot and Website for 5by5.tv written with the Cinch and Sinatra frameworks
MIT License
90 stars 31 forks source link

Suggestion: Centralized configuration and a small question #31

Closed rikai closed 11 years ago

rikai commented 11 years ago

I think a major usability enhancement for this bot would be to have a central configuration file where you can define settings, rather than everything being scattered across the various .rb files. In the current setup, you end up having to scan through most of the .rb files to be sure you've changed all the relevant bits.

At the very least, separating from the .rb files, so you don't have to sift through the code to define things like IRC channels, IRC servers and Shoutcast steams, would make maintenance easier in the future.

Semi-related, but not a big enough issue to file its own bug, i seem to be missing where you define whether the bot is in production or test mode, mind pointing the way?

Thanks!

mutewinter commented 11 years ago

I completely agree with you about the centralized configuration. Showbot evolved organically over time as the needs of 5by5 grew. As such, it has turned into spaghetti code in many areas.

That's why I've been working on a complete rewrite. The rewrite is feature complete, and adds a ton of new things. It's written with Rails this time around, which makes the code much more structured. I plan to launch it soon. There will be more details once I go into beta.

Production vs. Development for IRC Bot

The channel and name of the bot is set based on how you luanch showbot_irc.rb.

Procfile.local launches showbot_irc.rb in freenode_test which uses the test config in cinchize.yml. There's also a name fixing function that runs 5 minutes after the bot starts.