discord.py on_message_delete TypeError: on_message_delete() missing 1 required positional argument: 'message'

Question:

This command not work, error: TypeError: on_message_delete() missing 1 required positional argument: ‘message’

@client.event
async def on_message_delete(ctx,message):
   with open('log.json', 'r', encoding='utf-8') as f:
       guilds_dict = json.load(f)
       embed = discord.Embed(title=f"deleted a message {message}",description="", color=0xFF0000)
       embed.add_field(name=message.content, value=f"This is the message that he has deleted",inline=True)
       channel_id = guilds_dict[str(ctx.guild.id)]
       await client.get_channel(int(channel_id)).send(embed=embed)```
Asked By: Badassss

||

Answers:

There is no context (ctx) in an event. Remove the ctx, and it will work.

Answered By: kidney bean
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.