-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Text messages gives error #2857
Comments
hello, Provide the code you are using to send this text message. Are you using the same core found within main branch or you are using another fork or pull request? Are you sending something related to polls ??? |
Same code as of main branch. Notinng related to poll. It is just plain text message. Even only Hi gives same error. |
Provide the code part of how you are sending the text message Also provide us with the node version you are using As we see, the error is related about the type of content passed to the So we need to see the code you use in order to see from where the error started |
does the project run normaly with you ? |
Yes
…On Sun, Mar 31, 2024, 6:20 PM AminaChouarfa ***@***.***> wrote:
does the project run normaly with you ?
—
Reply to this email directly, view it on GitHub
<#2857 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOX7DWJEFYAZ3RAUHW2CV3Y3ABBLAVCNFSM6AAAAABFQLKXEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYG4YDQMJTHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
from any country plz? |
Which web whatsapp version you are using ???? |
What are the issues you are encountering ??? If you are encountering the issue that prevent you to preserve session after rerun, so please read more on this here : |
client.sendMessage(fields.to + '@c.us', String(fields.message), {
|
If you are usin web whatsapp 2.3 and you are encountering crash for first run (directly after scanning the qr code) So take look to following PRs: And stay up to date with PRs and issues to know what is going on with new version |
Before sending the message, Also check out the type of the intermediate value resulted from String Casting And tell the result |
typeof fields.message = object
typeof String(fields.message) = string
…On Sun, Mar 31, 2024 at 7:01 PM MoudiZd ***@***.***> wrote:
Same code as of main branch.
Notinng related to poll.
It is just plain text message. Even only Hi gives same error.
Provide the code part of how you are sending the text message
Also provide us with the node version you are using
As we see, the error is related about the type of content passed to the
sendMessage method, it seems for any reason javascript fails to check if
the passed value is instance of Poll class
So we need to see the code you use in order to see from where the error
started
client.sendMessage(fields.to + ***@***.***', String(fields.message), {
linkPreview: true, }) .then(function (result) { console.log(result)
console.log("\n\n\n\n\n")
res.end(result.id.id)
})
Before sending the messagw,
Check the type of fields.message
console.log(typeof fields.message);
Also check out the type of the intermediate value resulted from String
Casting
console.log(typeof String(fields.message));
And tell the result
—
Reply to this email directly, view it on GitHub
<#2857 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOX7DSCC3OCYDEP7W26QSDY3AFZPAVCNFSM6AAAAABFQLKXEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYG42DAOJYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Which node version |
Try to remove the third passed parameter, i see that you do not need this if you are sending a text message I am talking about this: |
also add catch to the promise:
|
Removing preview link still gives same error
typeof fields.message = object
typeof String(fields.message = string
TypeError: Right-hand side of 'instanceof' is not an object
…On Mon, Apr 1, 2024 at 3:01 PM MoudiZd ***@***.***> wrote:
also add catch to the promise:
client.sendMessage(fields.to + ***@***.***', String(fields.message), { linkPreview: true, }) .then(function (result) { console.log(result) console.log("\n\n\n\n\n")
res.end(result.id.id)
}).catch(function(error){console.log(error);})
—
Reply to this email directly, view it on GitHub
<#2857 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOX7DSMFJP5WNJCH7BI2HDY3ESOXAVCNFSM6AAAAABFQLKXEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRZGQ3TQNZUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Is there an existing issue for this?
Describe the bug
If I try to send plain text message it gives error
(node:24580) UnhandledPromiseRejectionWarning: TypeError: Right-hand side of 'instanceof' is not an object
at Client.sendMessage (/home/Whatsapp/node_modules/whatsapp-web.js/src/Client.js:904:28)
where as media message with text works fine.
Expected behavior
Even only text message without media should go.
Steps to Reproduce the Bug or Issue
Try sending only text message
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: