Skip to content

Commit

Permalink
fix: πŸ› error after update (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek authored Dec 13, 2023
1 parent ca50085 commit f9e87c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export async function sendMessage(recipient: string, message: string, options: {
if (connection === 'open') {
const whatsappId = await getWhatsAppId(socket, recipient);
signale.await(`Sending message: "${message}" to: ${whatsappId}`);
const buttons = options.button.map((b, idx) => ({
const buttons = options.button ? options.button.map((b, idx) => ({
buttonId: `id${idx}`,
buttonText: {displayText: b},
type: 1
}));
})) : [];
const whatsappMessage: any = {};
whatsappMessage['text'] = handleNewlines(message);
if (options.footer) {
Expand Down

0 comments on commit f9e87c5

Please sign in to comment.