import { WAConnection } from '@adiwajshing/baileys';

export async function before(m, { isAdmin, isBotAdmin }) { if (m.isBaileys) { // Check if the message is sent by the bot itself if (m.key.fromMe) { return; }

// Check if the message is sent by a bot
if (m.key.remoteJid.endsWith('@s.whatsapp.net') && m.messageStubType === 32) {
  // Kick the bot
  const jid = m.key.remoteJid;
  const conn = new WAConnection();
  await conn.connect();
  await conn.sendMessage(jid, 'Sorry, bots are not allowed in this group.');
  await conn.groupRemove(jid);
  return;
}

}

// Your other code here // ...

buatlah Javascript menggunakan code esm dan buatlah fitur antibot wa lain jika ada bot lain otomatis langsung kick seperti contoh code di bawah ini export async function beforem isAdmin isBotAdmin

原文地址: https://www.cveoy.top/t/topic/iZ8z 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录