How can I make my chat filter send one embed if there are 2 swear words?

I'm having an issue where if there are 2 swear words in a message, it will send 2 embeds. Does anyone know fixes for this?

async def on_message(message):    
    for bad_word in bad_words:
        if bad_word in message.content.lower().split(" "):
            t = discord.Embed(color=0x039e00, title="Message Removed", description=f":x:   Please don't say that here, {}.")
            t.set_footer(text="DM TheSuperRobert2498#2498 for bot suggestions.")
            await, delete_after=5)
            await message.delete()
            await client.process_commands(message)

Read more here:

Content Attribution

This content was originally published by TheSuperRobert at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: