CLAUDE: Fix double emoji issue in Discord embeds

Fixed 13 instances where EmbedTemplate methods were receiving titles
with emojis, resulting in double emojis (e.g., "  Command Created").

Changes:
- tasks/custom_command_cleanup.py: Removed emojis from warning/error titles (2 fixes)
- views/help_commands.py: Removed emoji from success title (1 fix)
- views/custom_commands.py: Removed emojis from titles or switched to
  create_base_embed() for custom emojis (10 fixes)

The following template methods auto-add emoji prefixes:
- EmbedTemplate.success() → adds 
- EmbedTemplate.error() → adds 
- EmbedTemplate.warning() → adds ⚠️
- EmbedTemplate.info() → adds ℹ️
- EmbedTemplate.loading() → adds 

For custom emojis, use EmbedTemplate.create_base_embed() with explicit
color parameter.

All 69 related tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-10-16 23:09:21 -05:00
parent 3aa95ef98c
commit e689aadbd8
3 changed files with 17 additions and 15 deletions

View File

@ -233,7 +233,7 @@ class CustomCommandCleanupTask:
plural = len(commands) > 1
embed = EmbedTemplate.warning(
title="⚠️ Custom Command Cleanup Warning",
title="Custom Command Cleanup Warning",
description=f"The following custom command{'s' if plural else ''} will be deleted in 30 days if not used:"
)
@ -273,7 +273,7 @@ class CustomCommandCleanupTask:
plural = len(commands) > 1
embed = EmbedTemplate.error(
title="🗑️ Custom Commands Deleted",
title="Custom Commands Deleted",
description=f"The following custom command{'s' if plural else ''} {'have' if plural else 'has'} been automatically deleted due to inactivity:"
)

View File

@ -119,18 +119,18 @@ class CustomCommandCreateConfirmationView(BaseView):
)
embed = EmbedTemplate.success(
title="Command Created",
title="Command Created",
description=f"The command `/cc {self.command_data['name']}` has been created successfully!"
)
except BotException as e:
embed = EmbedTemplate.error(
title="Creation Failed",
title="Creation Failed",
description=f"Failed to create command: {str(e)}"
)
except Exception as e:
embed = EmbedTemplate.error(
title="Unexpected Error",
title="Unexpected Error",
description="An unexpected error occurred while creating the command."
)
@ -268,18 +268,18 @@ class CustomCommandEditConfirmationView(BaseView):
)
embed = EmbedTemplate.success(
title="Command Updated",
title="Command Updated",
description=f"The command `/cc {self.edit_data['name']}` has been updated successfully!"
)
except BotException as e:
embed = EmbedTemplate.error(
title="Update Failed",
title="Update Failed",
description=f"Failed to update command: {str(e)}"
)
except Exception as e:
embed = EmbedTemplate.error(
title="Unexpected Error",
title="Unexpected Error",
description="An unexpected error occurred while updating the command."
)
@ -571,7 +571,7 @@ class SingleCommandManagementView(BaseView):
async def delete_command(self, interaction: discord.Interaction, button: discord.ui.Button):
"""Delete the command with confirmation."""
embed = EmbedTemplate.warning(
title="⚠️ Delete Command",
title="Delete Command",
description=f"Are you sure you want to delete `/cc {self.command.name}`?"
)
@ -594,7 +594,7 @@ class SingleCommandManagementView(BaseView):
if confirmation_view.result:
# User confirmed deletion
embed = EmbedTemplate.success(
title="Command Deleted",
title="Command Deleted",
description=f"The command `/cc {self.command.name}` has been deleted."
)
await interaction.edit_original_response(embed=embed, view=None)
@ -632,9 +632,10 @@ class CustomCommandListView(PaginationView):
def _create_embeds_from_search_result(self, search_result: CustomCommandSearchResult) -> List[discord.Embed]:
"""Create embeds from search result."""
if not search_result.commands:
embed = EmbedTemplate.info(
embed = EmbedTemplate.create_base_embed(
title="🔍 Custom Commands",
description="No custom commands found matching your criteria."
description="No custom commands found matching your criteria.",
color=EmbedColors.INFO
)
return [embed]
@ -725,9 +726,10 @@ class CustomCommandSearchModal(BaseModal):
self.is_submitted = True
# Show confirmation
embed = EmbedTemplate.info(
embed = EmbedTemplate.create_base_embed(
title="🔍 Search Submitted",
description="Searching for custom commands..."
description="Searching for custom commands...",
color=EmbedColors.INFO
)
criteria = []

View File

@ -211,7 +211,7 @@ class HelpCommandDeleteConfirmView(BaseView):
self.result = True
embed = EmbedTemplate.success(
title="Help Topic Deleted",
title="Help Topic Deleted",
description=f"The help topic `/help {self.help_command.name}` has been deleted (soft delete)."
)