Skip to content

Commit

Permalink
modified: cogs/dvp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Revulate committed Oct 15, 2024
1 parent f48ac88 commit e8fc9fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cogs/dvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ def __init__(self, bot):
self.last_scrape_time = None

if not self.sheet_id:
self.logger.error("GOOGLE_SHEET_ID is not set in the environment variables")
raise ValueError("GOOGLE_SHEET_ID is not set in the environment variables")
if not self.creds_file:
self.logger.error("GOOGLE_CREDENTIALS_FILE is not set in the environment variables")
raise ValueError("GOOGLE_CREDENTIALS_FILE is not set in the environment variables")

# Initialize TwitchAPI
client_id = os.getenv("TWITCH_CLIENT_ID")
client_secret = os.getenv("TWITCH_CLIENT_SECRET")
redirect_uri = os.getenv("TWITCH_REDIRECT_URI")
if not client_id:
self.logger.error("TWITCH_CLIENT_ID is not set in the environment variables")
if not client_secret:
self.logger.error("TWITCH_CLIENT_SECRET is not set in the environment variables")
if not redirect_uri:
self.logger.error("TWITCH_REDIRECT_URI is not set in the environment variables")
if not client_id or not client_secret or not redirect_uri:
raise ValueError(
"TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET, and TWITCH_REDIRECT_URI must be set in environment variables"
Expand Down Expand Up @@ -531,4 +539,4 @@ async def log_total_playtime_for_games(self, game_names):


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

0 comments on commit e8fc9fb

Please sign in to comment.