aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-10-02 17:15:10 +0100
committerGravatar GitHub <[email protected]>2022-10-02 17:15:10 +0100
commitfb3cae915eaebccf5424a33504a48f966809d42b (patch)
tree3dacae9666c448f5308fc3bc95e9bb90bbf14cd7
parentMerge pull request #1111 from python-discord/fix-GH-1108 (diff)
parentMerge branch 'main' into fix-issue-1107 (diff)
Merge pull request #1112 from python-discord/fix-issue-1107
-rw-r--r--bot/exts/events/hacktoberfest/hacktober-issue-finder.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/events/hacktoberfest/hacktober-issue-finder.py b/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
index 8be985f9..aeffc8d7 100644
--- a/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
+++ b/bot/exts/events/hacktoberfest/hacktober-issue-finder.py
@@ -100,8 +100,9 @@ class HacktoberIssues(commands.Cog):
"""Format the issue data into a embed."""
title = issue["title"]
issue_url = issue["url"].replace("api.", "").replace("/repos/", "/")
- # issues can have empty bodies, which in that case GitHub doesn't include the key in the API response
- body = issue.get("body", "")
+ # Issues can have empty bodies, resulting in the value being a literal `null` (parsed as `None`).
+ # For this reason, we can't use the default arg of `dict.get`, and so instead use `or` logic.
+ body = issue.get("body") or ""
labels = [label["name"] for label in issue["labels"]]
embed = discord.Embed(title=title)