Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda