Skip to content

Commit

Permalink
modified: bot.py
Browse files Browse the repository at this point in the history
	modified:   cogs/remind.py
  • Loading branch information
Revulate committed Oct 16, 2024
1 parent 16f2f04 commit 0c037b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -272,4 +274,4 @@ async def main():


if __name__ == "__main__":
asyncio.run(main())
asyncio.run(main())
2 changes: 1 addition & 1 deletion cogs/remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ def row_to_reminder(self, row):


def prepare(bot):
bot.add_cog(Remind(bot))
bot.add_cog(Remind(bot))

0 comments on commit 0c037b7

Please sign in to comment.