Skip to content

Commit

Permalink
fix: resolve sendMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Jul 20, 2022
1 parent 4139feb commit 01b09d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -470,7 +470,7 @@ await client.sendImage("0000000000@c.us", './file.jpg')
const contacts = await client.getAllContacts();

```
## Retrieving Data
## Group Management

Group number example `<phone Number>-<groupId>@g.us` or `<phone Number><groupId>@g.us`

Expand Down Expand Up @@ -502,7 +502,6 @@ await client.setGroupDescription('00000000-000000@g.us', 'group description')

```


### Debugging

Building the hydra-bot is very simple
Expand Down
38 changes: 20 additions & 18 deletions src/webpack/api/layes/sender.layes.ts
Expand Up @@ -282,46 +282,48 @@ export class SenderLayer extends RetrieverLayer {
});
}

if (options.type === FunctionType.sendFile || options.type === FunctionType.sendImage) {
if (
options.type === FunctionType.sendFile ||
options.type === FunctionType.sendImage
) {
this.sendFile(to, body, options)
.then((e) => {
return reject(e);
})
.catch((e) => {
.then((e: any) => {
return resolve(e);
})
.catch((e: any) => {
return reject(e);
});
}

if (options.type === FunctionType.sendAudioBase64) {
this.sendAudioBase64(to, body, options)
.then((e) => {
return reject(e);
})
.catch((e) => {
.then((e: any) => {
return resolve(e);
})
.catch((e: any) => {
return reject(e);
});
}

if (options.type === FunctionType.sendAudio) {
this.sendAudio(to, body, options)
.then((e) => {
return reject(e);
})
.catch((e) => {
.then((e: any) => {
return resolve(e);
})
.catch((e: any) => {
return reject(e);
});
}

if (options.type === FunctionType.sendText) {
this.sendText(to, body, options)
.then((e) => {
return reject(e);
})
.catch((e) => {
.then((e: any) => {
return resolve(e);
})
.catch((e: any) => {
return reject(e);
});
}
});
}

}

1 comment on commit 01b09d3

@jonalan7
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#47

Please sign in to comment.