Skip to content

Commit

Permalink
fix: chat opening methods accept a Wid param
Browse files Browse the repository at this point in the history
  • Loading branch information
gekkedev authored Nov 6, 2024
1 parent 1ea86b8 commit 39864c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/layers/ui.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { Page } from 'puppeteer';
import { CreateConfig } from '../../config/create-config';
import { evaluateAndReturn } from '../helpers';
import { Wid } from '../model';
import { GroupLayer } from './group.layer';

export class UILayer extends GroupLayer {
Expand All @@ -31,7 +32,7 @@ export class UILayer extends GroupLayer {
* @category UI
* @param chatId
*/
public async openChat(chatId: string) {
public async openChat(chatId: string | Wid) {
return evaluateAndReturn(
this.page,
(chatId: string) => WPP.chat.openChatBottom(chatId),
Expand All @@ -45,7 +46,7 @@ export class UILayer extends GroupLayer {
* @param chatId Chat id
* @param messageId Message id (For example: '06D3AB3D0EEB9D077A3F9A3EFF4DD030')
*/
public async openChatAt(chatId: string, messageId: string) {
public async openChatAt(chatId: string | Wid, messageId: string) {
return evaluateAndReturn(
this.page,
(chatId: string, messageId) => WPP.chat.openChatAt(chatId, messageId),
Expand Down

0 comments on commit 39864c4

Please sign in to comment.