mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
[+] Expose information about the logged in client (#19)
This commit is contained in:
@@ -81,6 +81,15 @@ client.on('message', async msg => {
|
||||
} else if(msg.body == '!chats') {
|
||||
const chats = await client.getChats();
|
||||
client.sendMessage(msg.from, `The bot has ${chats.length} chats open.`);
|
||||
} else if(msg.body == '!info') {
|
||||
let info = client.info;
|
||||
client.sendMessage(msg.from, `
|
||||
*Connection info*
|
||||
User name: ${info.pushname}
|
||||
My number: ${info.me.user}
|
||||
Platform: ${info.platform}
|
||||
WhatsApp version: ${info.phone.wa_version}
|
||||
`);
|
||||
} else if(msg.body == '!mediainfo' && msg.hasMedia) {
|
||||
const attachmentData = await msg.downloadMedia();
|
||||
msg.reply(`
|
||||
|
||||
Reference in New Issue
Block a user