I am making a discord bot that detects spam and deletes the message, it works like this:
@client.event async def on_message(message): global cont, msg