diff --git a/party/party.py b/party/party.py index 0506132..2c694c5 100644 --- a/party/party.py +++ b/party/party.py @@ -1414,15 +1414,12 @@ async def modal_button_callback(interaction: discord.Interaction): await ctx.send(f"✅ Party created! ID: `{party_id}`", delete_after=10) - # Delete the original command message - try: - await ctx.message.delete() - except discord.NotFound: - # Message already deleted - pass - except discord.Forbidden: - # Bot doesn't have permission to delete messages - pass + # Delete the original command message (not applicable for slash commands) + if not ctx.interaction: + try: + await ctx.message.delete() + except (discord.NotFound, discord.Forbidden): + pass @party.command(name="delete") async def party_delete(self, ctx, *, party_identifier: str): @@ -2011,8 +2008,9 @@ async def party_template_use(self, ctx, template_name: str, *, title: str): delete_after=10 ) - # Delete the original command message - try: - await ctx.message.delete() - except (discord.NotFound, discord.Forbidden): - pass + # Delete the original command message (not applicable for slash commands) + if not ctx.interaction: + try: + await ctx.message.delete() + except (discord.NotFound, discord.Forbidden): + pass