From b8ada89bd45e6b8efd17fba79e70ce91a59b24fc Mon Sep 17 00:00:00 2001 From: kwzrd Date: Sat, 20 Jun 2020 12:42:53 +0200 Subject: Incidents: simplify set operation in `has_signals` Using `issubset` is a much simpler & more readable way of expressing the relationship between the two sets. Suggested by Mark during review. Co-authored-by: MarkKoz --- bot/cogs/moderation/incidents.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py index 4e6743224..089a5bc9f 100644 --- a/bot/cogs/moderation/incidents.py +++ b/bot/cogs/moderation/incidents.py @@ -56,8 +56,7 @@ def own_reactions(message: discord.Message) -> t.Set[str]: def has_signals(message: discord.Message) -> bool: """True if `message` already has all `Signal` reactions, False otherwise.""" - missing_signals = ALLOWED_EMOJI - own_reactions(message) # In `ALLOWED_EMOJI` but not in `own_reactions(message)` - return not missing_signals + return ALLOWED_EMOJI.issubset(own_reactions(message)) async def add_signals(incident: discord.Message) -> None: -- cgit v1.2.3