Skip to content

Commit

Permalink
Adjusted Advent to give better error when session token expires
Browse files Browse the repository at this point in the history
  • Loading branch information
49Indium committed Nov 20, 2024
1 parent 84cb77c commit 2349741
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uqcsbot/advent.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def _get_leaderboard_json(self, year: int, code: int) -> Json:
response = requests.get(
LEADERBOARD_URL.format(year=year, code=code),
cookies={"session": self.session_id},
allow_redirects=False, # Will redirct to home page if session token is out of date
)
except RequestException as exception:
raise FatalErrorWithLog(
Expand Down Expand Up @@ -495,7 +496,7 @@ async def leaderboard_command(
members = self._get_members(year, code)
except InvalidHTTPSCode:
await interaction.edit_original_response(
content="Error fetching leaderboard data. Check the leaderboard code and year."
content="Error fetching leaderboard data. Check the leaderboard code and year. If this keeps occurring, reach out to committee, as this may be due to an invalid session token."
)
return
except AssertionError:
Expand Down

0 comments on commit 2349741

Please sign in to comment.