From 6eecd5c251da804b38e5521ebd562aa25e6bc61d Mon Sep 17 00:00:00 2001 From: aru Date: Wed, 13 Oct 2021 20:24:20 -0400 Subject: Fix GH-907 Issues can have empty bodies, in this case GitHub doesn't include the key in the API response --- bot/exts/events/hacktoberfest/hacktober-issue-finder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3