GithubHelp home page GithubHelp logo

wppconnect-team / wppconnect-server Goto Github PK

View Code? Open in Web Editor NEW
628.0 46.0 359.0 61.77 MB

Wppconnect Server is a ready-to-use API, just download, install, and start using, simple as that.

Home Page: https://wppconnect.io/swagger/wppconnect-server/

License: Apache License 2.0

Shell 0.08% Dockerfile 0.29% TypeScript 99.59% JavaScript 0.04%
wppconnect wppconnect-server whatsapp whatsapp-web whatsapp-bot whatsapp-api

wppconnect-server's Introduction

WPPConnect Team

WPPConnect Server

WPPConnect-SERVER

npm version Downloads Average time to resolve an issue Percentage of issues still open Build Status Build release-it

Welcome to the WPPConnect Server repository, developed by the WPPConnect Team. Our mission is to provide a robust and ready-to-use API for seamless communication with WhatsApp. The server is designed to streamline the process of sending and receiving messages, managing contacts, creating groups, and much more, all while leveraging the power of JavaScript ES6, NodeJS, and a RESTful architecture.

  • Javascript ES6
  • NodeJS
  • Restfull

Our online channels

Connect with us across various platforms to stay updated and engage in discussions:

Discord Telegram Group WhatsApp Group YouTube

Documentations

Detailed documentation and guides are available for your convenience:

  • Postman
  • Swagger
  • Swagger UI can be accessed on your server through the route: "IP:PORT/api-docs"

Features

Multiple Sessions
Send text, image, video and docs
Get contacts list
Manage products
Receive/Send messages
Open/Close Session
Change Profile/Username
Create Group
Join Group by Invite Code
Webhook

Libraries Used

  • WPPConnect
  • Axios
  • Bcrypt
  • Cors
  • Dotenv
  • Express
  • Nodemon
  • SocketIO
  • S3

Installation

Install the dependencies and start the server.

yarn install
//or
npm install

Install puppeteer dependencies:

sudo apt-get install -y libxshmfence-dev libgbm-dev wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils libvips-dev

Install google chrome

wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo apt-get update

sudo apt-get install libappindicator1

sudo dpkg -i google-chrome-stable_current_amd64.deb

Troubleshooting

If you encounter installation issues, please try the procedures below . Error Sharp Runtime

    yarn add sharp
    npm install --include=optional sharp
    //or
    yarn add sharp --ignore-engines

Run Server

yarn dev

Build Server

yarn build

Configuration

This server use config.ts file to define some options, default values are:

{
  /* secret key to genereta access token */
  secretKey: 'THISISMYSECURETOKEN',
  host: 'http://localhost',
  port: '21465',
  // Device name for show on whatsapp device
  deviceName: 'WppConnect',
  poweredBy: 'WPPConnect-Server',
  // starts all sessions when starting the server.
  startAllSession: true,
  tokenStoreType: 'file',
  // sets the maximum global listeners. 0 = infinity.
  maxListeners: 15,
  // create userDataDir for each puppeteer instance for working with Multi Device
  customUserDataDir: './userDataDir/',
  webhook: {
    // set default webhook
    url: null,
    // automatically downloads files to upload to the webhook
    autoDownload: true,
    // enable upload to s3
    uploadS3: false,
    // set default bucket name on aws s3
    awsBucketName: null,
    //marks messages as read when the webhook returns ok
    readMessage: true,
    //sends all unread messages to the webhook when the server starts
    allUnreadOnStart: false,
    // send all events of message status (read, sended, etc)
    listenAcks: true,
    // send all events of contacts online or offline for webook and socket
    onPresenceChanged: true,
    // send all events of groups participants changed for webook and socket
    onParticipantsChanged: true,
    // send all events of reacted messages for webook and socket
    onReactionMessage: true,
    // send all events of poll messages for webook and socket
    onPollResponse: true,
    // send all events of revoked messages for webook and socket
    onRevokedMessage: true,
    // send all events of labels for webook and socket
    onLabelUpdated: true,
    // 'event', 'from' ou 'type' to ignore and not send to webhook
    ignore: [],
  },
  websocket: {
    // Just leave one active, here or on webhook.autoDownload
    autoDownload: false,
    // Just leave one active, here or on webhook.uploadS3, to avoid duplication in S3
    uploadS3: false,
  },
  // send data to chatwoot
  chatwoot: {
    sendQrCode: true,
    sendStatus: true,
  },
  //functionality that archives conversations, runs when the server starts
  archive: {
    enable: false,
    //maximum interval between filings.
    waitTime: 10,
    daysToArchive: 45,
  },
  log: {
    level: 'silly', // Before open a issue, change level to silly and retry a action
    logger: ['console', 'file'],
  },
  // create options for using on wppconnect-lib
  createOptions: {
    browserArgs: [
      '--disable-web-security',
      '--no-sandbox',
      '--disable-web-security',
      '--aggressive-cache-discard',
      '--disable-cache',
      '--disable-application-cache',
      '--disable-offline-load-stale-cache',
      '--disk-cache-size=0',
      '--disable-background-networking',
      '--disable-default-apps',
      '--disable-extensions',
      '--disable-sync',
      '--disable-translate',
      '--hide-scrollbars',
      '--metrics-recording-only',
      '--mute-audio',
      '--no-first-run',
      '--safebrowsing-disable-auto-update',
      '--ignore-certificate-errors',
      '--ignore-ssl-errors',
      '--ignore-certificate-errors-spki-list',
      '--disable-features=LeakyPeeker' // Disable the browser's sleep mode when idle, preventing the browser from going into sleep mode, this is useful for WhatsApp not to be in economy mode in the background, avoiding possible crashes
    ],
  },
  mapper: {
    enable: false,
    prefix: 'tagone-',
  },
  // Configurations for connect with database
  db: {
    mongodbDatabase: 'tokens',
    mongodbCollection: '',
    mongodbUser: '',
    mongodbPassword: '',
    mongodbHost: '',
    mongoIsRemote: true,
    mongoURLRemote: '',
    mongodbPort: 27017,
    redisHost: 'localhost',
    redisPort: 6379,
    redisPassword: '',
    redisDb: 0,
    redisPrefix: 'docker',
  },
  // Your configurations yo upload on AWS
  aws_s3: {
    region: 'sa-east-1',
    access_key_id: '',
    secret_key: '',
    // If you already have a bucket created that will be used. Will bestored: you-default-bucket/{session}/{filename}
    defaultBucketName: ''
  },
}

Secret Key

Your secretKey is inside the config.ts file. You must change the default value to one that only you know.

Generate Token

To generate an access token, you must use your SECRET_KEY.

Using the route:

  curl -X POST --location "http://localhost:21465/api/mySession/THISISMYSECURETOKEN/generate-token"

Response:

{
  "status": "Success",
  "session": "mySession",
  "token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
  "full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
}

Using Token

Save the value of the "full" response. Then use this value to call the routes.

Examples

#Starting Session
# /api/:session/start-session

curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
#Get QrCode
# /api/:session/start-session
# when the session is starting if the method is called again it will return the base64 qrCode

curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
#Send Message
# /api/:session/send-message
curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
    -H "Content-Type: application/json; charset=utf-8" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
    -d "{
          \"phone\": \"5511900000000\",
          \"message\": \"*Abner* Rodrigues\"
        }"

See the routes file for all the routes. here and HTTP file.

Swagger UI

Swagger ui can be found at /api-docs

wppconnect-server's People

Contributors

bgastaldi avatar chocopie02 avatar dependabot[bot] avatar dudanogueira avatar edgardmessias avatar eduandy avatar fabioselau077 avatar fnevesgx avatar gabrielbragagit avatar ghsgabriel avatar github-actions[bot] avatar hbdbim avatar icleitoncosta avatar igordepaula avatar joaogabrieldepaula avatar joselourenc0 avatar leandrosroc avatar leobevi avatar miguelurtado avatar moskoweb avatar mvfernandes avatar rcovery avatar renat473 avatar renovate-bot avatar renovate[bot] avatar robson-pds avatar rodriguesabner avatar saifallak avatar tomsilva avatar wduandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wppconnect-server's Issues

ERRO DE TOKEN

Ao tentar iniciar a sessão do token e informado que é invalido

Erro ao enviar arquivo (imagem)

Description

Ocorreu erro no server ao enviar arquivo.

Environment

  • Wppconnect version(s): 1.8.8
  • Browser: [Chrome version 92.0.4515.107]
  • OS: [Ubuntu 20.04.2 LTS]
  • Node version: [14.17.2]

Steps to Reproduce

Enviei uma inagem para um whatsapp e o envio foi OK
Na sequência fiz o envio para outro número, exibiu erro no server, retornou json de erro pelo php-client, mas enviou a mensagem.
Reiniciei o server e enviei para o mesmo número que havia dado erro anteriormente e funcionou normalmente.

Log Output

Erro no server:
error: 2021-07-27T16:52:14.484Z MediaFileEmpty - Error: MediaFileEmpty
at Object.sendToChat (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:18:168285)
at Object. (/home/ubuntu/ozap/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:38410)
at Generator.next ()
at He (/home/ubuntu/ozap/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:37699)
at a (/home/ubuntu/ozap/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:37903)
at q (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:2:353990)
at MutationObserver.H (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:2:353571)

e o retorno da chamada da função pelo php-client foi esta:

Array
(
[status] => Error
[message] => Erro ao enviar a mensagem.
[session] => 5513871974900873
)

Additional context / Screenshot

Utilizo o php-client para interagir com o server

Erro ao criar um grupo

Por favor poderia verificar se tem algum problema ao criar um grupo, aqui usando o endpoint create-group

curl -X 'POST'
'http://obian.com.br:3333/api/Obian/create-group'
-H 'accept: /'
-H 'Authorization: Bearer $2b$10$NIQ_Qw7oYDoppBT1.OSD_e_WLOyfmrwFEM.nrL5ZdHERuyHJxIgD2'
-H 'Content-Type: application/json'
-d '{
"name": "This is My Group",
"participants": ["554884288998","554899797488"]
}'

A resposta é que teve um erro ao criar o grupo

no server a info dos erros são:
error: 2021-06-09T11:08:27.167Z Evaluation failed: TypeError: window.Store.WapQuery.createGroup is not a function
at Object.window.WAPI.window.WAPI.createGroup (/home/ubuntu/wppconnect/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:35707) - Error: Evaluation failed: TypeError: window.Store.WapQuery.createGroup is not a function
at Object.window.WAPI.window.WAPI.createGroup (/home/ubuntu/wppconnect/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:35707)
at ExecutionContext._evaluateInternal (/home/ubuntu/wppconnect/wppconnect-server/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at ExecutionContext.evaluate (/home/ubuntu/wppconnect/wppconnect-server/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)

Double @c.us

I start wppconnect-server and connect wppconnect-client to wppconnect-server successfully.
I login to UI and receive error in server console

invalid wid

info: 2021-05-14T15:58:40.037Z Started Session: mySession
info: 2021-05-14T15:58:40.038Z mySession : Inicio enviar mensagens n�o lidas
info: 2021-05-14T15:58:40.038Z mySession : Inicio arquivando chats
info: 2021-05-14T15:58:40.253Z mySession : Fim enviar mensagens n�o lidas
info: 2021-05-14T15:58:40.553Z ID: icNSSuqUNWQafdgOAAAB saiu
info: 2021-05-14T15:58:41.149Z ID: wmRjtzppFZzY-SytAAAD entrou
[]
info: 2021-05-14T15:58:46.565Z mySession : Fim arquivando chats
error: 2021-05-14T15:59:15.166Z Evaluation failed: Error: wid error: invalid wid: [email protected]@c.us
    at new c (https://web.whatsapp.com/bootstrap_qr.21cdeb5afaacd0e5706a.js:1:1098920)
    at new s (https://web.whatsapp.com/bootstrap_qr.21cdeb5afaacd0e5706a.js:1:1103210)
    at Object.window.WAPI.window.WAPI.checkNumberStatus (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:64659)
    at async Object.window.WAPI.window.WAPI.sendExist (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:31695)
    at async Object.window.WAPI.window.WAPI.getAllMessagesInChat (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:56557) - Error: Evaluation failed: Error: wid error: invalid wid: [email protected]@c.us
    at new c (https://web.whatsapp.com/bootstrap_qr.21cdeb5afaacd0e5706a.js:1:1098920)
    at new s (https://web.whatsapp.com/bootstrap_qr.21cdeb5afaacd0e5706a.js:1:1103210)
    at Object.window.WAPI.window.WAPI.checkNumberStatus (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:64659)
    at async Object.window.WAPI.window.WAPI.sendExist (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:31695)
    at async Object.window.WAPI.window.WAPI.getAllMessagesInChat (/home/sergey/Projects/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/lib/wapi/wapi.js:1:56557)
    at ExecutionContext._evaluateInternal (/home/sergey/Projects/wppconnect-server/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ExecutionContext.evaluate (/home/sergey/Projects/wppconnect-server/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)

error after mobile logout

desconnectedMobile

info: [test:token] Removind token file...
warn: [test:token] Not Files: /project/tokens/test.data.json
error: [test:page] Page Closed
browserClose

(node:656973) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, unlink '/project/tokens/test.data.json'

Rota Close Nao funciona

Caso ocorra de nao ler o qrcode e a funcao auto close ser chamada, não é possivel chamar a rota close session, ela fica rodando sem resposta e não fecha o navegador.

erro ao fechar sessao direto no celular e tambem no metodo logout

cuando fehco a sessao direto no celular me sai essa mensagem

error: [teste:page] Page Closed
info: 2021-06-12T20:46:37.329Z browserClose

warn: [teste:client] Failed to authenticate
info: 2021-06-12T20:46:37.573Z qrReadError

error: [teste:client] Unknow error

logo depois quando vou tentar reconectar o celullar sai esse erro

error: 2021-06-12T20:52:24.516Z Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed. - Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
at CDPSession.send (D:\wppserver2\wppconnect-server\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:195:35)
at ExecutionContext._evaluateInternal (D:\wppserver2\wppconnect-server\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:200:50)
at ExecutionContext.evaluate (D:\wppserver2\wppconnect-server\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:106:27)
at DOMWorld.evaluate (D:\wppserver2\wppconnect-server\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:90:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
info: 2021-06-12T20:54:17.613Z State Change OPENING: teste
info: 2021-06-12T20:54:17.614Z State Change OPENING: teste
info: 2021-06-12T20:54:17.773Z State Change PAIRING: teste
info: 2021-06-12T20:54:17.775Z State Change PAIRING: teste
info: 2021-06-12T20:54:20.166Z State Change CONNECTED: teste
info: 2021-06-12T20:54:20.167Z State Change CONNECTED: teste
warn: [teste:token] Failed to update session token

e esse e um fatal error por que ja nao consigo abrir a sessao novamente so reiniaindo o server

Erro ao iniciar

Olá,

Quando fui tentar iniciar a aplicação apresentou o erro abaixo.

image

Endpoint para Deletar Token ou Regenerar.

Conforme conversado no grupo do WhatsApp, seria bom ter um endpoint para que seja apagado o token.data.json em situação que o número é banido e que precise reconectar.

Erro ao enviar msg para grupos

Estou enviando mensagem para grupo usando esse json:
{
"isGroup" : true,
"message" : "Mensagem ",
"phone" : "id do grupo"
}
mas a resposta é sempre essa:
{
"message" : "O número id do grupo não existe.",
"response" : null,
"session" : "Sessao",
"status" : "Connected"
}
Esse erro apareceu depois de uma atualização.

Quebra ao Enviar Contato Inválido

Se tenta fazer o envio de um contato vCard de número inválido ou fora do WhatsApp, ele quebra a aplicação, reiniciando tudo de novo.

Erro de Requisição com 9º Digito

Ao realizar uma solicitação para o endpoint archive-chat, se informar o número com o nono digito ele fica rodando e rodando até dar timeout na requisição.

Porém quando tira o nono digito ele já executa a solicitação.

O ideal seria verificar o número junto ao WhatsApp, e pegar o id real dele no WhatsApp antes de cada requisição, como o check-number-status faz para não ter erro de solicitação perdida.

Error: no open browser no linux

Estou tentando rodar o session-start mas o server sempre retorna esse erro dizendo que não abriu o browser, testei no Windows tanto com npm run dev quanto com build e funciona tranquilo envia mensagem ok, no ubuntu da esse erro
issuigit

Alterar arquivo de configurações para .env

Não seria mais interessante ter a opção de subir um arquivo .env para complementar o src/config.json?
Estou iniciando a utilização do wppconnect agora, dai me surgiu uma questão: Se quero compartilhar os arquivos entre desenvolvedores, ou até mesmo postar no github como código aberto ou ainda alternar entre o meu computador e o ambiente de produção, vou ficar amarrado ao arquivo config.json. Porém se eu pudesse utilizar um arquivo .env, e a função initServer ficasse responsável por fazer as substituições ficaria mais fácil.

Host Device (nao sei fazer pull

eu nao sei criar um pull aqui mais aqui esta funcionando o metodo host device

export async function getHostDevice(req, res) {
try {
const response = await req.client.getHostDevice();
return res.status(200).json({
"phone": response.wid.user,
"connected": response.connected,
"platform": response.platform,
"locales": response.locales,
"plugged": response.plugged,
"battery": response.battery,
"pushname": response.pushname
});
} catch (e) {
Logger.error(e);
return res.status(400).json({status: "Error", message: "Erro ao recuperar dados do telefone"});
}
}

antes estava assim
export async function getHostDevice(req, res) {
try {
const response = await req.client.getHostDevice();
return res.status(200).json({
"phone": response.user,
"connected": response.connected,
"plataform": response.plataform,
"locales": response.locales,
"plugged": response.plugged,
"batery": response.batery,
"pushname": response.pushname
});
} catch (e) {
Logger.error(e);
return res.status(400).json({status: "Error", message: "Erro ao recuperar dados do telefone"});
}
}

Erro para ler mensagem não lidas ao iniciar

Erro quando vai reinicializar e precisa carregar as mensagens não lidas.

error: 2021-06-02T15:29:26.769Z Cannot read property 'length' of undefined - TypeError: Cannot read property 'length' of undefined
    at _callee5$ (/root/wppconnect-server/dist/util/functions.js:195:63)
    at tryCatch (/root/wppconnect-server/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/root/wppconnect-server/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.<computed> [as next] (/root/wppconnect-server/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/root/wppconnect-server/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /root/wppconnect-server/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

chat-is-online

Quando fiz a consulta com o 9 digito, deu como false, removi o 9 digito, deu true.
Coloquei um console log na função getChatIsOnline, para verificar e o resultado era esse:
55XXXXXXXXXX phone
true response
55XX9XXXXXXXX phone
false response

Erro ao realizar nova Conexão

Quando vou fazer uma nova conexão, depois da atualização começou a aparecer o seguinte erro.

{"name":"ServerStatusCodeError","stack":"ServerStatusCodeError\n at new i (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:2:382908)\n at new i (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:7:67033)\n at https://web.whatsapp.com/bootstrap_main.0f4eab45314264df4066.js:8:37922\n at q (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:2:353990)\n at MutationObserver.H (https://web.whatsapp.com/bootstrap_qr.f61502d6311fd24214d7.js:2:353571)","status":401,"statusCode":401} - ServerStatusCodeError

E ai ele reinicia todas as sessões, o que é um incomodo quando tem mais de 30.

fechar sessoes do whatsapp

tenho 2 problemas
1 - fechar a sessao pelo metodo close-session
2 - fechar a sessao pelo telefone diretamente.

1 - cuando chamo o metodo para fechar a sessao a mesa fecha no server mais nao finalzia no telefone, dai cuando dou um start-session automaticamente se reconecta.

2 - se fecho a sessao somente pelo telefone nao fecha a sessao na api, respondendo no check-session sempre true conected.....

Error on forward message

Description

Hello! I'm getting the following error when trying to forward a message

rror: 2021-06-28T05:27:53.391Z Cannot read property '_serialized' of undefined - TypeError: Cannot read property '_serialized' of undefined at forwardMessages (/opt/wppconnect-server/src/controller/deviceController.js:327:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:28:00.496Z message is missing critical data needed to download the file. - Error: message is missing critical data needed to download the file. at Whatsapp.<anonymous> (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:319:35) at step (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:64:23) at Object.next (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:45:53) at /opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:39:71 at new Promise (<anonymous>) at __awaiter (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:35:12) at Whatsapp.decryptFile (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:311:16) at getMediaByMessage (/opt/wppconnect-server/src/controller/sessionController.js:217:33) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:28:01.719Z message is missing critical data needed to download the file. - Error: message is missing critical data needed to download the file. at Whatsapp.<anonymous> (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:319:35) at step (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:64:23) at Object.next (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:45:53) at /opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:39:71 at new Promise (<anonymous>) at __awaiter (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:35:12) at Whatsapp.decryptFile (/opt/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:311:16) at getMediaByMessage (/opt/wppconnect-server/src/controller/sessionController.js:217:33) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:28:23.495Z Cannot read property '_serialized' of undefined - TypeError: Cannot read property '_serialized' of undefined at forwardMessages (/opt/wppconnect-server/src/controller/deviceController.js:327:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:45:57.974Z Cannot read property '_serialized' of undefined - TypeError: Cannot read property '_serialized' of undefined at forwardMessages (/opt/wppconnect-server/src/controller/deviceController.js:327:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:45:58.176Z Cannot read property '_serialized' of undefined - TypeError: Cannot read property '_serialized' of undefined at forwardMessages (/opt/wppconnect-server/src/controller/deviceController.js:327:23) at processTicksAndRejections (internal/process/task_queues.js:97:5) error: 2021-06-28T05:58:15.774Z Cannot read property '_serialized' of undefined - TypeError: Cannot read property '_serialized' of undefined at forwardMessages (/opt/wppconnect-server/src/controller/deviceController.js:327:23) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5)

Another problem with this method is when i try to forward big files like 80MB+, the webhook crashed for some reason and i need to restart the server to get it work.

Limite de Memoria

Desde a última atualização, começou a dar o seguinte erro no painel, mesmo tendo mais que o dobro de memoria ram sobrando ainda:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit

Add new feature setProfileBusiness

Verificar possibilidade de Adicionar uma função onde passamos por parâmetro os updates para alterar o whatsApp Business

{
name,
description,
category,
address,
officeHours,
email,
site
}

se já no update conseguir fazer do recado também seria legal, evitando assim ter dois updates para fazer alterações.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.