diff --git a/cogs/draw_image_generation.py b/cogs/draw_image_generation.py index 96e591d..2c39c3a 100644 --- a/cogs/draw_image_generation.py +++ b/cogs/draw_image_generation.py @@ -153,7 +153,7 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"): await ctx.respond("Something went wrong. Please try again later.") await ctx.send_followup(e) - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="local-size", description="Get the size of the dall-e images folder that we have on the current system", @@ -163,7 +163,6 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"): async def local_size(self, ctx: discord.ApplicationContext): await ctx.defer() # Get the size of the dall-e images folder that we have on the current system. - # Check if admin user image_path = self.model.IMAGE_SAVE_PATH total_size = 0 @@ -176,7 +175,7 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"): total_size = total_size / 1000000 await ctx.respond(f"The size of the local images folder is {total_size} MB.") - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="clear-local", description="Clear the local dalleimages folder on system.", diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index e1c4124..6de33d6 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -95,11 +95,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.conversation_threads = {} # Create slash command groups - admin = discord.SlashCommandGroup(name="admin", - description="Admin settings for the bot", - guild_ids=ALLOWED_GUILDS, - checks=[Check.check_admin_roles()] - ) dalle = discord.SlashCommandGroup(name="dalle", description="Dalle related commands", guild_ids=ALLOWED_GUILDS, @@ -110,6 +105,11 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): guild_ids=ALLOWED_GUILDS, checks=[Check.check_gpt_roles()] ) + system = discord.SlashCommandGroup(name="system", + description="Admin/System settings for the bot", + guild_ids=ALLOWED_GUILDS, + checks=[Check.check_admin_roles()] + ) @discord.Cog.listener() async def on_member_remove(self, member): @@ -131,7 +131,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): ) print(f"The debug channel was acquired and commands registered") - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="set-usage", description="Set the current OpenAI usage (in dollars)", @@ -154,7 +154,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await ctx.respond("The usage value must be a valid float.") return - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="delete-conversation-threads", description="Delete all conversation threads across the bot servers.", @@ -821,7 +821,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await ctx.defer() await self.send_help_text(ctx) - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="usage", description="Get usage statistics for GPT3Discord", @@ -832,7 +832,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await ctx.defer() await self.send_usage_text(ctx) - @add_to_group("admin") + @add_to_group("system") @discord.slash_command( name="settings", description="Get settings for GPT3Discord", diff --git a/models/check_model.py b/models/check_model.py index c2dcde5..2a3e593 100644 --- a/models/check_model.py +++ b/models/check_model.py @@ -15,7 +15,7 @@ class Check: if not any(role.name.lower() in ADMIN_ROLES for role in ctx.user.roles): await ctx.defer(ephemeral=True) await ctx.respond( - "You don't have admin permission to use this.", + f"You don't have permission to use this.", ephemeral=True, delete_after=10, ) @@ -28,7 +28,7 @@ class Check: if not any(role.name.lower() in DALLE_ROLES for role in ctx.user.roles): await ctx.defer(ephemeral=True) await ctx.respond( - "You don't have dalle permission to use this.", + "You don't have permission to use this.", ephemeral=True, delete_after=10, ) @@ -41,7 +41,7 @@ class Check: if not any(role.name.lower() in GPT_ROLES for role in ctx.user.roles): await ctx.defer(ephemeral=True) await ctx.respond( - "You don't have gpt permission to use this.", + "You don't have permission to use this.", ephemeral=True, delete_after=10, )