Webwhatsapp-wrapper: getGroupMetadata function is not woking

Created on 4 Dec 2019  路  1Comment  路  Source: mukulhase/WebWhatsapp-Wrapper

I was trying to fetch the groups metadata like

WAPI.getGroupMetadata('[email protected]', (done) => console.log(done));

but the getGroupMetadata is throwing the below error

Promise聽{<rejected>: TypeError: output.update is not a function at Object../chrome/src/wapi.js.window.WAPI.getGroupM鈥

Most helpful comment

I also encountered the same error and managed to solve it by using the update function in window.Store.GroupMetadata instead. Below is my updated WAPI.getGroupMetadata function:

window.WAPI.getGroupMetadata = async function (id, done) {
    let output = window.Store.GroupMetadata.get(id);
    if (output !== undefined) {
        if (output.stale) {
            await window.Store.GroupMetadata.update(id); // instead of output.update()
        }
    }
    if (done !== undefined) done(output);
    return output;
};

I hope this will help.

>All comments

I also encountered the same error and managed to solve it by using the update function in window.Store.GroupMetadata instead. Below is my updated WAPI.getGroupMetadata function:

window.WAPI.getGroupMetadata = async function (id, done) {
    let output = window.Store.GroupMetadata.get(id);
    if (output !== undefined) {
        if (output.stale) {
            await window.Store.GroupMetadata.update(id); // instead of output.update()
        }
    }
    if (done !== undefined) done(output);
    return output;
};

I hope this will help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smileman03 picture smileman03  路  5Comments

shakraw picture shakraw  路  5Comments

FeezyHendrix picture FeezyHendrix  路  3Comments

desstannoz picture desstannoz  路  4Comments

rzlnhd picture rzlnhd  路  3Comments