aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-01-12 16:39:00 +0000
committerGravatar GitHub <[email protected]>2022-01-12 16:39:00 +0000
commit69837a224c52fd690ca53211b971570f25738c5b (patch)
tree20ddda576ccb67dfd7afd057aee9913a6c03d07a
parentMerge pull request #1008 from python-discord/fix-aoc-join-logic (diff)
parentFix AoC name lookup for anon users (diff)
Merge pull request #1011 from python-discord/fix-aoc-name-lookup
-rw-r--r--bot/exts/events/advent_of_code/_cog.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py
index 01161f26..3acfef39 100644
--- a/bot/exts/events/advent_of_code/_cog.py
+++ b/bot/exts/events/advent_of_code/_cog.py
@@ -96,7 +96,9 @@ class AdventOfCode(commands.Cog):
# Only give the role to people who have completed all 50 stars
continue
- member_id = aoc_name_to_member_id.get(member_aoc_info["name"], None)
+ aoc_name = member_aoc_info["name"] or f"Anonymous #{member_aoc_info['id']}"
+
+ member_id = aoc_name_to_member_id.get(aoc_name)
if not member_id:
log.debug(f"Could not find member_id for {member_aoc_info['name']}, not giving role.")
continue