Skip to content

Commit

Permalink
fix: DEPRECATED getAllChatsWithMessages getAllChats & getAllGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jun 2, 2023
1 parent e145688 commit 1ad6445
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/api/layers/retriever.layer.ts
Expand Up @@ -114,10 +114,16 @@ export class RetrieverLayer extends SenderLayer {

/**
* Retrieves all chats
* Deprecated in favor of {@link listChats}
*
* @category Chat
* @returns array of [Chat]
* @deprecated Deprecated in favor of listChats.
*/
public async getAllChats(withNewMessageOnly = false) {
this.logger.warn(
'Deprecated: This function [getAllChats] is deprecated in favor of the getList function. Please update your code accordingly.'
);
if (withNewMessageOnly) {
return evaluateAndReturn(this.page, () => WAPI.getAllChatsWithNewMsg());
} else {
Expand Down Expand Up @@ -185,10 +191,16 @@ export class RetrieverLayer extends SenderLayer {

/**
* Retrieves all chats with messages
* Deprecated in favor of {@link listChats}
*
* @category Chat
* @returns array of [Chat]
* @deprecated Deprecated in favor of listChats.
*/
public async getAllChatsWithMessages(withNewMessageOnly = false) {
this.logger.warn(
'Deprecated: This function [getAllChatsWithMessages] is deprecated in favor of the getList function. Please update your code accordingly.'
);
return evaluateAndReturn(
this.page,
(withNewMessageOnly: boolean) =>
Expand All @@ -199,10 +211,16 @@ export class RetrieverLayer extends SenderLayer {

/**
* Retrieve all groups
* Deprecated in favor of {@link listChats}
*
* @category Group
* @returns array of groups
* @deprecated Deprecated in favor of listChats.
*/
public async getAllGroups(withNewMessagesOnly = false): Promise<Chat[]> {
this.logger.warn(
'Deprecated: This function [getAllGroups] is deprecated in favor of the getList function. Please update your code accordingly.'
);
return await evaluateAndReturn(
this.page,
async ({ withNewMessagesOnly }) => {
Expand Down

0 comments on commit 1ad6445

Please sign in to comment.