Hambergo / 9kmmrbot

MIT License
104 stars 29 forks source link

Generalize Twitch channel connection/requirements #15

Closed tverghis closed 5 years ago

tverghis commented 5 years ago

(I closed #13 because I moved the changes to its own branch instead of master - this PR is exactly the same as that one otherwise)

Previously, the code assumed that the bot should join the production instance's Twitch channel on startup. It also assumed that the valid channel for the !join and !part commands would only be the 9kmmrbot channel.

The code should be deployable to create testing/staging instances of the bot, so the above assumptions no longer hold true.

This patch allows configuration of the bot's channel details (name and ID) through environment variables. If left unconfigured, it should fall back to existing behavior.

tverghis commented 5 years ago

Unless I'm mistaken (I very well might be), those properties are only populated on the object once the client has connected. We need those details before we connect, right?