forked from mhmmdrizki13/mrizkibot-starting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_antibadword.js
33 lines (28 loc) · 1.49 KB
/
_antibadword.js
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
let { GroupSettingChange } = require('@adiwajshing/baileys')
let handler = m => m
let badwordRegex = /anj(k|g)|ajn?(g|k)|a?njin(g|k)|bajingan|b(a?n)?gsa?t|ko?nto?l|me?me?(k|q)|pe?pe?(k|q)|meki|titi(t|d)|pe?ler|tetek|toket|ngewe|go?blo?k|to?lo?l|idiot|(k|ng)e?nto?(t|d)|jembut|bego|dajj?al|janc(u|o)k|pantek|puki ?(mak)?|kimak|kampang|lonte|col(i|mek?)|pelacur|henceu?t|nigga|fuck|dick|bitch|tits|bastard|asshole/i // tambahin sendiri
handler.before = function (m, { isOwner, isBotAdmin }) {
if (m.isBaileys && m.fromMe) return !0
let chat = global.db.data.chats[m.chat]
let user = global.db.data.users[m.sender]
let isBadword = badwordRegex.exec(m.text)
if (!chat.antiBadword && !chat.isBanned && isBadword) {
user.warning += 1
this.send2Button(m.chat, `*Badword terdeteksi!*
Warning: ${user.warning} / 5
Jika warning mencapai 5 kamu akan dibanned
ketik *#on antibadword* untuk menyalakan antibadword
ketik *#astagfirullah* atau *#maaf* untuk mengurangi warning
“Barang siapa yang beriman kepada Allah dan Hari Akhir maka hendaklah dia berkata baik atau diam” (HR. al-Bukhari dan Muslim).`, '© M Rizki BOT', 'Nyalakan Antibadword', ',1 antibadword', 'Astaghfirullah', ',maaf')
if (user.warning >= 5) {
user.banned = true
if (m.isGroup) {
if (isBotAdmin) {
this.groupSettingChange(m.chat, GroupSettingChange.messageSend, true)
}
}
}
}
return !0
}
module.exports = handler