Fix custom command delete not actually deleting from database
The delete confirmation was showing success but never calling the delete service. Added the actual delete_command() call when user confirms. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
484042e8ae
commit
2ab82aa2bf
@ -592,11 +592,21 @@ class SingleCommandManagementView(BaseView):
|
||||
await confirmation_view.wait()
|
||||
|
||||
if confirmation_view.result:
|
||||
# User confirmed deletion
|
||||
embed = EmbedTemplate.success(
|
||||
title="Command Deleted",
|
||||
description=f"The command `/cc {self.command.name}` has been deleted."
|
||||
)
|
||||
# User confirmed deletion - actually delete the command
|
||||
try:
|
||||
await custom_commands_service.delete_command(
|
||||
name=self.command.name,
|
||||
deleter_discord_id=interaction.user.id
|
||||
)
|
||||
embed = EmbedTemplate.success(
|
||||
title="Command Deleted",
|
||||
description=f"The command `/cc {self.command.name}` has been deleted."
|
||||
)
|
||||
except Exception as e:
|
||||
embed = EmbedTemplate.error(
|
||||
title="Delete Failed",
|
||||
description=f"Failed to delete command: {e}"
|
||||
)
|
||||
await interaction.edit_original_response(embed=embed, view=None)
|
||||
else:
|
||||
# User cancelled
|
||||
|
||||
Loading…
Reference in New Issue
Block a user