Skip to content

Commit

Permalink
feat: get version wpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Nov 21, 2024
1 parent 3de0126 commit 8715dda
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/webpack/api/layes/retriever.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ export class RetrieverLayer extends GroupLayer {
number
);
}

/**
* Get version of the current whatsapp
*/
public async getWAVersion() {
return await this.page.evaluate(() => API.getWAVersion());

Check failure on line 59 in src/webpack/api/layes/retriever.layer.ts

View workflow job for this annotation

GitHub Actions / build

Property 'getWAVersion' does not exist on type 'API'.
}
}
2 changes: 2 additions & 0 deletions src/webpack/assets/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
setGroupImage,
getAllChats,
getContact,
getWAVersion
} from './functions';

import {
Expand Down Expand Up @@ -76,6 +77,7 @@ if (typeof window.API === 'undefined') {
window.API.getHost = getHost;
window.API.getAllChats = getAllChats;
window.API.getContact = getContact;
window.API.getWAVersion = getWAVersion;

// Group Functions
window.API.createGroup = createGroup;
Expand Down
7 changes: 7 additions & 0 deletions src/webpack/assets/functions/get-wa-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Returns the current version of the WhatsApp Web API
* @returns
*/
export const getWAVersion =() => {
return window.Debug.VERSION;
}
1 change: 1 addition & 0 deletions src/webpack/assets/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export { getHost } from './get-host';
export { getContact } from './get-contact';
export { getAllChats } from './get-all-chats';
export { getAllContacts } from './get-all-contacts';
export { getWAVersion } from './get-wa-version';

0 comments on commit 8715dda

Please sign in to comment.