Skip to content

Commit

Permalink
modified: .github/workflows/ci.yml
Browse files Browse the repository at this point in the history
	modified:   bot.py
  • Loading branch information
Revulate committed Oct 16, 2024
1 parent 8600ab0 commit 7d37fe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,6 @@ jobs:
cp requirements.txt venv/.requirements_installed
fi
# Create .env file (using existing secrets)
cat <<EOF > .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
Expand Down
14 changes: 6 additions & 8 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7d37fe3

Please sign in to comment.