aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/halloween/hacktober-issue-finder.py12
-rw-r--r--bot/exts/halloween/hacktoberstats.py3
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: