Skip to content

Commit

Permalink
fix: Improovment sendPtt with pre messageId (close #1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 30, 2023
1 parent 88625ba commit 675701c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/api/layers/sender.layer.ts
Expand Up @@ -425,13 +425,15 @@ export class SenderLayer extends ListenerLayer {
* @param filename
* @param caption
* @param quotedMessageId Quoted message id
* @param messageId Set the id for this message
*/
public async sendPttFromBase64(
to: string,
base64: string,
filename: string,
caption?: string,
quotedMessageId?: string
quotedMessageId?: string,
messageId?: string
) {
const result = await evaluateAndReturn(
this.page,
Expand All @@ -443,6 +445,7 @@ export class SenderLayer extends ListenerLayer {
caption,
quotedMsg: quotedMessageId,
waitForAck: true,
messageId: messageId,
});

return {
Expand All @@ -465,13 +468,15 @@ export class SenderLayer extends ListenerLayer {
* @param filename
* @param caption
* @param quotedMessageId Quoted message id
* @param messageId Set the id for this message
*/
public async sendPtt(
to: string,
filePath: string,
filename?: string,
caption?: string,
quotedMessageId?: string
quotedMessageId?: string,
messageId?: string
) {
return new Promise(async (resolve, reject) => {
let base64 = await downloadFileToBase64(filePath, [/^audio/]),
Expand Down Expand Up @@ -499,7 +504,8 @@ export class SenderLayer extends ListenerLayer {
base64,
filename,
caption,
quotedMessageId
quotedMessageId,
messageId
)
.then(resolve)
.catch(reject);
Expand Down

0 comments on commit 675701c

Please sign in to comment.