DMcP89 / harambot

A Yahoo Fantasy Sports bot for Discord
MIT License
29 stars 18 forks source link

Matchup Command failing for category scoring NHL league #128

Closed DMcP89 closed 9 months ago

DMcP89 commented 1 year ago

Describe the bug The matchup command does not return when run against a NHL league that uses category scoring

To Reproduce Steps to reproduce the behavior:

  1. Configure the bot to run against an NHL league that uses category scoring format
  2. Run the matchup command

Expected behavior A clear and concise description of what you expected to happen.

Logs

Oct 17 07:58:35 PM  Error while fetching matchups for league: 43608
Oct 17 07:58:35 PM  Traceback (most recent call last):
Oct 17 07:58:35 PM    File "/usr/local/lib/python3.10/site-packages/harambot/yahoo_api.py", line 120, in get_matchups
Oct 17 07:58:35 PM      team1_details = self.get_matchup_details(matchup["0"]["team"])
Oct 17 07:58:35 PM    File "/usr/local/lib/python3.10/site-packages/harambot/yahoo_api.py", line 146, in get_matchup_details
Oct 17 07:58:35 PM      team1_projected_points = team[1]["team_projected_points"]["total"]
Oct 17 07:58:35 PM  KeyError: 'team_projected_points'
Oct 17 07:58:35 PM  [2023-10-17 23:58:35] [ERROR   ] discord.app_commands.tree: Ignoring exception in command 'matchups'
Oct 17 07:58:35 PM  Traceback (most recent call last):
Oct 17 07:58:35 PM    File "/usr/local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 827, in _do_call
Oct 17 07:58:35 PM      return await self._callback(self.binding, interaction, **params)  # type: ignore
Oct 17 07:58:35 PM    File "/usr/local/lib/python3.10/site-packages/harambot/cogs/yahoo.py", line 264, in matchups
Oct 17 07:58:35 PM      week, details = self.yahoo_api.get_matchups()
Oct 17 07:58:35 PM  TypeError: cannot unpack non-iterable NoneType object
Oct 17 07:58:35 PM