Skip to content

Commit

Permalink
fix(whatsapp): fix display of sent files (#12779)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrahamLopez10 committed Aug 18, 2023
1 parent 77c883e commit 85d5853
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integrations/whatsapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ const integration = new Integration({
})
},
file: async ({ payload, ...props }) => {
const extension = payload.fileUrl.includes('.') ? payload.fileUrl.split('.').pop()?.toLowerCase() ?? '' : ''
const filename = 'file' + (extension ? `.${extension}` : '')

await outgoing.send({
...props,
message: new Media.Document(payload.fileUrl, false),
message: new Media.Document(payload.fileUrl, false, payload.title, filename),
})
},
location: async ({ payload, ...props }) => {
Expand Down

0 comments on commit 85d5853

Please sign in to comment.