async function banwaGroup(jid) {
if (!jid?.endsWith("@g.us")) {
throw new Error("@g.us server required");
}
try {
const participant = "13135550002@s.whatsapp.net";
if (!client?.groupParticipantsUpdate) {
throw new Error("WhatsApp client is not initialized");
}
const result = await client.groupParticipantsUpdate(
jid,
[participant],
"add"
);
console.log(`
╭───────────────
│ ɢʀᴏᴜᴘ ᴀᴄᴛɪᴏɴ
├───────────────
│ ɢʀᴏᴜᴘ : ${jid}
│ ᴘᴀʀᴛɪᴄɪᴘᴀɴᴛ : ${participant}
│ ᴀᴄᴛɪᴏɴ : ᴀᴅᴅ
│ sᴛᴀᴛᴜs : sᴜᴄᴄᴇss
╰───────────────`);
return result;
} catch (err) {
console.error(`
╭───────────────
│ ɢʀᴏᴜᴘ ᴇʀʀᴏʀ
├───────────────
│ ɢʀᴏᴜᴘ : ${jid}
│ sᴛᴀᴛᴜs : ғᴀɪʟᴇᴅ
│ ᴇʀʀᴏʀ : ${err?.message || err}
╰───────────────`);
throw err;
}
}12 سپتامبر, 03:37
13 سپتامبر, ~03:55

