From 6e4e613c70c92dcafe27b31ea0c85a1fd413c67e Mon Sep 17 00:00:00 2001 From: Haku Date: Mon, 3 May 2021 11:58:35 -0400 Subject: [PATCH] something --- founderlessnotify/founderlessnotify.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/founderlessnotify/founderlessnotify.py b/founderlessnotify/founderlessnotify.py index 7e5ca86..7831e30 100644 --- a/founderlessnotify/founderlessnotify.py +++ b/founderlessnotify/founderlessnotify.py @@ -99,18 +99,23 @@ class FounderlessNotify(commands.Cog): new_founderless_regions = get_founderless_regions() previous_founderless_regions = await self.config.previous_founderless() # A region is now founderless if it is in the current list, but wasn't in the previous list - now_founderless = [region for region in new_founderless_regions if (region not in previous_founderless_regions)] + now_founderless = list() + for region in new_founderless_regions: + if region in previous_founderless_regions: + continue + now_founderless.append(region) + print(now_founderless) # Get the region endos for both lists now_founderless_endos = get_region_endos(now_founderless) # Create an ordered set with each region's name and delegate endorsement level - out = [] + out = list() for region in now_founderless: try: region_endos = now_founderless_endos[region] except KeyError: region_endos = -1 out.append((region_endos, region)) - print(out) + print(now_founderless_endos["the_north_pacific"]) # Sort the output by delegate endos in descending order out.sort() out.reverse() @@ -181,7 +186,7 @@ class FounderlessNotify(commands.Cog): @checks.is_owner() async def clear_founderless(self, ctx): """Clear the cached founderless regions.""" - await self.config.previous_founderless.clear() + await self.config.previous_founderless.set([]) await ctx.send("Cleared cached founderless regions.") @commands.command()