@wppconnect/wa-js 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -37,6 +37,7 @@ export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageB
|
|
|
37
37
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
38
38
|
export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
|
|
39
39
|
export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
40
|
+
export { LocationMessageOptions, sendLocationMessage, } from './sendLocationMessage';
|
|
40
41
|
export { sendRawMessage } from './sendRawMessage';
|
|
41
42
|
export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
|
|
42
43
|
export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
import { MessageButtonsOptions } from './prepareMessageButtons';
|
|
18
|
+
export interface LocationMessageOptions extends SendMessageOptions, MessageButtonsOptions {
|
|
19
|
+
/**
|
|
20
|
+
* latitude in degrees
|
|
21
|
+
*/
|
|
22
|
+
lat: number;
|
|
23
|
+
/**
|
|
24
|
+
* longitude in degrees
|
|
25
|
+
*/
|
|
26
|
+
lng: number;
|
|
27
|
+
/**
|
|
28
|
+
* The full address of place
|
|
29
|
+
*/
|
|
30
|
+
address?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Name of the place
|
|
33
|
+
*/
|
|
34
|
+
name?: string;
|
|
35
|
+
/**
|
|
36
|
+
* URL to open when click on the address/name
|
|
37
|
+
*/
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Send a location message
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* // full example
|
|
46
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
47
|
+
* lat: -22.95201,
|
|
48
|
+
* lng: -43.2102601,
|
|
49
|
+
* name: 'Cristo Rendentor', // optional
|
|
50
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ', // optional
|
|
51
|
+
* url: 'https://santuariocristoredentor.com.br/' // optional
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // minimal
|
|
55
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
56
|
+
* lat: -22.95201,
|
|
57
|
+
* lng: -43.2102601,
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // name and address
|
|
61
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
62
|
+
* lat: -22.95201,
|
|
63
|
+
* lng: -43.2102601,
|
|
64
|
+
* name: 'Cristo Rendentor',
|
|
65
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ'
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // with buttons
|
|
69
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
70
|
+
* lat: -22.95201,
|
|
71
|
+
* lng: -43.2102601,
|
|
72
|
+
* name: 'Cristo Rendentor',
|
|
73
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ',
|
|
74
|
+
* buttons: [
|
|
75
|
+
* {
|
|
76
|
+
* url: 'https://example.test/',
|
|
77
|
+
* text: 'URL example'
|
|
78
|
+
* },
|
|
79
|
+
* {
|
|
80
|
+
* phoneNumber: '+55 12 3456 7777',
|
|
81
|
+
* text: 'Phone Number'
|
|
82
|
+
* },
|
|
83
|
+
* {
|
|
84
|
+
* id: 'id1',
|
|
85
|
+
* text: 'First'
|
|
86
|
+
* },
|
|
87
|
+
* {
|
|
88
|
+
* id: 'id2',
|
|
89
|
+
* text: 'Second'
|
|
90
|
+
* },
|
|
91
|
+
* {
|
|
92
|
+
* id: 'other',
|
|
93
|
+
* text: 'Other'
|
|
94
|
+
* }
|
|
95
|
+
* ],
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
* @category Message
|
|
99
|
+
*/
|
|
100
|
+
export declare function sendLocationMessage(chatId: any, options: LocationMessageOptions): Promise<SendMessageReturn>;
|