wppconnect-team / wa-js Goto Github PK
View Code? Open in Web Editor NEWWPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
Home Page: https://wppconnect.io/wa-js/
License: Apache License 2.0
WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
Home Page: https://wppconnect.io/wa-js/
License: Apache License 2.0
Describe the solution you'd like
Oi Edgar boa noite conforme solicitado deixo aqui minha solicitacao.
Basicamente e sobre o catalago.
1 - addProduct - poder adicionar produtos desde api.
2 - editProduct - poder editar um producto por ID
3 - deleteProduct - poder eliminar producto do catalago.
4 - addCollection - poder adicionar uma colecao.
5 - editCollection - poder editar uma colecao
6 - deleteCollecion - poder eliminar uma colecao.
7 - listCollections - poder listar todas as colecoes.
8 - listAllProducts - poder listar todos os productos do catalago.
(obs: talvez aqui vai precisar de um loadproductos para poder carregar mais de 10 no metodo ja existente hoje)
9- listAllProductodCollection - poder listar todos os productos de uma colecao por id da colecao.
desde logo obrigado
I recently had some complaints of undeliverable messages. When debugging I noticed that it is related to the format "@1234", I updated my docker and some messages started to be delivered only on whatsapp of the target cell phone in mention format, but on whatsapp web it is not delivered. The detail is that the message leaves wppconnect, arrives on the cell phone that is linked to it, but often at the destination it is not delivered.
Send a message with the text in the format @1234 using the sendMessage route
É de muita importância, uma função que pudesse verificar o estado atual de uma sessão, se o celular está desconectado ou o se o computador está desconectado por exemplo!
When labels for WhatsApp Business will be implemented?
Just this to WppConnect become completed i think.
Eu tenho uma lista de pessoas que eu deixo bloqueadas de ver meus status e quando fui postar um status, TODOS receberam, sem nenhuma restrição, conforme as configurações de privacidade que eu escolhi no Whatsapp.
Seria interessante que o método respeitasse as configurações que estão no Whatsapp, que podem ser:
1 - Compartilhar com todos os meus contatos
2 - Compartilhar meus contatos, exceto ...
3 - Compartilhar somente com ...
Não encontrei nos fontes nenhuma possibilidade chamar o arquivamento de chat e também para desarquivar.
Se possível implementar, deixa o whatsapp mais leve quando tem muitas conversas.
No wapi existe a função getAllChats que pega a lista de chats no side-panel, porem não achei nada semelhante aqui.
Estou tentando contribui com a lib em c# mas estou meio perdido no wa-js.
When i try to load wppconnect-wa.js using manifest.json content scripts, the WPP gets available in the window object and then disappears. The status never changes for ready.
// manifest.json
{
"manifest_version": 3,
"name": "Hitter",
"homepage_url": "https://hitter.pro",
"description": "Acelere as suas vendas no WhatsApp!",
"update_url": "https://clients2.google.com/service/update2/crx",
"version": "0.0.1",
"permissions": [
"tabs",
"storage",
"webNavigation",
"unlimitedStorage",
"downloads"
],
"action": {
"default_popup": "index.html",
"default_title": "React Browser Extension Template"
},
"web_accessible_resources": [
{
"matches": [
"*://web.whatsapp.com/*"
],
"resources": [
"static/js/content.bundle.js"
]
}
],
"background": {
"service_worker": "static/js/worker.bundle.js"
},
"content_scripts": [
{
"matches": [
"*://web.whatsapp.com/*"
],
"js": [
"static/js/wppconnect-wa.js",
"static/js/content.bundle.js"
]
}
],
"commands": {
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Shift+H",
"mac": "MacCtrl+Shift+H",
"linux": "Ctrl+Shift+H",
"windows": "Alt+Shift+H"
},
"description": "Abre o Hitter"
}
},
"key": ""
}
Boa tarde,
Quando compartilha o link pelo WhatsApp Web cria a thumb perfeito, mas quando o título/descrição tem aspas duplas, fica assim com o " e compartilhando pelo celular fica normal carregando as aspas duplas do titulo/descrição.
Segue o link: https://www.avozdascidades.com.br/noticia/justica-impede-maiara-e-maraisa-de-usar-a-marca-as-patroas
Uma funcionalidade útil seria permitir fixar e desfixar conversas.
PinChat e UnpinChat
// Obter Id e Nomes das Etiquetas criadas no WhatsApp Bussiness
WPP.Labels.GetLabels = function () {
var etiquetas = WPP.whatsapp.LabelStore._models.filter((label) => label.colorIndex);
var names = [];
for (var i = 0; i < etiquetas.length; i++) {
if (etiquetas[i])
{
names.push(etiquetas[i].id + "&" + etiquetas[i].name);
}
}
return names;
};
Estou tentando converter as mensagens de um chat para um JSON mas sem sucesso.
Como o wa-js nao usa o WAPI e sim o WPP, como posso fazer essa conversão para receber um JSON com as mensagens da conversa?
// Número do WhatsApp Conectado na Sessão
WPP.chat.GetMe = async function () {
const result = await WPP.whatsapp.UserPrefs.getMaybeMeUser();
if (result) {
return result.user;
}
};
WPP.chat.markIsComposing('[number]@c.us', 5000));
WPP.chat.markIsRecording('[number]@c.us', 5000);
Testei com a Conversa Aberta no Número do meu teste, e na tela principal conversas do WhatsApp, testei o comando direto no Console do Navegador Chrome e Edge
Como é chamado o registro do evento para saber o status, assim como possui na lib wppconnect-team/wppconnect?
statusFind: (statusSession, session) => {...
`// Obter Contatos Da Agenda
WPP.chat.GetMyContacts = function () {
var contatos = WPP.whatsapp.ContactStore.filter((contact) => contact.isMyContact === true);
var names = [];
for (var i = 0; i < contatos.length; i++) {
if(contatos[i])
{
names.push('+' + contatos[i].id.user + "," + contatos[i].displayName);
}
}
return names;
};`
Pelo que vi, já podemos enviar reações através do WAJS, porém ainda não da pra saber quando uma pessoa que fala comigo, reagiu a uma mensagem que eu enviei.
Unable to send messages getting this error
Uncaught (in promise) Error: wid error: invalid wid: [email protected]
at new l (bootstrap_qr.a93ca7c63be0f2cdef56.js:71:24606)
at s (bootstrap_qr.a93ca7c63be0f2cdef56.js:71:28948)
at Object.d [as createUserWid] (bootstrap_qr.a93ca7c63be0f2cdef56.js:71:29303)
at t.createWid (wp.js:2:182784)
at t.assertWid (wp.js:2:88293)
at t.prepareRawMessage (wp.js:2:120566)
at t.sendRawMessage (wp.js:2:126923)
at Object.t.sendTextMessage (wp.js:2:128197)
The message with buttons can be delivered after adding useTemplateButtons: true
but with an issue:
On the sender side, the Android app will display all messages with buttons in a separate chat room with the sender phone number, as if I am sending the messages to myself. However, the messages are displaying correctly on WhatsApp Web at the right chat rooms.
On the recipient side, the messages are showing correctly both on WhatsApp Web and Android app.
I still have the issue after upgrading the Android app to the latest version. And the same issue happens on WhatsApp Business Android app too.
Originally posted by @ccchai in #570 (comment)
Is there any way I can use it with electron?
I'm injecting the script this way
windowInstance.webContents.executeJavaScript("wa-js")
but I'm not sure how to get the WPP instance
Is there any documentation on how to use this library?
For example, how to get the QrCode or how to send a message?
Para quem utiliza o wpp em grupos, seria interessante essa funcionalidade habilitada.
// Obter Contatos através dos Ids das Etiquetas no WhatsApp Bussiness
WPP.Labels.GetContactLabels = function (id) {
const models = WPP.whatsapp.LabelStore._models.filter((label) => label.id === id).map(c => c.labelItemCollection).map(id => id._models);
let resultado = [];
const chat = 'Chat';
if (models) {
for (let index = 0; index < models.length; index++){
const num = models[index];
for (let ind = 0; ind < num.length; ind++){
let isCOntato = num[ind].__x_parentId.toLowerCase().split("@");
if (isCOntato[1] == "c.us" )
{
if (num[ind])
{
if (num[ind].__x_id.includes(chat))
{
resultado.push(num[ind].__x_id);
}
}
}
}
}
return resultado;
}
};
[[Prototype]]: Promise
[[PromiseState]]: "rejected"
[[PromiseResult]]: Error: wap:queryLabels:unsupported at Object.queryLabels (https://web.whatsapp.com/bootstrap_qr.15b07f37ecbe5a626367.js:48:54727)
Missing options for sticker:
Atualizei para a versão 1.9.1 e método getMessages, não traz a última mensagem enviada/recebida.
Testei na versão 1.9.0 e também acontece a mesma coisa.
Voltei para a versão 1.8.13 que eu estava usando antes de atualizar, e está funcionando normalmente.
Na manhã desta Sexta-feira - 22/04/2022 a função (WPP.contact.queryExists) para verificar a existencia de uma número passou a retornar o erro abaixo:
Uncaught Module Features not found with e=>{var t,r;return(null===(t=e.GK)||void 0===t?void 0:t.supportsFeature)||(null===(r=e.default)||void 0===r?void 0:r.supportsFeature)}
Eu ativo a função setPresenceOnline passando parâmetro FALSE para que o browser não mostre meu status online 24 horas. Na hora que eu ativo essa função, o status fica OFFLINE (isso está correto). Porém, com o passar dos minutos ou horas (não sei como e nem quando acontece) o status ONLINE volta a aparecer....
Detalhe: Eu uso o WPPConnect, só estou abrindo a issue conforme solicitado no grupo WPPConnect:
client.setOnlinePresence(false);
Create an option to change existing group names via ID
Hi WPP.contact.queryExists not working
Poderia ter um evento que quando o QrCode fosse lido, fosse disparado, sendo com sucesso ou não
Quando eu posto um status usando a LIB eu não consigo ver esse status no Aparelho.
Seria interessante se pudéssemos ver o status postado em todos os dispositivos (aparelho, whatsapp web) afim de saber quem visualizou nossos status, cancelar, etc.
Na publicação de uma release, poderia ter a opção de compilar o arquivo js final também
Hi, used to post status messages by sending them to status@broadcast
, but this no longer works. Is there any proposed fix?
Is there any way to categorise chats like only groups, unread messages like in Cooby whatsapp chrome extension?
I am able to set up the environment locally. Can anyone guide me how to and where to write code to send messages using playwright ?
Ao utilizar a função WPP.whatsapp.LabelStore para buscar as etiquetas criadas em minha conta Bussiness, me deparo com a situação da mesma buscar etiquetas que já foram excluidas anteriormente!
Chromium1.Browser.MainFrame.ExecuteJavaScript(comandoJavaScript);
Utilizando a Mesma função envia normal qualquer tipo de imagem, audio e pdf
Anexei o trecho do código
WPP.chat.sendFileMessage();
Criei está função Abaixo para tentar pegar o erro no console, mas não retorna nenhum erro, mas também não envia o vídeo
window.WAPI.sendFileMessage2 = async function(chatid, content, options) {
const result = await WPP.chat.sendFileMessage(chatid, content, options);
if (result) {
try {
SetConsoleMessage("sendFileMessage", JSON.stringify(result));
} catch (err) {
console.log(err);
};
}else {
console.log(err);
}
};
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.github/workflows/build.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
.github/workflows/commitlint.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
wagoid/commitlint-github-action v5.5.1
.github/workflows/docs.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
peaceiris/actions-gh-pages v4
.github/workflows/lint.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
.github/workflows/nightly.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
richardsimko/update-tag v1
.github/workflows/publish.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
.github/workflows/release.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
.github/workflows/test.yml
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
actions/github-script v7
actions/checkout v4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
actions/setup-node v4.0.2
actions/cache v4
nick-invision/retry v3
package.json
@commitlint/cli ^19.3.0
@commitlint/config-conventional ^19.2.2
@commitlint/prompt-cli ^19.3.0
@playwright/test ^1.43.1
@types/debug ^4.1.12
@types/node ^16.18.96
@types/node-fetch ^2.6.11
@types/parse-data-url ^3.0.2
@types/prettier ^3.0.0
@types/shelljs ^0.8.15
@typescript-eslint/eslint-plugin ^7.8.0
@typescript-eslint/parser ^7.8.0
@wppconnect/wa-version ^1.4.108
buffer ^6.0.3
compare-versions ^6.1.0
compressorjs ^1.2.1
conventional-changelog-angular ^7.0.0
conventional-changelog-cli ^4.1.0
debug ^4.3.4
eslint ^8.57.0
eslint-config-prettier ^9.1.0
eslint-plugin-header ^3.1.1
eslint-plugin-import ^2.29.1
eslint-plugin-prettier ^5.1.3
eslint-plugin-simple-import-sort ^12.1.0
eventemitter2 ^6.4.9
file-type ~16.5.4
husky ^9.0.11
lint-staged ^15.2.2
node-fetch ^2.7.0
parse-data-url ^6.0.0
playwright-chromium ^1.43.1
prettier ^3.2.5
release-it ^17.2.1
shx ^0.3.4
ts-loader ^9.5.1
ts-morph ^22.0.0
ts-node ^10.9.2
typedoc ^0.25.13
typedoc-plugin-mdn-links ^3.1.23
typedoc-plugin-missing-exports ^2.2.0
typescript ^5.4.5
typescript-debounce-decorator ^0.0.18
webpack ^5.91.0
webpack-cli ^5.1.4
Allow to send animated stickers
Uma funcionalidade nova, poder enviar reações seria muito bom.
Add function to set group picture
When I upload status - sometimes it works and sometimes it's not.
I can't see the status from my phone, and can't delete it - its super important that we can delete the status.
after I upload the status - my phone's WhatsApp starts to crash for a while.
please help!
Prior to WA-JS 2.9.0, sendLocationMessage does not work
In version 2.9.0, sendLocationMessage works both with or without buttons.
In version 2.10.0, sendLocationMessage works without buttons only. If I add buttons to the message, it won't get delivered
Exemplo que encontrei na internet
{ // It has the same JSON payload as /messages has
// Sending to POST JSON body
"messages": [{
//unique id
"id": "[email protected]_DF38E6A25B42CC8CCE57EC40F",
//text message for type "chat" or link to download the file for "ptt", "image", "audio" and "document"
"body": "Ok!",
//type of the message - "chat" - text, "image" - image, "ptt" - voice, "document" - text document, "audio" - audio file, "call_log" - call
"type": "chat",
//Sender name
"senderName": "Ilya",
//true - outgoing, false - incoming
"fromMe": true,
//Author ID of the message, useful for groups
"author": "[email protected]",
//send time, unix timestamp
"time": 1504208593,
//chat ID
"chatId": "[email protected]",
//sequence number of the message in the database
"messageNumber": 100
}, {
//...
}],
"ack": [{//message delivered
"id": "[email protected]_DF38E6A25B42CC8CCE57EC40F",
"queueNumber": 100
"chatId": "[email protected]",
"status": "delivered",
},{//message viewed
"id": "[email protected]_DF38E6A25B42CC8CCE57EC40F",
"queueNumber": 100
"chatId": "[email protected]",
"status": "viewed",
}, {
//...
}],
}
Add function to set profile picture
Na versão 2.2208.14 do WhatsApp Bussiness MD a lista de chats não lista todos os números que existem no chat!
Utilizando a função WPP.whatsapp.ChatStore.models do WA-JS é possivel ver o resultado disso!
When using sendTextMessage / sendFileMessage / sendLocationMessage with buttons, WhatsApp web will display "Could not deliver message" error. If I remove the buttons, the the message will deliver correctly.
WPP.chat.sendTextMessage(
'[number]@c.us',
'Test message',
{ buttons: [{ id: 'test', text: 'Click here' }] } //will deliver correctly if I remove this line
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.