Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions party/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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