diff options
| author | 2020-06-20 12:42:53 +0200 | |
|---|---|---|
| committer | 2020-06-20 12:44:29 +0200 | |
| commit | b8ada89bd45e6b8efd17fba79e70ce91a59b24fc (patch) | |
| tree | 805bc8d6f0bc2d16955ae8902c3315d4c1085267 | |
| parent | Incidents: make crawl limit & sleep module-level constants (diff) | |
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 <[email protected]>
| -rw-r--r-- | bot/cogs/moderation/incidents.py | 3 |
1 files changed, 1 insertions, 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: |