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

Error while issuing $trade #45

Closed
DMcP89 opened this issue Dec 1, 2021 · 0 comments · Fixed by #46
Closed

Error while issuing $trade #45

DMcP89 opened this issue Dec 1, 2021 · 0 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@DMcP89
Copy link
Owner

DMcP89 commented Dec 1, 2021

Describe the bug
calling $trade results in an error

To Reproduce
Steps to reproduce the behavior:

  1. issue $trade command

Expected behavior
Latest trade awaiting league approval is displayed

Additional context

[2021-11-30 23:51:21,270 INFO] [/home/dave/workspace/python/bots/harambot/harambot/cogs/yahoo.py.yahoo.trade] trade called
Error while fetching latest trade
Traceback (most recent call last):
  File "/home/dave/workspace/python/bots/harambot/harambot/yahoo_api.py", line 159, in get_latest_trade
    return accepted_trades[0]
IndexError: list index out of range
Ignoring exception in command trade:
Traceback (most recent call last):
  File "/home/dave/workspace/python/bots/harambot/.venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/dave/workspace/python/bots/harambot/harambot/cogs/yahoo.py", line 26, in setup
    await func(cog, ctx)
  File "/home/dave/workspace/python/bots/harambot/harambot/cogs/yahoo.py", line 72, in trade
    trader = teams[latest_trade['trader_team_key']]
TypeError: 'NoneType' object is not subscriptable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/dave/workspace/python/bots/harambot/.venv/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/dave/workspace/python/bots/harambot/.venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/dave/workspace/python/bots/harambot/.venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'NoneType' object is not subscriptable
DMcP89 pushed a commit that referenced this issue Dec 2, 2021
@DMcP89 DMcP89 closed this as completed in #46 Dec 2, 2021
@DMcP89 DMcP89 added the bug Something isn't working label Dec 2, 2021
DMcP89 pushed a commit that referenced this issue Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant