File size: 3,054 Bytes
046b271 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
const { cmd } = require('../command')
const fs = require('fs');
const path = require('path');
const config = require('../config')
// List of bad words to check against
// Replace with actual words
cmd({
on: "body"
},
async (conn,mek, m, { from, body, isGroup, isAdmins, isBotAdmins, reply, sender }) => {
try {
const badWords = ["wtf", "mia", "xxx","fuck","sex","huththa","pakaya","ponnaya","hutto"]
if (!isGroup || isAdmins || !isBotAdmins) return; // Skip if not in group, or sender is admin, or bot is not admin
const lowerCaseMessage = body.toLowerCase();
const containsBadWord = badWords.some(word => lowerCaseMessage.includes(word));
if (containsBadWord & config.ANTI_BAD_WORD === 'true') {
await conn.sendMessage(from, { delete: mek.key }, { quoted: mek });
await conn.sendMessage(from, {
'text': `*β οΈπΞ±ΚΙ΄ΞΉΙ΄g πΟΚΠΈ,πΞ±β πΟΚβ,πΟ
βΡ πΞΉΒ’ πΙ΄β.@${sender.split('@')[0]} πΞΉβΡΟΡ πΟΡ πββΟΟΡβ πΡΚΡπ*`,
'mentions': [sender]
}, { 'quoted': m });
}
} catch (error) {
console.error(error)
reply("An error occurred while processing the message.")
}
})
const linkPatterns = [
/https?:\/\/(?:chat\.whatsapp\.com|wa\.me)\/\S+/gi, // WhatsApp group or chat links
/wa\.me\/\S+/gi, // wa.me links without https
/https?:\/\/(?:t\.me|telegram\.me)\/\S+/gi, // Telegram links
/https?:\/\/(?:www\.)?\.com\/\S+/gi, // channel links
/https?:\/\/(?:www\.)?twitter\.com\/\S+/gi, // Twitter links
/https?:\/\/(?:www\.)?linkedin\.com\/\S+/gi, // LinkedIn links
/https?:\/\/(?:whatsapp\.com|channel\.me)\/\S+/gi, // Snapchat links
/https?:\/\/(?:www\.)?reddit\.com\/\S+/gi, // Reddit links
/https?:\/\/(?:www\.)?discord\.com\/\S+/gi, // Discord links
/https?:\/\/(?:www\.)?twitch\.tv\/\S+/gi, // Twitch links
/https?:\/\/(?:www\.)?vimeo\.com\/\S+/gi, // Vimeo links
/https?:\/\/(?:www\.)?dailymotion\.com\/\S+/gi, // Dailymotion links
/https?:\/\/(?:www\.)?medium\.com\/\S+/gi // Medium links
];
cmd({
on: 'body'
}, async (conn, m, store, {
from,
body,
sender,
isGroup,
isAdmins,
isBotAdmins
}) => {
try {
if (!isGroup || isAdmins || !isBotAdmins) {
return;
}
const containsLink = linkPatterns.some(pattern => pattern.test(body));
if (containsLink && config.DELETE_LINK === 'true') {
await conn.sendMessage(from, { 'delete': m.key }, { 'quoted': m });
await conn.sendMessage(from, {
'text': `*β οΈπΞΉΙ΄ΠΊΡ πΚΡ πΟΡ πββΟΟΡβ πΙ΄ πΠ½ΞΉΡ πΚΟΟ
Ο.@${sender.split('@')[0]} πβΡΞ±ΡΡ πΞ½ΟΞΉβ πΡΙ΄βΞΉΠΈg πΞΉΙ΄ΠΊΡ.π*`,
'mentions': [sender]
}, { 'quoted': m });
}
} catch (error) {
console.error(error);
}
});
|