@tree.command(guild=discord.Object(id=guild_id), name='disable', description='Disable a specified Command') async def disable(interaction: discord.Interaction, command: str): await interaction.response.defer() if tree.get_command(command, guild=discord.Object(id=guild_id)): # check if the command exists tree.remove_command(command, guild=discord.Object(id=guild_id)) # remove the command print("command removed!") await tree.sync(guild=discord.Object(id=guild_id)) # sync the tree print("tree synced!") await interaction.followup.send( f"{command} was disabled. You can reenable it by running /enable {command}") else: await interaction.followup.send(f"Command could not be found: {command}")@tree.command(guild=discord.Object(id=1044711937956651089), name='disable', description='Disable a specified Command') async def disable(interaction: discord.Interaction, command: str): await interaction.response.defer() if tree.get_command(command, guild=discord.Object(id=1044711937956651089)): # check if the command exists tree.remove_command(command, guild=discord.Object(id=1044711937956651089)) # remove the command print("command removed!") await tree.sync(guild=discord.Object(id=1044711937956651089)) # sync the tree print("tree synced!") await interaction.followup.send( f"{command} was disabled. You can reenable it by running /enable {command}") else: await interaction.followup.send(f"Command could not be found: {command}")