From 8e9c37b0925c385a80ca8821df6c2e3424e2cf79 Mon Sep 17 00:00:00 2001 From: Myned Date: Wed, 8 Nov 2017 23:48:12 -0500 Subject: [PATCH] Compressed temp blacklist creation --- src/main/cogs/booru.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index 75dd812..ba30ab2 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -568,12 +568,9 @@ class MsG: blacklist = set() # Creates temp blacklist based on context - for tag in self.blacklists['global_blacklist']: - blacklist.update(list(self.aliases[tag]) + [tag]) - for tag in self.blacklists['guild_blacklist'].get(guild.id, {}).get(ctx.channel.id, set()): - blacklist.update(list(self.aliases[tag]) + [tag]) - for tag in self.blacklists['user_blacklist'].get(ctx.author.id, set()): - blacklist.update(list(self.aliases[tag]) + [tag]) + for bl in (self.blacklists['global_blacklist'], self.blacklists['guild_blacklist'].get(guild.id, {}).get(ctx.channel.id, set()), self.blacklists['user_blacklist'].get(ctx.author.id, set())): + for tag in bl: + blacklist.update([tag] + list(self.aliases[tag])) # Checks for, assigns, and removes first order in tags if possible order = [tag for tag in tags if 'order:' in tag] if order: