(sock, message, args, context)
| 6 | usage: '.gcinfo', |
| 7 | groupOnly: true, |
| 8 | async handler(sock, message, args, context) { |
| 9 | const chatId = context.chatId || message.key.remoteJid; |
| 10 | const channelInfo = context.channelInfo || {}; |
| 11 | try { |
| 12 | const meta = await sock.groupMetadata(chatId); |
| 13 | const admins = meta.participants.filter((p) => p.admin).map((p) => ` • @${p.id.split('@')[0]}`).join('\n'); |
| 14 | const created = meta.creation |
| 15 | ? new Date(meta.creation * 1000).toLocaleDateString() |
| 16 | : 'Unknown'; |
| 17 | const memberCount = meta.participants.length; |
| 18 | const adminCount = meta.participants.filter((p) => p.admin).length; |
| 19 | await sock.sendMessage(chatId, { |
| 20 | text: `╔═══════════════════════╗\n` + |
| 21 | `║ 📊 *GROUP INFO* ║\n` + |
| 22 | `╚═══════════════════════╝\n\n` + |
| 23 | `*📛 Name:* ${meta.subject}\n` + |
| 24 | `*📝 Description:*\n${meta.desc || '_No description_'}\n\n` + |
| 25 | `*👥 Members:* ${memberCount}\n` + |
| 26 | `*👑 Admins:* ${adminCount}\n` + |
| 27 | `*📅 Created:* ${created}\n` + |
| 28 | `*🆔 JID:* \`${meta.id}\`\n\n` + |
| 29 | `*👑 Admin List:*\n${admins || '_None_'}`, |
| 30 | mentions: meta.participants.filter((p) => p.admin).map((p) => p.id), |
| 31 | ...channelInfo |
| 32 | }, { quoted: message }); |
| 33 | } |
| 34 | catch (e) { |
| 35 | console.error('[GROUPMETADATA] Error:', e.message); |
| 36 | await sock.sendMessage(chatId, { |
| 37 | text: `❌ Failed to fetch group info: ${e.message}`, |
| 38 | ...channelInfo |
| 39 | }, { quoted: message }); |
| 40 | } |
| 41 | } |
| 42 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected