A little cleanup and changed the "admin" slash group to "system"

So that it's hidden further down on the list
Rene Teigen 2 years ago
parent e5eeb035c1
commit b48c68e868

@ -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.",

@ -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",

@ -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,
)

Loading…
Cancel
Save