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

i cannot get the shop? #159

Open
PirxcyFinal opened this issue Nov 9, 2021 · 0 comments
Open

i cannot get the shop? #159

PirxcyFinal opened this issue Nov 9, 2021 · 0 comments

Comments

@PirxcyFinal
Copy link

PirxcyFinal commented Nov 9, 2021

Task exception was never retrieved
future: <Task finished name='Task-139' coro=<event_ready() done, defined at main.py:21> exception=IndexError('list index out of range')>
Traceback (most recent call last):
  File "main.py", line 23, in event_ready
    shop = await get_current_item_shop_cids()
  File "main.py", line 11, in get_current_item_shop_cids
    store = await client.fetch_item_shop()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fortnitepy/client.py", line 3291, in fetch_item_shop
    return Store(self, data)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fortnitepy/store.py", line 232, in __init__
    self._featured_items = self._create_featured_items(
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fortnitepy/store.py", line 318, in _create_featured_items
    res.append(FeaturedStoreItem(item))
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fortnitepy/store.py", line 193, in __init__
    super().__init__(data)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fortnitepy/store.py", line 53, in __init__
    self._price = data['prices'][0]['finalPrice']
IndexError: list index out of range

i get this error when running the code

import fortnitepy

client = fortnitepy.Client(
  auth=fortnitepy.AuthorizationCodeAuth(
    code=input('codeL: ')
  )
)


async def get_current_item_shop_cids():
  store = await client.fetch_item_shop()

  cids = []
  for item in store.featured_items + store.daily_items:
      for grant in item.grants:
          if grant['type'] == 'AthenaCharacter':
              cids.append(grant['asset'])

  return cids

@client.event
async def event_ready():
  shop = await get_current_item_shop_cids()
  print(shop)

client.run()
``` please fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant