diff --git a/app/modules/msc_getter.py b/app/modules/msc_getter.py index faa1915..6bbd2d3 100644 --- a/app/modules/msc_getter.py +++ b/app/modules/msc_getter.py @@ -67,19 +67,16 @@ class MSCGetter(niobot.Module): found.append(data) if len(found) < 10 or force_fetch: - def get_first_page() -> list[dict]: - paginated_list: PaginatedList = self.gh.search_issues( - "presence", - **{ - "is": "pull-request", - "repo": "matrix-org/matrix-spec-proposals" - } - ) - page: list[Issue] = paginated_list.get_page(0) - return [x.raw_data for x in page] - try: - issues = await asyncio.to_thread(get_first_page) + async with httpx.AsyncClient() as client: + response = await client.get( + "https://api.github.com/search/issues", + params={ + "q": "%s+is:pull-request+repo:matrix.org/matrix-spec-proposals" % query + } + ) + response.raise_for_status() + issues = response.json()["items"] except Exception: return [ {