new(whatsapp.gblib): New provider.
This commit is contained in:
parent
0c967a9f71
commit
49056e9f76
1 changed files with 29 additions and 29 deletions
|
@ -139,7 +139,7 @@ export class WhatsappDirectLine extends GBService {
|
|||
options = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
body: { webhook: webhook, },
|
||||
body: { webhook: `${GBServer.globals.publicAddress}/webhooks/whatsapp/${this.botId}` },
|
||||
headers: {
|
||||
'x-maytapi-key': this.whatsappServiceKey,
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -541,20 +541,20 @@ export class WhatsappDirectLine extends GBService {
|
|||
|
||||
}
|
||||
else {
|
||||
// TODO: Attach.
|
||||
|
||||
let contents = 0;
|
||||
let body = {
|
||||
type: 'image',
|
||||
text: 'Base64 Image Response',
|
||||
message: `data:image/jpeg;base64,${contents}`,
|
||||
to_number: to,
|
||||
type: "media",
|
||||
message: url,
|
||||
text: caption
|
||||
};
|
||||
|
||||
let phoneId = this.whatsappServiceNumber.split(';')[0];
|
||||
let productId = this.whatsappServiceNumber.split(';')[1]
|
||||
|
||||
|
||||
let url = `${this.INSTANCE_URL}/${productId}/${phoneId}/sendMessage`;
|
||||
options = {
|
||||
url: `${this.INSTANCE_URL}/${productId}/${phoneId}/sendMessage`,
|
||||
method: 'post',
|
||||
json: true,
|
||||
body,
|
||||
|
|
Loading…
Add table
Reference in a new issue