@wppconnect/wa-js 2.0.1 → 2.1.1

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
@@ -1,3 +1,30 @@
1
+ ## 2.1.1 (2022-04-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Added missing footer option for WPP.chat.sendFileMessage ([623c57f](https://github.com/wppconnect-team/wa-js/commit/623c57fe0460437663519148c7201885c1354a84))
7
+
8
+
9
+
10
+ # 2.1.0 (2022-04-27)
11
+
12
+
13
+ ### Features
14
+
15
+ * Added WPP.chat.sendLocationMessage function ([9503dcc](https://github.com/wppconnect-team/wa-js/commit/9503dccdb2b1cdb436db7c243b2852ee80267620))
16
+
17
+
18
+
19
+ ## 2.0.2 (2022-04-26)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Fixed buttons without message title ([ed611cf](https://github.com/wppconnect-team/wa-js/commit/ed611cfe45d9abc79c7ac151e03fd1466a246b81))
25
+
26
+
27
+
1
28
  ## 2.0.1 (2022-04-25)
2
29
 
3
30
 
@@ -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';
@@ -18,6 +18,7 @@ import { MessageButtonsOptions } from '.';
18
18
  export interface FileMessageOptions extends SendMessageOptions {
19
19
  type: string;
20
20
  caption?: string;
21
+ footer?: string;
21
22
  filename?: string;
22
23
  mimetype?: string;
23
24
  }
@@ -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>;
@@ -29,9 +29,10 @@ export declare namespace MediaPrep {
29
29
  constructor(type: OUTWARD_TYPES, p: any);
30
30
  sendToChat(e: ChatModel, options: {
31
31
  caption?: string;
32
+ footer?: string;
32
33
  quotedMsg?: MsgModel;
33
34
  productMsgOptions?: ModelPropertiesContructor<MsgModel>;
34
- type?: any;
35
+ type?: null | string;
35
36
  mentionedJidList?: any;
36
37
  isForwarded?: boolean;
37
38
  forwardingScore?: any;