Answers for "swear word javascript + cooldown + delete mesagge discord.js"

0

swear word javascript + cooldown + delete mesagge discord.js

bot.on("message", async(message) => {
    if(message.member.hasPermission(['ADMINISTRATOR'])) return;
    let swearwords = ["arse","ass","asshole","bastard","bitch","bollocks","brotherfucker","bugger","bullshit","child-fucker","Christ on a bike","Christ on a cracker","crap","cunt","damn","effing","fatherfucker","frigger","fuck","godsdamn","hell","holy shit","horseshit","Jesus Christ","Jesus fuck","Jesus H. Christ","Jesus Harold Christ","Jesus wept","Jesus, Mary and Joseph","Judas Priest","motherfucker","nigga","prick","shit","shit ass","shitass","sisterfucker","slut","son of a bitch","son of a whore","sweet Jesus","twat"]
    let foundInText = false;
    for (var i in swearwords){
        if (message.content.includes(swearwords[i])) foundInText = true;
    }
    if (foundInText) {
        message.delete();
                if (talkedRecently.has(message.author.id)) {
            return;
    } else { 
    
        talkedRecently.add(message.author.id);
        setTimeout(() => {
          talkedRecently.delete(message.author.id);
        }, 120000); 
    }
        message.channel.send("**Do not post yourself or any other post** -" + "<@" + message.author + ">" )
        .then(sentMessage => sentMessage.delete({ timeout: 30000 }))
        .catch(console.error)
    }
})
Posted by: Guest on November-01-2020
0

swear word javascript + cooldown + delete mesagge discord.js

const swearWords = [censored stuff]
client.on('message' message => {
	for(let i = 0; i < swearWords.length; i++) {
    	if(message.content.includes(i) {
        	message.delete()
            message.channel.send('Do **NOT** post swear words in the chat)
        }
    }
})
Posted by: Guest on September-12-2021

Code answers related to "swear word javascript + cooldown + delete mesagge discord.js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language