Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trade command failing in NBA leagues #76

Closed
DMcP89 opened this issue Oct 16, 2022 · 1 comment
Closed

Trade command failing in NBA leagues #76

DMcP89 opened this issue Oct 16, 2022 · 1 comment
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists
Milestone

Comments

@DMcP89
Copy link
Owner

DMcP89 commented Oct 16, 2022

Describe the bug
trade command is not working as expected for NBA leagues

To Reproduce
Steps to reproduce the behavior:
Run the trade command while a trade is up for approval

Expected behavior
Harambot should post the trade details to the channel for voting

2022-10-16T21:01:54.444173+00:00 app[worker.1]: [2022-10-16 21:01:54,444 INFO] [/app/harambot/cogs/yahoo.py.yahoo.trade] trade called
2022-10-16T21:01:55.257737+00:00 app[worker.1]: Error while fetching player details for player: Aaron Gordon in league 15944
2022-10-16T21:01:55.257771+00:00 app[worker.1]: Traceback (most recent call last):
2022-10-16T21:01:55.257771+00:00 app[worker.1]:   File "/app/harambot/yahoo_api.py", line 82, in get_player_details
2022-10-16T21:01:55.257772+00:00 app[worker.1]:     embed.add_field(name="Total Points", value=player['player_points']['total'])
2022-10-16T21:01:55.257773+00:00 app[worker.1]: KeyError: 'player_points'
2022-10-16T21:01:55.260232+00:00 app[worker.1]: [2022-10-16 21:01:55,259 ERROR] [discord.ext.commands.bot.bot.on_command_error] Ignoring exception in command trade
2022-10-16T21:01:55.260232+00:00 app[worker.1]: Traceback (most recent call last):
2022-10-16T21:01:55.260233+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 190, in wrapped
2022-10-16T21:01:55.260233+00:00 app[worker.1]:     ret = await coro(*args, **kwargs)
2022-10-16T21:01:55.260234+00:00 app[worker.1]:   File "/app/harambot/cogs/yahoo.py", line 72, in trade
2022-10-16T21:01:55.260235+00:00 app[worker.1]:     api_details = self.yahoo_api.get_player_details(player['name'])["text"]+"\n"
2022-10-16T21:01:55.260235+00:00 app[worker.1]: TypeError: 'NoneType' object is not subscriptable
2022-10-16T21:01:55.260236+00:00 app[worker.1]: 
2022-10-16T21:01:55.260236+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2022-10-16T21:01:55.260237+00:00 app[worker.1]: 
2022-10-16T21:01:55.260237+00:00 app[worker.1]: Traceback (most recent call last):
2022-10-16T21:01:55.260237+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1347, in invoke
2022-10-16T21:01:55.260237+00:00 app[worker.1]:     await ctx.command.invoke(ctx)
2022-10-16T21:01:55.260237+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 986, in invoke
2022-10-16T21:01:55.260237+00:00 app[worker.1]:     await injected(*ctx.args, **ctx.kwargs)  # type: ignore
2022-10-16T21:01:55.260238+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 199, in wrapped
2022-10-16T21:01:55.260238+00:00 app[worker.1]:     raise CommandInvokeError(exc) from exc
2022-10-16T21:01:55.260238+00:00 app[worker.1]: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'NoneType' object is not subscriptable
2022-10-16T21:01:55.260267+00:00 app[worker.1]: [2022-10-16 21:01:55] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command trade
2022-10-16T21:01:55.260267+00:00 app[worker.1]: Traceback (most recent call last):
2022-10-16T21:01:55.260267+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 190, in wrapped
2022-10-16T21:01:55.260267+00:00 app[worker.1]:     ret = await coro(*args, **kwargs)
2022-10-16T21:01:55.260267+00:00 app[worker.1]:   File "/app/harambot/cogs/yahoo.py", line 72, in trade
2022-10-16T21:01:55.260268+00:00 app[worker.1]:     api_details = self.yahoo_api.get_player_details(player['name'])["text"]+"\n"
2022-10-16T21:01:55.260268+00:00 app[worker.1]: TypeError: 'NoneType' object is not subscriptable
2022-10-16T21:01:55.260268+00:00 app[worker.1]: 
2022-10-16T21:01:55.260268+00:00 app[worker.1]: The above exception was the direct cause of the following exception:
2022-10-16T21:01:55.260268+00:00 app[worker.1]: 
2022-10-16T21:01:55.260268+00:00 app[worker.1]: Traceback (most recent call last):
2022-10-16T21:01:55.260268+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1347, in invoke
2022-10-16T21:01:55.260269+00:00 app[worker.1]:     await ctx.command.invoke(ctx)
2022-10-16T21:01:55.260269+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 986, in invoke
2022-10-16T21:01:55.260269+00:00 app[worker.1]:     await injected(*ctx.args, **ctx.kwargs)  # type: ignore
2022-10-16T21:01:55.260279+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.10/site-packages/discord/ext/commands/core.py", line 199, in wrapped
2022-10-16T21:01:55.260279+00:00 app[worker.1]:     raise CommandInvokeError(exc) from exc
2022-10-16T21:01:55.260279+00:00 app[worker.1]: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'NoneType' object is not subscriptable
@DMcP89 DMcP89 added the bug Something isn't working label Oct 16, 2022
@DMcP89 DMcP89 added this to the 0.3.0-Beta milestone Oct 16, 2022
@DMcP89 DMcP89 self-assigned this Oct 18, 2022
@DMcP89
Copy link
Owner Author

DMcP89 commented Oct 21, 2022

This shares the same root cause as #73, closing as duplicate

@DMcP89 DMcP89 closed this as completed Oct 21, 2022
@DMcP89 DMcP89 added the duplicate This issue or pull request already exists label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant