Make an HTTP request

        Args:
            path: the URI path (not including the base url, start with
                the first uri segment, like 'users/...')
            method: the HTTP method to use (GET, POST, PATCH, ...)
            data: the data to send as JSON data
            expected_status: expected HTTP status; other statuses
                received will raise an Exception

        Returns:
            Data from the endpoint's response

def _query(self, path: str, method: str, data: Dict[str, Any]=None, expected_status: int = 200) \
            -> Union[List[Dict[str, Any]], Dict[str, Any], None]:
        """Make an HTTP request

        Args:
            path: the URI path (not including the base url, start with
                the first uri segment, like 'users/...')
            method: the HTTP method to use (GET, POST, PATCH, ...)
            data: the data to send as JSON data
            expected_status: expected HTTP status; other statuses
                received will raise an Exception

        Returns:
            Data from the endpoint's response
        """
        url = Pycord.url_base + path
        self.logger.debug(f'Making {method} request to "{url}"')
        if method == 'GET':
            r = requests.get(url, headers=self._build_headers())
        elif method == 'POST':
            r = requests.post(url, headers=self._build_headers(), json=data)
            r = requests.get(url, headers=self._build_headers())
        elif method == 'PATCH':
            r = requests.patch(url, headers=self._build_headers(), json=data)
        else:
            raise ValueError(f'Unknown HTTP method {method}')
        self.logger.debug(f'{method} response from "{url}" was "{r.status_code}"')
        if r.status_code != expected_status:
            raise ValueError(f'Non-{expected_status} {method} response from Discord API ({r.status_code}): {r.text}')
        if expected_status == 200:
            return r.json()
        return None