Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getChatById also accepts a Wid as input param #2353

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/api/layers/retriever.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class RetrieverLayer extends SenderLayer {
* Checks if a number is a valid WA number
* @category Contact
* @param contactId, you need to include the @c.us at the end.
* @returns contact detial as promise
* @returns contact details as promise
*/
public async checkNumberStatus(contactId: string): Promise<WhatsappProfile> {
return await evaluateAndReturn(
Expand Down Expand Up @@ -256,7 +256,7 @@ export class RetrieverLayer extends SenderLayer {
* Retrieves contact detail object of given contact id
* @category Contact
* @param contactId
* @returns contact detial as promise
* @returns contact details as promise
*/
public async getContact(contactId: string) {
return evaluateAndReturn(
Expand All @@ -279,9 +279,9 @@ export class RetrieverLayer extends SenderLayer {
* Retrieves chat object of given contact id
* @category Chat
* @param contactId
* @returns contact detial as promise
* @returns chat details as promise
*/
public async getChatById(contactId: string): Promise<Chat> {
public async getChatById(contactId: string | Wid): Promise<Chat> {
return evaluateAndReturn(
this.page,
(contactId) => WAPI.getChatById(contactId),
Expand All @@ -293,10 +293,10 @@ export class RetrieverLayer extends SenderLayer {
* Retrieves chat object of given contact id
* @category Chat
* @param contactId
* @returns contact detial as promise
* @returns chat details as promise
* @deprecated
*/
public async getChat(contactId: string) {
public async getChat(contactId: string | Wid) {
return this.getChatById(contactId);
}

Expand All @@ -323,7 +323,7 @@ export class RetrieverLayer extends SenderLayer {
* @deprecated Depreciado em favor de getMessages
* @category Chat
* @param contactId
* @returns contact detial as promise
* @returns contact details as promise
*/
public async loadEarlierMessages(contactId: string) {
return evaluateAndReturn(
Expand Down Expand Up @@ -360,7 +360,7 @@ export class RetrieverLayer extends SenderLayer {
* @deprecated Deprecated in favor of checkNumberStatus
* @category Contact
* @param contactId, you need to include the @c.us at the end.
* @returns contact detial as promise
* @returns contact details as promise
*/
public async getNumberProfile(contactId: string) {
this.log(
Expand Down
Loading