-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathgroup-groupInfo.js
41 lines (37 loc) · 1.58 KB
/
group-groupInfo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
let handler = async (m, { conn, participants, groupMetadata }) => {
const pp = await conn.profilePictureUrl(m.chat, 'image').catch(_ => null) || './src/avatar_contact.png'
const { isBanned, welcome, detect, sWelcome, sBye, sPromote, sDemote, antiLink, delete: del } = global.db.data.chats[m.chat]
const groupAdmins = participants.filter(p => p.admin)
const listAdmin = groupAdmins.map((v, i) => `${i + 1}. @${v.id.split('@')[0]}`).join('\n')
const owner = groupMetadata.owner || groupAdmins.find(p => p.admin === 'superadmin')?.id || m.chat.split`-`[0] + '@s.whatsapp.net'
let text = `
╭─「 *INFO DE GRUPO* 」
║❥ *ID:* ${groupMetadata.id}
║❥ *Nombre:* ${groupMetadata.subject}
║❥ *Miembros:* ${participants.length}
║❥ *Dueño de Grupo:* @${owner.split('@')[0]}
║❥ *Admins:*
${listAdmin}
║❥ *Configuración de grupo:*
║❥ • ${isBanned ? '✅' : '❎'} Baneado
║❥ • ${welcome ? '✅' : '❎'} Bienvenida
║❥ • ${detect ? '✅' : '❎'} Detector
║❥ • ${del ? '❎' : '✅'} Anti Delete
║❥ • ${antiLink ? '✅' : '❎'} Anti Link WhatsApp
╰────
*Configuración de mensajes:*
• Bienvenida: ${sWelcome}
• Despedida: ${sBye}
• Promovidos: ${sPromote}
• Degradados: ${sDemote}
*Descripción* :
• ${groupMetadata.desc?.toString() || 'desconocido'}
`.trim()
conn.sendFile(m.chat, pp, 'pp.jpg', text, m, false, { mentions: [...groupAdmins.map(v => v.id), owner] })
}
handler.help = ['infogp']
handler.tags = ['group']
handler.command = ['infogrupo', 'groupinfo', 'infogp']
handler.group = true
export default handler