Update Baileys to 7RC

This commit is contained in:
Darren Clarke 2025-12-02 16:55:07 +01:00
parent 69cb77b8f4
commit e952973f7f
9 changed files with 984 additions and 900 deletions

View file

@ -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,