From 27b3255374309bc965cee331540ecc46dc42d666 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Wed, 10 Jan 2024 10:14:45 +0000 Subject: [PATCH] Fix message delete params --- src/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.py b/src/main.py index 5b34c94..b585faf 100644 --- a/src/main.py +++ b/src/main.py @@ -119,17 +119,17 @@ async def on_application_command_completion(ctx: discord.ApplicationContext): @bot.message_command(name="Delete Message") -async def delete_message(ctx: discord.ApplicationContext): +async def delete_message(ctx: discord.ApplicationContext, message: discord.Message): await ctx.defer() if not ctx.channel.permissions_for(ctx.me).manage_messages: - if ctx.message.author != bot.user: + if message.author != bot.user: return await ctx.respond("I don't have permission to delete messages in this channel.", delete_after=30) log.info( - "%s deleted message %s>%s: %r", ctx.author, ctx.channel.name, ctx.message.id, ctx.message.content + "%s deleted message %s>%s: %r", ctx.author, ctx.channel.name, ctx.message.id, message.content ) - await ctx.message.delete(delay=3) - await ctx.respond(f"\N{white heavy check mark} Deleted message by {ctx.message.author.display_name}.") + await message.delete(delay=3) + await ctx.respond(f"\N{white heavy check mark} Deleted message by {message.author.display_name}.") await ctx.delete(delay=15)