mirror of
https://github.com/BluemediaGER/discord-cleanup-bot.git
synced 2024-11-23 00:05:29 +01:00
Respond to purge command before delete
This commit is contained in:
parent
b864911744
commit
d553237989
2
bot.py
2
bot.py
|
@ -147,8 +147,8 @@ 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 interaction.response.send_message(content='✅ Messages will be deleted shortly.', delete_after=20)
|
||||||
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 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)
|
|
||||||
|
|
||||||
|
|
||||||
client.activity = Game(name="with the broomstick")
|
client.activity = Game(name="with the broomstick")
|
||||||
|
|
Loading…
Reference in a new issue