Skip to content

Instantly share code, notes, and snippets.

@herzonly
Created May 20, 2025 08:42
Show Gist options
  • Save herzonly/74c0fdf61716650e444021600dda62dd to your computer and use it in GitHub Desktop.
Save herzonly/74c0fdf61716650e444021600dda62dd to your computer and use it in GitHub Desktop.
/*
@ author: Herza
@ type : CommonJS
@ ========> Info <=========
@ github: https://github.com/herzonly
@ wa_channel: https://whatsapp.com/channel/0029VaGVOvq1iUxY6WgHLv2R
*/
/*
JANGAN LUPA DI HANDLER.JS CARI BAGIAN global.db.data.chats tambahin antiTagSw: true atau false
Kalo mau bagian enable nya sini chat gw 6282393307733 kalo g respon ke 6281245101404
*/
let handler = m => m
handler.before = async function (m, { conn, isBotAdmin, isAdmin }) {
if ((m.fromMe) || m.fromMe || !m.isGroup) return true
let chat = global.db.data.chats[m.chat]
if (chat.antiTagSw && m.mtype === 'groupStatusMentionMessage') {
await conn.sendMessage(m.chat, { text: `*「 ANTI TAG SW 」*\n\nDetected *${await conn.getName(m.sender)}* you have sent a status mention in the group!\n\nSorry AntiTagSw Is Active In This Group` })
if (isAdmin) return conn.sendMessage(m.chat, { text: '*Eh sorry you admins, you are allowed to tag SW. hehe..*' })
if (!isBotAdmin) return conn.sendMessage(m.chat, { text: '*Bots are not admins, how can they delete messages?*' })
try {
await conn.sendMessage(m.chat, { delete: m.key })
} catch (error) {
console.error('Error deleting message:', error)
}
}
return true
}
module.exports = handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment