Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message reply method not working as expected #2198

Closed
gekkedev opened this issue Jun 9, 2024 · 3 comments
Closed

message reply method not working as expected #2198

gekkedev opened this issue Jun 9, 2024 · 3 comments
Labels
bug Something isn't working needs triage

Comments

@gekkedev
Copy link
Contributor

gekkedev commented Jun 9, 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 / chromium-bidi@0.5.19
  • 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
    });
@gekkedev gekkedev added bug Something isn't working needs triage labels Jun 9, 2024
@icleitoncosta
Copy link
Contributor

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 / chromium-bidi@0.5.19
  • 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: 'true_...@c.us_3EB01DE65ACC6_out'
 });

@gekkedev
Copy link
Contributor Author

gekkedev commented Jun 10, 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.

@icleitoncosta
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants