pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.53k stars 3.7k forks source link

Not send Message #2603

Closed fernandopraise closed 11 months ago

fernandopraise commented 1 year ago

Is there an existing issue for this?

Describe the bug

I have noticed that after being logged in for a while, it no longer sends messages, if I open web.whatsapp and search for the number, which may not be in my contact list, and paste the message to be sent, then it sends normally, but if I do this via sendMessage, it is not sent, the return json is below:

Message { _data: { id: { fromMe: true, remote: [Object], id: '3EB02B00592790D01EEEAD', _serialized: 'true_55679xxxx683@c.us_3EB02B00592790D01EEEAD' }, viewed: false, body: 'Olá boa noite', type: 'chat', t: 1698190639, from: { server: 'c.us', user: '55679xxxx732', _serialized: '55679xxxx732@c.us' }, to: { server: 'c.us', user: '55679xxxx683', _serialized: '55679xxxx683@c.us' }, self: 'out', ack: 0, isNewMsg: true, star: false, kicNotified: false, isFromTemplate: false, pollInvalidated: false, isSentCagPollCreation: false, latestEditMsgKey: null, latestEditSenderTimestampMs: null, mentionedJidList: [], groupMentions: [], isVcardOverMmsDocument: false, isForwarded: false, hasReaction: false, productHeaderImageRejected: false, lastPlaybackProgress: 0, isDynamicReplyButtonsMsg: false, isMdHistoryMsg: false, stickerSentTs: 0, isAvatar: false, lastUpdateFromServerTs: 0, invokedBotWid: null, bizBotType: null, botResponseTargetId: null, botPluginType: null, botPluginReferenceIndex: null, botPluginSearchProvider: null, botPluginSearchUrl: null, requiresDirectConnection: null }, mediaKey: undefined, id: { fromMe: true, remote: { server: 'c.us', user: '556791921683', _serialized: '556791921683@c.us' }, id: '3EB02B00592790D01EEEAD', _serialized: 'true_55679xxxx683@c.us_3EB02B00592790D01EEEAD' }, ack: 0, hasMedia: false, body: 'Olá boa noite', type: 'chat', timestamp: 1698190639, from: '55679xxxx732@c.us', to: '55679xxxx683@c.us', author: undefined, deviceType: 'android', isForwarded: false, forwardingScore: 0, isStatus: false, isStarred: false, broadcast: undefined, fromMe: true, hasQuotedMsg: false, hasReaction: false, duration: undefined, location: undefined, vCards: [], inviteV4: undefined, mentionedIds: [], orderId: undefined, token: undefined, isGif: false, isEphemeral: undefined, links: undefined }

Expected behavior

Send to all numbers regardless of whether it is on the list or not

Steps to Reproduce the Bug or Issue

  1. Login to the bot
  2. Waiting for a while, I don't know how to estimate how long after this happens
  3. send a message to a contact that is not on the list

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

OS: Linux whatsapp-web.js version: 1.23.0 Node.js Version: 20.5.1

Additional context

No response

stefanfuchs commented 11 months ago

I'm having a weird issue which I believe is similar to yours: when the whatsapp client is online for some time, some messages that are sent are never actually delivered to the contact. They stay with one gray "tick" forever.

The most weird thing about this bug is that these messages appear on the mobile app with 1 gray tick as well, but never get delivered.

Sometimes clearing the whatsapp session works, but only for some time. It has to be done again and again.

alechkos commented 11 months ago

There is no issues with sendMessage method in your context. More likely that the problem is in your code, maybe with handling asynchronous methods. Also you should keep the client active, e.g. by calling some library method approximately every 4 hours.

morris-choga commented 7 months ago

Has this issue been resolved? I have been facing this issue before and after the lib exodus update.

EduarnoTech commented 6 months ago

Facing the same issue while sending the Poll