[+] 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
commit ba8edc8d40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(`