<reponame>SomePr0grammer/aHypixel<gh_stars>0
from ..errors import APIError
import aiohttp


class Bazaar:
    """
    A class to get the Bazaar items

    Methods
        ʟ bazaar: Get the Bazaar items and their prices

    Attributes
        ʟ link: str
    """
    def __init__(self, session: aiohttp.ClientSession):
        self.session = session

    async def bazaar(self):
        async with self.session.get(
            url="https://api.hypixel.net/skyblock/bazaar",
        ) as data:
            jsondata = await data.json()
            if jsondata['success']:
                return jsondata
            else:
                cause = jsondata['cause']
                raise APIError(
                    f'{data.status} Error: {cause}'
                )

from ..errors import APIError
import aiohttp


class Bazaar:
    """
    A class to get the Bazaar items

    Methods
        ʟ bazaar: Get the Bazaar items and their prices

    Attributes
        ʟ link: str
    """
    def __init__(self, session: aiohttp.ClientSession):
        self.session = session

    async def bazaar(self):
        async with self.session.get(
            url="https://api.hypixel.net/skyblock/bazaar",
        ) as data:
            jsondata = await data.json()
            if jsondata['success']:
                return jsondata
            else:
                cause = jsondata['cause']
                raise APIError(
                    f'{data.status} Error: {cause}'
                )
A class to get the Bazaar items
 
     Methods
         ʟ bazaar: Get the Bazaar items and their prices
 
     Attributes
         ʟ link: str