diff options
author | 2021-05-05 14:46:29 -0400 | |
---|---|---|
committer | 2021-05-05 14:46:29 -0400 | |
commit | 19e2efaf5572a0edb4595bead6877aaae078adae (patch) | |
tree | 9e4fce72e72c2fb1e1dc250bb88e786b7a107166 | |
parent | chore: Improve .space epic's docstring (diff) |
chore: Apply suggested changes
-rw-r--r-- | bot/exts/halloween/hacktober-issue-finder.py | 12 | ||||
-rw-r--r-- | bot/exts/halloween/hacktoberstats.py | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/bot/exts/halloween/hacktober-issue-finder.py b/bot/exts/halloween/hacktober-issue-finder.py index baee9612..20a06770 100644 --- a/bot/exts/halloween/hacktober-issue-finder.py +++ b/bot/exts/halloween/hacktober-issue-finder.py @@ -73,15 +73,17 @@ class HacktoberIssues(commands.Cog): log.debug(f"making api request to url: {url}") async with self.bot.http_session.get(url, headers=REQUEST_HEADERS) as response: if response.status != 200: - log.error(f"expected 200 status (got {response.status}) from the GitHub api.") - await ctx.send(f"ERROR: expected 200 status (got {response.status}) from the GitHub api.") - await ctx.send(await response.text()) + log.error(f"expected 200 status (got {response.status}) by the GitHub api.") + await ctx.send( + f"ERROR: expected 200 status (got {response.status}) by the GitHub api.\n" + f"{await response.text()}" + ) return None data = await response.json() if len(data["items"]) == 0: - log.error(f"no issues returned from GitHub api. with url: {response.url}") - await ctx.send(f"ERROR: no issues returned from GitHub api. with url: {response.url}") + log.error(f"no issues returned by GitHub API, with url: {response.url}") + await ctx.send(f"ERROR: no issues returned by GitHub API, with url: {response.url}") return None if option == "beginner": diff --git a/bot/exts/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py index 33e9ca31..b74e680b 100644 --- a/bot/exts/halloween/hacktoberstats.py +++ b/bot/exts/halloween/hacktoberstats.py @@ -302,8 +302,7 @@ class HacktoberStats(commands.Cog): async def _fetch_url(self, url: str, headers: dict) -> dict: """Retrieve API response from URL.""" async with self.bot.http_session.get(url, headers=headers) as resp: - jsonresp = await resp.json() - return jsonresp + return await resp.json() @staticmethod def _has_label(pr: dict, labels: Union[List[str], str]) -> bool: |