So I am making a bot where if you send anything that has .com in it, it will delete that message and send a message saying "your message contained a link", but the bot is not working. I have tried a lot of different ways but still cannot get it to work!
#--- blacklisted words ---
@bot.event
async def on_message(message):
links = [
".com"
]
if any(word in message.content.lower() for word in links):
await message.delete()
await message.channel.send("Your message contained a blacklisted word!")
I've made sure the bot had perms, checked spellings and everything else I could think of.