I'm trying to figure out how to remove an embed from a message my Discord bot sends. As a joke, I made a bot to "censor" certain links, but so it's not mean, the bot reposts the link itself. Assuming any message from the bot has only one link in it, how do I either prevent the link embed from occurring, or have the bot delete the embed immediately?
Not a duplicate of this question because I do not know what the link will be, so I can't just find a certain substring and put angle brackets around it.
My code is as follows:
if any(substring in message.content.lower() for substring in ["www.example.com", "www.wikipedia.com"]):
msg = await message.channel.send(f"{message.author.mention} is out of line!"
f"\n> {message.content}\nThis misdeed has been noted, "
"and future transgressions will result in severe penalties.")
# remove embeds here?
await message.delete()
(In addition, if there's a better way to do the if statement, let me know.)