From 785697f25aad8222c711bc52b40b3ce1a794148b Mon Sep 17 00:00:00 2001 From: wookie184 Date: Tue, 5 May 2026 00:14:13 +0200 Subject: [PATCH] Give core devs permissions to use doc commands When a documentation is broken, a sentry error is raised. It's easiest for core devs to be able to fix this directly rather than requesting a mod run a command. --- bot/exts/info/doc/_cog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 2b94b46692..4546fc14f3 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -13,7 +13,7 @@ from pydis_core.utils.scheduling import Scheduler from bot.bot import Bot -from bot.constants import MODERATION_ROLES, RedirectOutput +from bot.constants import MODERATION_ROLES, RedirectOutput, Roles from bot.converters import Inventory, PackageName, ValidURL from bot.log import get_logger from bot.pagination import LinePaginator @@ -349,7 +349,7 @@ def base_url_from_inventory_url(inventory_url: str) -> str: return inventory_url.removesuffix("/").rsplit("/", maxsplit=1)[0] + "/" @docs_group.command(name="setdoc", aliases=("s",)) - @commands.has_any_role(*MODERATION_ROLES) + @commands.has_any_role(*MODERATION_ROLES, Roles.core_developers) @lock(NAMESPACE, COMMAND_LOCK_SINGLETON, raise_error=True) async def set_command( self, @@ -397,7 +397,7 @@ async def set_command( await ctx.send(f"Added the package `{package_name}` to the database and updated the inventories.") @docs_group.command(name="deletedoc", aliases=("removedoc", "rm", "d")) - @commands.has_any_role(*MODERATION_ROLES) + @commands.has_any_role(*MODERATION_ROLES, Roles.core_developers) @lock(NAMESPACE, COMMAND_LOCK_SINGLETON, raise_error=True) async def delete_command(self, ctx: commands.Context, package_name: PackageName) -> None: """ @@ -414,7 +414,7 @@ async def delete_command(self, ctx: commands.Context, package_name: PackageName) await ctx.send(f"Successfully deleted `{package_name}` and refreshed the inventories.") @docs_group.command(name="refreshdoc", aliases=("rfsh", "r")) - @commands.has_any_role(*MODERATION_ROLES) + @commands.has_any_role(*MODERATION_ROLES, Roles.core_developers) @lock(NAMESPACE, COMMAND_LOCK_SINGLETON, raise_error=True) async def refresh_command(self, ctx: commands.Context) -> None: """Refresh inventories and show the difference.""" @@ -436,7 +436,7 @@ async def refresh_command(self, ctx: commands.Context) -> None: await ctx.send(embed=embed) @docs_group.command(name="cleardoccache", aliases=("deletedoccache",)) - @commands.has_any_role(*MODERATION_ROLES) + @commands.has_any_role(*MODERATION_ROLES, Roles.core_developers) async def clear_cache_command( self, ctx: commands.Context,