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)