Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
WhatsApp Bot Commands didn't work when I execute

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!*');
        }
    }
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!