Sorry for asking again
I was making a commands in My WhatsApp Bots using whatsapp-web.js module, I made it so that Only I can execute the Command
When I test it, it just didn't execute
I already read the documentation and try use if (chat.isMe) { and if (contact.isMe) { but still no result.
Did I write it wrong?
The Code:
client.on('message', async msg => {
if (msg.body == '.pin') {
if (contact.isMe) {
const chat = await msg.getChat();
await chat.pin();
msg.reply('This *chat* has been pinned by *Owner*.');
console.log('[CHAT_PINNED] You were pinned Chat or Group!');
} else {
msg.reply('This *Owner!*');
}
}
});