From 6363f5eadc833a4a442fff2572d7c4e97bf14a2d Mon Sep 17 00:00:00 2001 From: Obi-Wan3 <44986166+Obi-Wan3@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:15:25 -0800 Subject: [PATCH 1/3] [StealEmoji] update to use guild.emoji_limit --- stealemoji/stealemoji.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stealemoji/stealemoji.py b/stealemoji/stealemoji.py index a492527..5d3701f 100644 --- a/stealemoji/stealemoji.py +++ b/stealemoji/stealemoji.py @@ -16,16 +16,16 @@ log = logging.getLogger("red.fox_v3.stealemoji") async def check_guild(guild, emoji): - if len(guild.emojis) >= 100: + if len(guild.emojis) >= 2*guild.emoji_limit: return False if len(guild.emojis) < 50: return True if emoji.animated: - return sum(e.animated for e in guild.emojis) < 50 + return sum(e.animated for e in guild.emojis) < guild.emoji_limit else: - return sum(not e.animated for e in guild.emojis) < 50 + return sum(not e.animated for e in guild.emojis) < guild.emoji_limit class StealEmoji(Cog): From 7ad6b156419c147b2e7db692dfc796c90add0320 Mon Sep 17 00:00:00 2001 From: Obi-Wan3 <44986166+Obi-Wan3@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:19:41 -0800 Subject: [PATCH 2/3] Edit to satisfy style requirement --- stealemoji/stealemoji.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stealemoji/stealemoji.py b/stealemoji/stealemoji.py index 5d3701f..de65728 100644 --- a/stealemoji/stealemoji.py +++ b/stealemoji/stealemoji.py @@ -16,7 +16,7 @@ log = logging.getLogger("red.fox_v3.stealemoji") async def check_guild(guild, emoji): - if len(guild.emojis) >= 2*guild.emoji_limit: + if len(guild.emojis) >= 2 * guild.emoji_limit: return False if len(guild.emojis) < 50: From 92957bcb1f87957e2454350d5a1ce85922d37f57 Mon Sep 17 00:00:00 2001 From: Obi-Wan3 <44986166+Obi-Wan3@users.noreply.github.com> Date: Thu, 18 Feb 2021 10:08:24 -0800 Subject: [PATCH 3/3] implement same logic for skipping further checks Co-authored-by: bobloy --- stealemoji/stealemoji.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stealemoji/stealemoji.py b/stealemoji/stealemoji.py index de65728..8f32d74 100644 --- a/stealemoji/stealemoji.py +++ b/stealemoji/stealemoji.py @@ -19,7 +19,7 @@ async def check_guild(guild, emoji): if len(guild.emojis) >= 2 * guild.emoji_limit: return False - if len(guild.emojis) < 50: + if len(guild.emojis) < guild.emoji_limit: return True if emoji.animated: