Don't delete interaction of purge command

This commit is contained in:
Oliver Traber 2023-07-11 23:02:35 +02:00
parent fef3f84898
commit b864911744
Signed by: Bluemedia
GPG key ID: C0674B105057136C

2
bot.py
View file

@ -147,7 +147,7 @@ async def purge(interaction: discord.Interaction, days: int):
if days > 13: if days > 13:
await interaction.response.send_message(content='❌ Error: Due to technical limitations, 13 days is the maximum after which I can still delete messages. Please use `13` days or less.', delete_after=20) await interaction.response.send_message(content='❌ Error: Due to technical limitations, 13 days is the maximum after which I can still delete messages. Please use `13` days or less.', delete_after=20)
return return
await purge_messages(channel=interaction.channel, audit_message=f'Deleted via /purge command from user {interaction.user.name}', before=datetime.now(), after=(datetime.now() - timedelta(days=days))) await purge_messages(channel=interaction.channel, audit_message=f'Deleted via /purge command from user {interaction.user.name}', before=interaction.created_at, after=(datetime.now() - timedelta(days=days)))
await interaction.response.send_message(content='✅ Messages deleted.', delete_after=20) await interaction.response.send_message(content='✅ Messages deleted.', delete_after=20)