Giter VIP home page Giter VIP logo

Comments (3)

icleitoncosta avatar icleitoncosta commented on June 27, 2024

Description

Replying to a message only works in one way for me, using the deprecated client.reply() API. The messages appear as regular messages but are not flagged as replies. For the new way to reply, the API docs say I should use the ID parameter, but there is also t and both seem to work. What is the difference between them?

There is a possibility that I just do not understand how I'm supposed to implement it without using the deprecated method.

Environment

  • WPPConnect version(s): 1.30.3
  • WA-JS version(s): 3.3.0
  • Browser: chrome-launcher@^0.15.2 / [email protected]
  • OS: Windows 11
  • Node version: Node v18.17.1
  • WhatsApp version: 2.2411.x
  • MultiDevice (BETA): no?

Steps to Reproduce

  1. Receive a simple text
  2. Send a text reply to it

Log Output

None, it does not throw an error, just does not work as expected. The messages are just sent as regular messages.

Your Code

    client.reply(message.chatId, "my reply", message.id) // works
    client.reply(message.chatId, "my reply", message.t) // works

    //does not work
    return client.sendText(message.from, "my reply", {
      quotedMsgObj: message,
    });
    //does not work
    return client.sendText(message.from, "my reply", {
      quotedMsgId: message.t
    });
    //does not work
    return client.sendText(message.from, "my reply", {
      quotedMsgId: message.id
    });

Hi, use:

  // A message with reply
 client.sendText('<number>@c.us', 'A simple message', {
  quotedMsg: '[email protected]_3EB01DE65ACC6_out'
 });

from wppconnect.

gekkedev avatar gekkedev commented on June 27, 2024

So I need to supply the right value to quotedMsg? I thought I had done that; I took the ID property of the incoming message. Is this the wrong field? The one I used is id which has a string value like 'false_[redacted phone number]@c.us_C1F[...]58'.
Once I understand how the non-deprecated approach works I can volunteer to amend an example into the documentation or add more JSDoc info.

from wppconnect.

icleitoncosta avatar icleitoncosta commented on June 27, 2024

So I need to supply the right value to quotedMsg? I thought I had done that; I took the ID property of the incoming message. Is this the wrong field? The one I used is id which has a string value like 'false_[redacted phone number]@c.us_C1F[...]58'. Once I understand how the non-deprecated approach works I can volunteer to amend an example into the documentation or add more JSDoc info.

Yes, exactly that way, you need to pass the id parameter. Regarding the documentation, I have already made a PR, but I am here analyzing other issues and fixing them to go along.

from wppconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.