Skip to content

Commit

Permalink
feat: Added client.sendReadStatus function (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Aug 15, 2022
1 parent 72a70f3 commit f0361b9
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/api/layers/status.layer.ts
Expand Up @@ -17,7 +17,6 @@

import { Page } from 'puppeteer';
import { CreateConfig } from '../../config/create-config';
import { BusinessLayer } from './business.layer';
import { LabelsLayer } from './labels.layer';
import {
evaluateAndReturn,
Expand All @@ -32,6 +31,7 @@ export class StatusLayer extends LabelsLayer {
}
/**
* Send a image message to status stories
* @category Status
*
* @example
* ```javascript
Expand Down Expand Up @@ -88,6 +88,7 @@ export class StatusLayer extends LabelsLayer {
}
/**
* Send a video message to status stories
* @category Status
*
* @example
* ```javascript
Expand Down Expand Up @@ -128,6 +129,7 @@ export class StatusLayer extends LabelsLayer {

/**
* Send a text to status stories
* @category Status
*
* @example
* ```javascript
Expand All @@ -144,4 +146,25 @@ export class StatusLayer extends LabelsLayer {
{ text, options }
);
}

/**
* Mark status as read/seen
* @category Status
*
* @example
* ```javascript
* client.sendReadStatus('[phone_number]@c.us', 'false_status@broadcast_3A169E0FD4BC6E92212F_[]@c.us');
* ```
* @param chatId Chat ID of contact
* @param statusId ID of status msg
*/
public async sendReadStatus(chatId: string, statusId: string) {
return await evaluateAndReturn(
this.page,
({ chatId, statusId }) => {
WPP.status.sendReadStatus(chatId, statusId);
},
{ chatId, statusId }
);
}
}

0 comments on commit f0361b9

Please sign in to comment.