diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8354d4d..b0f356f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,32 +77,6 @@ jobs: cp requirements.txt venv/.requirements_installed fi - # Create .env file (using existing secrets) - cat < .env - TWITCH_CLIENT_ID=${{ secrets.TWITCH_CLIENT_ID }} - TWITCH_CLIENT_SECRET=${{ secrets.TWITCH_CLIENT_SECRET }} - ACCESS_TOKEN=${{ secrets.ACCESS_TOKEN }} - REFRESH_TOKEN=${{ secrets.REFRESH_TOKEN }} - BOT_NICK=${{ secrets.BOT_NICK }} - TWITCH_CHANNELS=${{ secrets.TWITCH_CHANNELS }} - COMMAND_PREFIX=${{ secrets.COMMAND_PREFIX }} - ADMIN_USERS=${{ secrets.ADMIN_USERS }} - BOT_USER_ID=${{ secrets.BOT_USER_ID }} - BROADCASTER_USER_ID=${{ secrets.BROADCASTER_USER_ID }} - LOG_LEVEL=${{ secrets.LOG_LEVEL }} - LOG_FILE=${{ secrets.LOG_FILE }} - LOG_MAX_BYTES=${{ secrets.LOG_MAX_BYTES }} - LOG_BACKUP_COUNT=${{ secrets.LOG_BACKUP_COUNT }} - API_STEAM_KEY=${{ secrets.API_STEAM_KEY }} - LOGDNA_INGESTION_KEY=${{ secrets.LOGDNA_INGESTION_KEY }} - OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - WEATHER_API_KEY=${{ secrets.WEATHER_API_KEY }} - NUULS_API_KEY=${{ secrets.NUULS_API_KEY }} - GOOGLE_SHEET_ID=${{ secrets.GOOGLE_SHEET_ID }} - GOOGLE_CREDENTIALS_FILE=credentials.json - TOKEN_EXPIRY=${{ secrets.TOKEN_EXPIRY }} - EOF - # Ensure correct file permissions for credentials.json echo "$GOOGLE_CREDENTIALS_JSON" > credentials.json chmod 600 credentials.json diff --git a/bot.py b/bot.py index 1719331..353ee6b 100644 --- a/bot.py +++ b/bot.py @@ -75,7 +75,6 @@ async def event_ready(self): await self.ensure_valid_token() await self.fetch_user_id() await self.fetch_example_streams() - await self.join_channels() self.load_modules() # Start periodic token checking @@ -227,13 +226,12 @@ def load_modules(self): self.logger.error(f"Failed to load extension {cog}: {e}") async def join_channels(self): - for channel in self.initial_channels: - try: - self.logger.info(f"Attempting to join channel: {channel}") - await self._connection.join_channels([channel]) - self.logger.info(f"Successfully joined channel: {channel}") - except Exception as e: - self.logger.error(f"Failed to join channel {channel}: {e}") + try: + self.logger.info(f"Attempting to join channels: {self.initial_channels}") + await self._connection.join_channels(self.initial_channels) + self.logger.info(f"Successfully joined channels: {self.initial_channels}") + except Exception as e: + self.logger.error(f"Failed to join channels: {e}") @commands.command(name="listcommands") async def list_commands(self, ctx: commands.Context):