I want to have a discord bot for my server that logs deleted messages in a specific channel. I have tried but I'm new to coding this is what I came up with and it doesn't work. The code is shown below:
async def on_message_delete(message):
embed=discord.Embed(title="{} deleted a message".format(member.name.message), description="", color="teal")
embed.add_field(name= message.content ,value="Deleted message", inline=True)
channel=bot.get_channel(channel_id)
await channel.send(embed=embed)
Can anyone tell me what's wrong and the correct code please, it would be greatly appreciated and how to do logging for edited messages too