Update Baileys to 7RC
This commit is contained in:
parent
69cb77b8f4
commit
e952973f7f
9 changed files with 984 additions and 900 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import * as Hapi from "@hapi/hapi";
|
||||
import Toys from "@hapipal/toys";
|
||||
import WhatsappService from "./service";
|
||||
import WhatsappService from "./service.ts";
|
||||
|
||||
const withDefaults = Toys.withRouteDefaults({
|
||||
options: {
|
||||
|
|
@ -27,15 +27,9 @@ export const SendMessageRoute = withDefaults({
|
|||
description: "Send a message",
|
||||
async handler(request: Hapi.Request, _h: Hapi.ResponseToolkit) {
|
||||
const { id } = request.params;
|
||||
const { phoneNumber, message, attachments } =
|
||||
request.payload as MessageRequest;
|
||||
const { phoneNumber, message, attachments } = request.payload as MessageRequest;
|
||||
const whatsappService = getService(request);
|
||||
await whatsappService.send(
|
||||
id,
|
||||
phoneNumber,
|
||||
message as string,
|
||||
attachments,
|
||||
);
|
||||
await whatsappService.send(id, phoneNumber, message as string, attachments);
|
||||
request.logger.info(
|
||||
{
|
||||
id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue