From d2b0817d26d4c41afe6bee9117a287cfbb1d66e9 Mon Sep 17 00:00:00 2001 From: BluemediaGER Date: Tue, 11 Jul 2023 23:13:04 +0200 Subject: [PATCH] Write log on purge command --- bot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot.py b/bot.py index e1165ce..e1a4806 100644 --- a/bot.py +++ b/bot.py @@ -147,6 +147,7 @@ async def purge(interaction: discord.Interaction, days: int): 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) return + logger.info(f"Purging messages of the last {days} days from channel {interaction.channel_id} ({interaction.channel.name}) in guild {interaction.guild_id} ({interaction.guild.name}) at request of {interaction.user.name}.") 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)))