aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar aru <[email protected]>2021-10-13 20:24:20 -0400
committerGravatar GitHub <[email protected]>2021-10-13 20:24:20 -0400
commit6eecd5c251da804b38e5521ebd562aa25e6bc61d (patch)
treef9ac0af596d065b15980d27167a8d061d7e48ff9
parentChallenges (#860) (diff)
Fix GH-907
Issues can have empty bodies, in this case GitHub doesn't include the key in the API response
-rw-r--r--bot/exts/events/hacktoberfest/hacktober-issue-finder.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/events/hacktoberfest/hacktober-issue-finder.py b/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
index 088e7e43..1774564b 100644
--- a/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
+++ b/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
@@ -100,7 +100,8 @@ class HacktoberIssues(commands.Cog):
"""Format the issue data into a embed."""
title = issue["title"]
issue_url = issue["url"].replace("api.", "").replace("/repos/", "/")
- body = issue["body"]
+ # issues can have empty bodies, which in that case GitHub doesn't include the key in the API response
+ body = issue.get("body", "")
labels = [label["name"] for label in issue["labels"]]
embed = discord.Embed(title=title)