Skip to content

Commit

Permalink
feat: Added startRecording function and deprecated setChatState
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Dec 9, 2021
1 parent 13d12f6 commit 8e8d8d5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,33 @@ export class SenderLayer extends ListenerLayer {
});
}

/**
* Starts recording ('Recording...' state)
* @category Chat
* @param chatId
*/
public async startRecording(to: string, duration?: number) {
return evaluateAndReturn(
this.page,
({ to, duration }) => WPP.chat.markIsRecording(to, duration),
{
to,
duration,
}
);
}

/**
* Stops recording ('Recording...' state)
* @category Chat
* @param chatId
*/
public async stopRecoring(to: string) {
return evaluateAndReturn(this.page, ({ to }) => WPP.chat.markIsPaused(to), {
to,
});
}

/**
* Update your online presence
* @category Chat
Expand Down Expand Up @@ -914,9 +941,11 @@ export class SenderLayer extends ListenerLayer {

/**
* Sets the chat state
* Deprecated in favor of Use startTyping or startRecording functions
* @category Chat
* @param chatState
* @param chatId
* @deprecated Deprecated in favor of Use startTyping or startRecording functions
*/
public async setChatState(chatId: string, chatState: ChatState) {
return await evaluateAndReturn(
Expand Down

0 comments on commit 8e8d8d5

Please sign in to comment.