|
const { cmd } = require('../command'); |
|
|
|
cmd({ |
|
pattern: "jid", |
|
desc: "Get the JID of the user or group.", |
|
react: "📍", |
|
category: "group", |
|
filename: __filename, |
|
}, async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { |
|
try { |
|
|
|
if (!isGroup && !isOwner) { |
|
return reply("*⚠️ Only the bot owner or group admins can use this command.*"); |
|
} |
|
|
|
|
|
if (isGroup) { |
|
return reply(`*ɢʀᴏᴜᴘ ᴊɪᴅ* *${from}@g.us*`); |
|
} |
|
|
|
|
|
if (!isGroup) { |
|
return reply(`User JID: *${sender}@s.whatsapp.net*`); |
|
} |
|
|
|
} catch (e) { |
|
console.error("Error:", e); |
|
reply(`❌ An error occurred: ${e.message}`); |
|
} |
|
}); |
|
|
|
|
|
|
|
|
|
cmd({ |
|
pattern: "jid2", |
|
desc: "Get the JID of the user or group.", |
|
react: "📍", |
|
category: "group", |
|
filename: __filename, |
|
}, async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => { |
|
try { |
|
|
|
if (!isGroup && !isOwner) { |
|
return reply("⚠️ Only the bot owner or group admins can use this command."); |
|
} |
|
|
|
|
|
if (isGroup) { |
|
|
|
return reply(`*ɢʀᴏᴜᴘ ᴊɪᴅ:* *${from}@g.us*`); |
|
} |
|
|
|
|
|
if (!isGroup) { |
|
return reply(`User JID: *${sender}@s.whatsapp.net*`); |
|
} |
|
|
|
} catch (e) { |
|
console.error("Error:", e); |
|
reply(`❌ An error occurred: ${e.message}`); |
|
} |
|
}); |
|
|