Last active
March 11, 2023 17:56
-
-
Save INR-L/950ea5dcb90c108213936f4d4362d3c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//pattern: ['auto-detect-wa-link-and-dlt'], | |
module.exports = async(msg, conn, m) => { | |
if(!m.isGroup) return; | |
if(!m.client.body.toLowerCase().includes("chat.whatsapp.com")) return; | |
if(m.client.isCreator) return; | |
const groupMetadata = m.isGroup ? await conn.groupMetadata(m.from).catch(e => {}) : '' | |
const participants = m.isGroup ? await groupMetadata.participants : '' | |
let admins = m.isGroup ? await participants.filter(v => v.admin !== null).map(v => v.id) : ''; | |
if(admins.includes(m.sender)) return; | |
return await conn.sendMessage(m.from, { | |
delete: { | |
remoteJid: m.key.remoteJid, | |
fromMe: m.key.fromMe, | |
id: m.key.id, | |
participant: m.sender | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment