[+] Expose information about the logged in client (#19)

This commit is contained in:
Pedro S. Lopez
2020-02-01 21:16:03 -04:00
committed by GitHub
parent 88c56b1371
commit ba8edc8d40
4 changed files with 46 additions and 3 deletions

View File

@@ -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(`