diff --git a/bot.py b/bot.py index 09a4f61..a7cf2d5 100644 --- a/bot.py +++ b/bot.py @@ -41,13 +41,15 @@ def __init__(self): nick = os.getenv("BOT_NICK") prefix = os.getenv("COMMAND_PREFIX", "#") channels = os.getenv("TWITCH_CHANNELS", "").split(",") - channels = [channel.strip() for channel in channels] # To remove leading/trailing whitespace + channels = [ + channel.strip() for channel in channels if channel.strip() + ] # To remove leading/trailing whitespace and filter empty strings # Check for missing critical environment variables self._check_env_variables() # Set initial_channels as an instance variable - self.initial_channels = [channel for channel in channels if isinstance(channel, str)] + self.initial_channels = channels super().__init__( token=self.token, @@ -272,4 +274,4 @@ async def main(): if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/cogs/remind.py b/cogs/remind.py index 59ed15d..d78d66e 100644 --- a/cogs/remind.py +++ b/cogs/remind.py @@ -202,4 +202,4 @@ def row_to_reminder(self, row): def prepare(bot): - bot.add_cog(Remind(bot)) \ No newline at end of file + bot.add_cog(Remind(bot))