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
14.96k stars 3.55k forks source link

Sending a location message doesn't work! #1591

Closed quicode closed 11 months ago

quicode commented 2 years ago

Is there an existing issue for this?

Describe the bug

No working send to location Example after working client.sendMessage(numId,new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters')) other example var loc = await new Location(Number(lati),Number(long), '') client.sendMessage(numId,loc)

Expected behavior

Send to location in the whatsapp

Steps to Reproduce the Bug or Issue

client.sendMessage(numId,new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters'))

Relevant Code

client.sendMessage(numId,new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters')) other example var loc = await new Location(Number(lati),Number(long), '') client.sendMessage(numId,loc)

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

linux, whatsapp-web.js@1.17.1

Additional context

No response

amrdesign commented 2 years ago

I have the same problem

pedropuppim commented 2 years ago

Me too

indokecapi commented 2 years ago

It began to stop sending map location since 2 days ago. Any progress for this bugs report?

augustosvm commented 2 years ago

It doesn't work in my project.

AlbertoBorgesAlmeida commented 2 years ago

Same here

joaopaulovb commented 2 years ago

I guess I'm having the same issue... No error thrown and the location is never sent.

pedropuppim commented 2 years ago

I don't have any error in the return.... but the location doesn't send it.

Message {
  _data: {
    id: {
      fromMe: true,
      remote: [Object],
      id: '3EB0B57B146C4E5F****,
      _serialized: 'true_552799924****@c.us_3EB0B57B146C4E5F****'
    },
    body: '',
    type: 'location',
    t: 1658413933,
    from: {
      server: 'c.us',
      user: '552799933****',
      _serialized: '552799933****@c.us'
    },
    to: {
      server: 'c.us',
      user: '552799924****',
      _serialized: '552799924****@c.us'
    },
    self: 'out',
    ack: 0,
    isNewMsg: true,
    star: false,
    kicNotified: false,
    loc: 'Rua Abiail do Amaral Carneiro 84',
    lat: '-20.3154123',
    lng: '-40.293625',
    isFromTemplate: false,
    mentionedJidList: [],
    isVcardOverMmsDocument: false,
    isForwarded: false,
    labels: [],
    hasReaction: false,
    disappearingModeInitiator: 'chat',
    productHeaderImageRejected: false,
    lastPlaybackProgress: 0,
    isDynamicReplyButtonsMsg: false,
    isMdHistoryMsg: false,
    requiresDirectConnection: null,
    pttForwardedFeaturesEnabled: true
  },
  mediaKey: undefined,
  id: {
    fromMe: true,
    remote: {
      server: 'c.us',
      user: '552799924****',
      _serialized: '552799924****@c.us'
    },
    id: '3EB0B57B146C4E5F****',
    _serialized: 'true_55279992****@c.us_3EB0B57B146C4E5F****'
  },
  ack: 0,
  hasMedia: false,
  body: '',
  type: 'location',
  timestamp: 1658413933,
  from: '552799933****@c.us',
  to: '552799924****@c.us',
  author: undefined,
  deviceType: 'web',
  isForwarded: false,
  forwardingScore: 0,
  isStatus: undefined,
  isStarred: false,
  broadcast: undefined,
  fromMe: true,
  hasQuotedMsg: false,
  duration: undefined,
  location: Location {
    latitude: '-20.3154123',
    longitude: '-40.293625',
    description: 'Rua Abiail do Amaral Carneiro 84'
  },
  vCards: [],
  inviteV4: undefined,
  mentionedIds: [],
  orderId: undefined,
  token: undefined,
  isGif: false,
  isEphemeral: undefined,
  links: undefined
}
asefsoft commented 2 years ago

I have same issue

michaelloliveira commented 2 years ago

I have same issue

pedroherpeto commented 2 years ago

me too =)

michaelloliveira commented 2 years ago

Any progress for this bugs report?

pedropuppim commented 2 years ago

This feacture is no longer present in whatsapp web. So I think we will run out =(

michaelloliveira commented 2 years ago

Negative! Let's put our heads to work. Anyone who finds a solution will post it here.

Julie4ganesh commented 2 years ago

anybody having button issue? if working for all of you please help me.. button not working for me

mbnaj commented 2 years ago

Same problem too, looks like whatsapp removed this feature from whatsapp web

pratamaid commented 2 years ago

Is there no solution for this bug?

michaelloliveira commented 2 years ago

I think the project was abandoned! No response on this and other threads.

CesarLuisGC commented 2 years ago

Really, I hope the project is not abandoned, it started a week ago and I am delighted with Pedro's work, I see that there have been updates in the main branch in the last month.

CesarLuisGC commented 2 years ago

I have the same problem, and it doesn't return an error either, it just doesn't send the location.

PurpShell commented 2 years ago

I will be investigating this soon, no reason for it to stop working unless the functions we are using are outdated

loginweb-dev commented 2 years ago

no funciona el enviar Location, hay solucion?

Aromakelapa commented 2 years ago

Same here

OddJoe commented 2 years ago

Hi every one, I know is not same, but you can send a text message with a link to google maps:

var locationLink = '*Ubicación* \n https://www.google.com/maps/search/?api=1&query='+MyLatitude+','+MyLongitude;
await spbWhats.waC.sendMessage(g, locationLink);
d0v3riz commented 2 years ago

Same here

Nacnudge commented 2 years ago

Also experiencing this issue - the promise resolves and it reckons the message was sent successfully (no exceptions thrown or anything), but there is no further info of anything going wrong nor does the location actually come through

Armanzahedi commented 2 years ago

same here

HiramNeto commented 2 years ago

If you guys read the first line of the readme of this project: "A WhatsApp API client that connects through the WhatsApp Web browser app". If the feature was removed from whatsapp web (the official one you access through the browser normally), there is no way this project is going to make it work, it is impossible...

michaelloliveira commented 2 years ago

If you guys read the first line of the readme of this project: "A WhatsApp API client that connects through the WhatsApp Web browser app". If the feature was removed from whatsapp web (the official one you access through the browser normally), there is no way this project is going to make it work, it is impossible...

It should work yes, I'm using the venom-bot that uses the same technology as this one and it's working correctly.

I still prefer this project, much better to develop than venom-bot.

I'll be waiting for Pedro to solve this problem and I'll use this bot again.

HiramNeto commented 2 years ago

If an action that is not possible for a human user on whatsapp web, starts to be performed by a bot automatically and consistently, good luck on not being blocked by whatsapp... They basically use this kind of behavior on their algorithms to detect bots and ban users on their plataform... We should remember that bots are not allowed by their user agreement...

For example, it was possible (I don't know if it still is because I don't use it anymore) to remove a list of users from a group all at once using whatsapp-web.js, instead of doing this one by one as a normal user would. I tried this functionality once and I was immediately blocked by them, and the telephone number I was using at the time was not able to use whatsapp anymore...

It can be that you are not blocked now, using tools that allow you to do so, because it is kind of recent that they removed the location sharing functionality on whatsapp web. But I would not be surprised if they start to block users doing this in a near future...

I would stick to the solution @OddJoe suggested and use google maps links with the coordinates attached to them, it's basically the same... Unless you need live tracking with automatic location updates, then it would not work...

banguncode commented 1 year ago

Same here, but as an alternative I used a plain text message to send the location url.

Screenshot (1)

On whatsapp web, if you send the location there will be a google map link like this: https://maps.google.com/maps?q=-7.7434798%2C110.3504368&z=17&hl=en

let location = `https://maps.google.com/maps?q=${YOUR_LATITUDE},${YOUR_LONGITUDE}&z=17&hl=en`
client.sendMessage(YOUR_NUMBER, location)
michaelloliveira commented 1 year ago

WOW thx!

sasukevita commented 1 year ago

wew image not showing

ndmil commented 1 year ago

Did you solve the problem?

ebdurrehm commented 1 year ago

Same problem

apicesistemas commented 1 year ago

Same problem.

ruanduarte commented 1 year ago

same problem here.. :/

tinyCoder32 commented 1 year ago

Could you please find a fix for this?

banguncode commented 1 year ago

Now I use the library https://github.com/adiwajshing/Baileys

guasss commented 1 year ago

Is there a solution to this problem now?

tinyCoder32 commented 1 year ago

ANy update on this yet, please?

hasanablak commented 1 year ago

Any update?

banguncode commented 1 year ago

use the library https://github.com/adiwajshing/Baileys

https://github.com/adiwajshing/Baileys

kumarnishu commented 1 year ago

Same here, but as an alternative I used a plain text message to send the location url.

Screenshot (1)

On whatsapp web, if you send the location there will be a google map link like this: https://maps.google.com/maps?q=-7.7434798%2C110.3504368&z=17&hl=en

let location = `https://maps.google.com/maps?q=${YOUR_LATITUDE},${YOUR_LONGITUDE}&z=17&hl=en`
client.sendMessage(YOUR_NUMBER, location)

i was thinking the same. just copy paste google map link

kumarnishu commented 1 year ago

use the library https://github.com/adiwajshing/Baileys

https://github.com/adiwajshing/Baileys

removed this lib

Uytec commented 4 months ago

Try this

const location = new Location(-16.6314153, -49.2547782, 'Title', "Message"); client.sendMessage(number_id, location);