diff options
| author | 2020-05-30 10:49:38 +0200 | |
|---|---|---|
| committer | 2020-05-30 10:49:38 +0200 | |
| commit | 8562ed2feb6ef465b8b502c725566de4f0a06cbb (patch) | |
| tree | 6c01dc02aca840bc0ea4ad6f56f4a4c2ebd9fe27 | |
| parent | Prevent duplicates, and break into function. (diff) | |
Don't membership check in an itertools.chain.
We're using the set comprehension to prevent duplicates anyway, so
flipping these back makes more sense.
Also added a missing ctx and tested ok.
| -rw-r--r-- | bot/cogs/information.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/information.py b/bot/cogs/information.py index 9ebb89300..d3a2768d4 100644 --- a/bot/cogs/information.py +++ b/bot/cogs/information.py @@ -80,7 +80,7 @@ class Information(Cog): ]) # Now we need to check which channels are both denied for @everyone and permitted for staff - staff_channels = set(cid for cid in everyone_denied if cid in staff_allowed) + staff_channels = set(cid for cid in staff_allowed if cid in everyone_denied) return len(staff_channels) @with_role(*constants.MODERATION_ROLES) @@ -176,7 +176,7 @@ class Information(Cog): # How many staff members and staff channels do we have? staff_member_count = len(ctx.guild.get_role(constants.Roles.helpers).members) - staff_channel_count = self._get_staff_channel_count() + staff_channel_count = self._get_staff_channel_count(ctx) # Because channel_counts lacks leading whitespace, it breaks the dedent if it's inserted directly by the # f-string. While this is correctly formated by Discord, it makes unit testing difficult. To keep the formatting |