@gamastudio/sendwave-provider 0.0.2-dev → 0.0.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SendOptions } from "@builderbot/bot/dist/types";
|
|
2
|
-
import { SendButton, SendList, SendMedia, SendMessage, SendPresence } from "../interface/types";
|
|
2
|
+
import { SendButton, SendList, SendLocation, SendMedia, SendMessage, SendPresence, SendReaction } from "../interface/types";
|
|
3
3
|
export interface ProviderInterface {
|
|
4
4
|
sendMessage?: (number: string, message: string, options?: SendOptions) => Promise<any>;
|
|
5
5
|
sendText: (data: SendMessage) => Promise<any>;
|
|
@@ -13,4 +13,6 @@ export interface ProviderInterface {
|
|
|
13
13
|
sendList: (data: SendList) => Promise<any>;
|
|
14
14
|
sendPresence: (data: SendPresence) => Promise<any>;
|
|
15
15
|
sendButton: (data: SendButton) => Promise<any>;
|
|
16
|
+
sendLocation: (data: SendLocation) => Promise<any>;
|
|
17
|
+
sendReaction: (data: SendReaction) => Promise<any>;
|
|
16
18
|
}
|
|
@@ -87,3 +87,17 @@ export interface SendButton extends SendMessage {
|
|
|
87
87
|
text: string;
|
|
88
88
|
}[];
|
|
89
89
|
}
|
|
90
|
+
export interface SendLocation extends SendMessage {
|
|
91
|
+
name: string;
|
|
92
|
+
address: string;
|
|
93
|
+
latitude: number;
|
|
94
|
+
longitude: number;
|
|
95
|
+
}
|
|
96
|
+
export interface SendReaction extends SendMessage {
|
|
97
|
+
key: {
|
|
98
|
+
remoteJid: string;
|
|
99
|
+
fromMe: boolean;
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
reaction: string;
|
|
103
|
+
}
|
package/build/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalVendorArgs, ProviderInterface, SendButton, SendList, SendMedia, SendMessage, SendPresence } from "../core/interface";
|
|
1
|
+
import { GlobalVendorArgs, ProviderInterface, SendButton, SendList, SendMedia, SendMessage, SendPresence, SendLocation, SendReaction } from "../core/interface";
|
|
2
2
|
export declare class SenderMessage implements ProviderInterface {
|
|
3
3
|
private sendwaveApi?;
|
|
4
4
|
private globalVendorArgs?;
|
|
@@ -13,4 +13,6 @@ export declare class SenderMessage implements ProviderInterface {
|
|
|
13
13
|
sendVideo(data: SendMedia): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
14
14
|
sendVoice(data: SendMedia): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
15
15
|
sendButton(data: SendButton): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
16
|
+
sendLocation(data: SendLocation): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
17
|
+
sendReaction(data: SendReaction): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
16
18
|
}
|
package/build/provider/sender.js
CHANGED
|
@@ -199,5 +199,35 @@ class SenderMessage {
|
|
|
199
199
|
console.error(error.response.data.response.message);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
async sendLocation(data) {
|
|
203
|
+
var _a, _b;
|
|
204
|
+
try {
|
|
205
|
+
return await ((_a = this.sendwaveApi) === null || _a === void 0 ? void 0 : _a.post(`/message/sendLocation/${(_b = this.globalVendorArgs) === null || _b === void 0 ? void 0 : _b.name}`, {
|
|
206
|
+
number: data.from.split("@")[0],
|
|
207
|
+
name: data.name,
|
|
208
|
+
address: data.address,
|
|
209
|
+
latitude: data.latitude,
|
|
210
|
+
longitude: data.longitude,
|
|
211
|
+
...this.globalVendorArgs,
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
console.error(error.response.data.response.message);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
async sendReaction(data) {
|
|
219
|
+
var _a, _b;
|
|
220
|
+
try {
|
|
221
|
+
return await ((_a = this.sendwaveApi) === null || _a === void 0 ? void 0 : _a.post(`/message/sendReaction/${(_b = this.globalVendorArgs) === null || _b === void 0 ? void 0 : _b.name}`, {
|
|
222
|
+
number: data.from.split("@")[0],
|
|
223
|
+
key: data.key,
|
|
224
|
+
reaction: data.reaction,
|
|
225
|
+
...this.globalVendorArgs,
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
console.error(error.response.data.response.message);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
202
232
|
}
|
|
203
233
|
exports.SenderMessage = SenderMessage;
|
package/package.json
CHANGED