Maselkov / Maselkov-Cogs

Collection of cogs for Red-Discordbot
MIT License
2 stars 3 forks source link

[GW2] TP Listing Problem #32

Closed sfalexw closed 7 years ago

sfalexw commented 7 years ago

Recently notice a problem under the tp listing function. Redbot will throw an IndexError when you mass buying/selling the same item for more than a stack or at different price.

Exception in command 'tp current'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/pi/red-discordbot/cogs/guildwars2.py", line 1367, in current
    item_name = itemlist[counter]["name"]
IndexError: list index out of range

Probably due to the fact that items API and commerce/listings API will not reply duplicated information from the same item id. See example here and here.

sfalexw commented 7 years ago

I am currently working on a fix, and I should be able to finish it today.

Maselkov commented 7 years ago

33