@wppconnect/wa-js - v3.17.0
    Preparing search index...

    Function sendLocationMessage

    • Send a location message

      Parameters

      Returns Promise<SendMessageReturn>

      // full example
      WPP.chat.sendLocationMessage('[number]@c.us', {
      lat: -22.95201,
      lng: -43.2102601,
      name: 'Cristo Rendentor', // optional
      address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ', // optional
      url: 'https://santuariocristoredentor.com.br/' // optional
      });

      // minimal
      WPP.chat.sendLocationMessage('[number]@c.us', {
      lat: -22.95201,
      lng: -43.2102601,
      });

      // name and address
      WPP.chat.sendLocationMessage('[number]@c.us', {
      lat: -22.95201,
      lng: -43.2102601,
      name: 'Cristo Rendentor',
      address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ'
      });

      // with buttons
      WPP.chat.sendLocationMessage('[number]@c.us', {
      lat: -22.95201,
      lng: -43.2102601,
      name: 'Cristo Rendentor',
      address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ',
      buttons: [
      {
      url: 'https://example.test/',
      text: 'URL example'
      },
      {
      phoneNumber: '+55 12 3456 7777',
      text: 'Phone Number'
      },
      {
      id: 'id1',
      text: 'First'
      },
      {
      id: 'id2',
      text: 'Second'
      },
      {
      id: 'other',
      text: 'Other'
      }
      ],
      });