From bb5aab16c97e0d439b046bd47d8cbaf0da5ff599 Mon Sep 17 00:00:00 2001 From: Toby Harradine Date: Mon, 25 Feb 2019 10:19:00 +1100 Subject: [PATCH] [Permissions] Exclude `@everyone` role when retrieving rules (#2484) Signed-off-by: Toby Harradine --- redbot/core/commands/requires.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redbot/core/commands/requires.py b/redbot/core/commands/requires.py index 08b482b6c..d2798ccee 100644 --- a/redbot/core/commands/requires.py +++ b/redbot/core/commands/requires.py @@ -531,7 +531,10 @@ class Requires: if category is not None: channels.append(category) - model_chain = [author, *channels, *author.roles, guild] + # We want author roles sorted highest to lowest, and exclude the @everyone role + author_roles = reversed(author.roles[1:]) + + model_chain = [author, *channels, *author_roles, guild] for rules in rules_chain: for model in model_chain: