aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2025-07-10 14:16:32 +0100
committerGravatar Joe Banks <[email protected]>2025-07-10 14:17:07 +0100
commit2ed8805539da3d91935b4685955d4eb989afaff8 (patch)
tree00f9d1b00f877cc3bf62a39224e46c42f0a853a2
parentAdd new GitHub extension (diff)
Add exemption for new cog to _is_devops
-rw-r--r--arthur/bot.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/arthur/bot.py b/arthur/bot.py
index 86db7f2..c9b572b 100644
--- a/arthur/bot.py
+++ b/arthur/bot.py
@@ -24,7 +24,7 @@ class KingArthur(BotBase):
super().__init__(*args, **kwargs)
self.add_check(self._is_devops)
- async def _is_devops(self, ctx: commands.Context | Interaction) -> bool:
+ async def _is_devops(self, ctx: commands.Context | Interaction) -> bool: # noqa: PLR0911
"""Check all commands are executed by authorised personnel."""
u = ctx.user if isinstance(ctx, Interaction) else ctx.author
if await arthur.instance.is_owner(u):
@@ -38,6 +38,10 @@ class KingArthur(BotBase):
if ctx.command.name in {"ed", "rules", "monitor"}:
return True
+ if ctx.command.cog_name == "GitHubManagement":
+ # Commands in this cog have explicit additional checks.
+ return True
+
if not ctx.guild:
return False