showing results for - "swear word javascript 2b cooldown 2b delete mesagge discord js"
Esteban
25 Jul 2017
1bot.on("message", async(message) => {
2    if(message.member.hasPermission(['ADMINISTRATOR'])) return;
3    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"]
4    let foundInText = false;
5    for (var i in swearwords){
6        if (message.content.includes(swearwords[i])) foundInText = true;
7    }
8    if (foundInText) {
9        message.delete();
10                if (talkedRecently.has(message.author.id)) {
11            return;
12    } else { 
13    
14        talkedRecently.add(message.author.id);
15        setTimeout(() => {
16          talkedRecently.delete(message.author.id);
17        }, 120000); 
18    }
19        message.channel.send("**Do not post yourself or any other post** -" + "<@" + message.author + ">" )
20        .then(sentMessage => sentMessage.delete({ timeout: 30000 }))
21        .catch(console.error)
22    }
23})
Christopher
23 Nov 2016
1const swearWords = [censored stuff]
2client.on('message' message => {
3	for(let i = 0; i < swearWords.length; i++) {
4    	if(message.content.includes(i) {
5        	message.delete()
6            message.channel.send('Do **NOT** post swear words in the chat)
7        }
8    }
9})