From 5d3068ebc9bf8772aa7148598bbcdba9317102a5 Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 5 May 2024 21:16:48 -0400 Subject: [PATCH] Fixed an error --- nessa/nessa.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nessa/nessa.py b/nessa/nessa.py index 9999852..c2d3fb1 100644 --- a/nessa/nessa.py +++ b/nessa/nessa.py @@ -23,9 +23,9 @@ class Nessa(discord.Client): self.tree.copy_global_to(guild=discord.Object(id=GUILD_ID)) await self.tree.sync(guild=discord.Object(id=GUILD_ID)) - def is_owner_or_admin(interaction: discord.Interaction): - """Check if the user is the bot owner or an administrator in the guild.""" - return interaction.user.id == OWNER_ID or interaction.user.guild_permissions.administrator + def is_owner_or_admin(interaction: discord.Interaction): + """Check if the user is the bot owner or an administrator in the guild.""" + return interaction.user.id == OWNER_ID or interaction.user.guild_permissions.administrator @self.tree.command(name="shutdown", description="Shut down Nessa", guild=discord.Object(id=GUILD_ID)) async def shutdown(interaction: discord.Interaction): @@ -52,7 +52,7 @@ class Nessa(discord.Client): await interaction.response.send_message("I've passed on your issue to the Chief!", ephemeral=True) @self.tree.command(name="sync_commands", description="Force sync commands in a specific guild.") - @self.app_commands.check(is_owner_or_admin) # or @discord.app_commands.checks.is_owner() + @app_commands.check(is_owner_or_admin) # or @discord.app_commands.checks.is_owner() async def sync_commands(interaction: discord.Interaction, guild_id: int): if interaction.user.id == OWNER_ID: guild = self.get_guild(guild_id)