I'm trying to make my discord bot pick up words I don't want people to use. I know how to make the bot delete the message containing the word and reply to the person appropriately. What I can't figure out is how to make the bot record the message containing the word and send it to the moderation log channel as an embed to log what message it just deleted and who sent it.
I've seen examples on how to log every deleted message but that's not what I want to do. I only want the bot to record messages it deleted whenever people use the word. (or log the message with the word before deleting it from the main channel)
this is the code i'm using so far, not sure how to add that part to it.
client.on('message', message => {
const args = message.content.split(" ").slice(1);
if(message.content.toLowerCase() === "word") {
message.delete()
message.reply("don't send that word here.");
}
});