open-wa/wa-automate-nodejs

TypeError: chat.sendMessage is not a function when using client.tagEveryone #1005

tcortega posted onGitHub

<!-- READ THIS FIRST: - Make sure you are running the latest version of @open-wa/wa-automate before reporting an issue. - Provide as many details as possible. Paste logs, configuration samples and code into the backticks. DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment. -->

Describe the bug When attempting to use client.tagEveryone() on a groupd, it gives me the following error: Error: Evaluation failed: TypeError: chat.sendMessage is not a function

Steps to Reproduce Attempt to use the feature, where.

create() code This is the code you use to create the client. e.g

create({
        licenseKey: '#############################',
        headless: headless,
        qrRefreshS: 20,
        qrTimeout: 0,
        authTimeout: 0,
        autoRefresh: true,
        restartOnCrash: start,
        cacheEnabled: false,
        logConsole: true,
        useChrome: true,
        killProcessOnBrowserClose: true,
        throwErrorOnTosBlock: false
    }).then((client) => start(client))
    .catch((err) => new Error(err))

Expected behavior Should give you an error of Error: Evaluation failed: TypeError: chat.sendMessage is not a function

DEBUG INFO This is the info printed to the console when you start your app. It should look like this

Debug Info {
WA_VERSION: '2.2043.8',
PAGE_UA: 'WhatsApp/2.2037.6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36',
WA_AUTOMATE_VERSION: '3.0.6',
BROWSER_VERSION: 'HeadlessChrome/87.0.4272.0'                 
}

Screenshots No need

Host (please complete the following information):

  • OS: Windows 10 Pro v2004. OS Compilation version is 1904.572

Additional context Code being used:

if (isGroupMsg) {
    await client.tagEveryone(message.chatId, 'test')
}

GroupId logged: 55#########1-1549####01@g.us (Just to show that its just fine)


have you tried

    const tagResult = await client.tagEveryone(message.from, 'test')
    console.log(tagResult)

can you share tagResult, please

posted by smashah about 4 years ago

have you tried

    const tagResult = await client.tagEveryone(message.from, 'test')
    console.log(tagResult)

can you share tagResult, please

As weird as it seems, it works fine on some groups, but on the one I'm trying. On the one it isn't working, I get the same error: Error: Evaluation failed: TypeError: chat.sendMessage is not a function

posted by tcortega about 4 years ago

please provide a screenshot of that group

posted by smashah about 4 years ago

please provide a screenshot of that group

It started working, I don't know how, but it did. Do you still want?

posted by tcortega about 4 years ago

Clossing issue due to no response, although the situation is still weird.

posted by tcortega about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests