Valorina icon indicating copy to clipboard operation
Valorina copied to clipboard

[FEATURE] Night Market

Open SavvyxArhum opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

SavvyxArhum avatar Dec 05 '21 19:12 SavvyxArhum

👋 Thanks for reporting!

github-actions[bot] avatar Dec 05 '21 19:12 github-actions[bot]

For people willing to work on the Issue, Riot sends the night market as an additional item to the object present here called "BonusStore", make sure to style the embed similar to the current +store embed, create a new additional command called +nightmarket in here , create an additional function for nightmarket in getSkinOffers.py

async def getStore(headers, user_id, region, nightMarket=False):
    session = aiohttp.ClientSession()
    try:
        async with session.get(f'https://pd.{region}.a.pvp.net/store/v2/storefront/{user_id}', headers=headers) as r:
            data = json.loads(await r.text())
    except Exception as e:
        print(e)
    finally:
        await session.close()
    if nightMarket:
        if 'BonusStore' not in data:
            return 404 # if "BonusStore" is not present in the object send a different response letting people know nightmarket is not enabled
        nightMarketPanel = data['BonusStore']
        return await getNightMarket(headers, nightMarketPanel, region)
    if 'SkinsPanelLayout' not in data:
        return
    skinPanel = data['SkinsPanelLayout']
    return await getSkinDetails(headers, skinPanel, region)

sanjaybaskaran01 avatar Feb 10 '22 11:02 sanjaybaskaran01