diff options
author | 2021-10-09 21:20:46 +0100 | |
---|---|---|
committer | 2021-10-11 15:00:50 +0100 | |
commit | e2da188b554aba07b6c5a7a25b8af0baa74973cb (patch) | |
tree | 48a7b271cb03ebc102e9507f3d95d274e1f97774 /bot/exts/fun/trivia_quiz.py | |
parent | Rename `Roles.owner` to `Roles.owners` (diff) |
Check role id in MODERATION_ROLES instead of comparing to moderation_team and safeguard `.roles` attribute
Diffstat (limited to 'bot/exts/fun/trivia_quiz.py')
-rw-r--r-- | bot/exts/fun/trivia_quiz.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/fun/trivia_quiz.py b/bot/exts/fun/trivia_quiz.py index 60afbb06..4a1cec5b 100644 --- a/bot/exts/fun/trivia_quiz.py +++ b/bot/exts/fun/trivia_quiz.py @@ -16,7 +16,7 @@ from discord.ext import commands, tasks from rapidfuzz import fuzz from bot.bot import Bot -from bot.constants import Client, Colours, NEGATIVE_REPLIES, Roles +from bot.constants import Client, Colours, MODERATION_ROLES, NEGATIVE_REPLIES logger = logging.getLogger(__name__) @@ -550,7 +550,7 @@ class TriviaQuiz(commands.Cog): if self.game_status[ctx.channel.id]: # Check if the author is the game starter or a moderator. if ctx.author == self.game_owners[ctx.channel.id] or any( - Roles.moderation_team == role.id for role in ctx.author.roles + role.id in MODERATION_ROLES for role in getattr(ctx.author, 'roles', []) ): self.game_status[ctx.channel.id] = False del self.game_owners[ctx.channel.id] |