Skip to content

Commit

Permalink
Update info-bannedList.js
Browse files Browse the repository at this point in the history
  • Loading branch information
BOTCAHX authored Dec 17, 2024
1 parent 8dac339 commit 917c971
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions plugins/info-bannedList.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
let handler = async (m, { conn, isOwner }) => {
let chats = Object.entries(global.db.data.chats).filter(chat => chat[1].isBanned)
let users = Object.entries(global.db.data.users).filter(user => user[1].banned)

let _chatlist = chats.map(([jid], i) => {
let formattedJid = jid.endsWith('@s.whatsapp.net')
? jid.split('@')[0]
: jid.endsWith('@g.us')
? jid
: jid

return `├ ${i + 1}. ${formattedJid}`.trim()
})

let _userlist = users.map(([jid], i) => {
let formattedJid = jid.endsWith('@s.whatsapp.net')
? jid.split('@')[0]
: jid.endsWith('@g.us')
? jid
: jid

return `├ ${i + 1}. ${formattedJid}`.trim()
})

let caption = `
┌〔 Daftar Chat Terbanned 〕
├ Total : ${chats.length} Chat${chats ? '\n' + chats.map(([jid], i) => `
${i + 1}. ${conn.getName(jid) == undefined ? 'Unknown' : conn.getName(jid)}
${isOwner ? '@' + jid.split`@`[0] : jid}
`.trim()).join('\n') : ''}
├ Total : ${chats.length} Chat
${_chatlist.join('\n')}
└────
┌〔 Daftar Pengguna Terbanned 〕
├ Total : ${users.length} Pengguna${users ? '\n' + users.map(([jid], i) => `
${i + 1}. ${conn.getName(jid) == undefined ? 'Unknown' : conn.getName(jid)}
${isOwner ? '@' + jid.split`@`[0] : jid}
`.trim()).join('\n') : ''}
├ Total : ${users.length} Pengguna
${_userlist.join('\n')}
└────
`.trim()

conn.reply(m.chat, caption, m, { contextInfo: { mentionedJid: conn.parseMention(caption) } })
}

handler.help = ['bannedlist']
handler.tags = ['info']
handler.command = /^listban(ned)?|ban(ned)?list|daftarban(ned)?$/i
Expand Down

0 comments on commit 917c971

Please sign in to comment.