Commit Graph

47 Commits

Author SHA1 Message Date
Rajeh Taher
b1693b49e0 merge (#1635)
* updating forward documentation. (#1624)

* updating forward documentation.

* Update Message.js

* Update index.d.ts

* Update docs/Message.html

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* fix: `star` Error: Evaluation failed: TypeError: msg.chat.sendStarMsgs is not a function (#1598)

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* Update User agent (#1470)

I encountered errors because of this (it says that the chrome version needs to be updated)

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* feat: [Updated] Loading screen listener with percent and message (#1563)

* last update

* eslint fix

* headless fix

* Update index.d.ts

Co-authored-by: stefanfuchs <stefan1234@gmail.com>

* Update index.d.ts - Add 'LOADING_SCREEN' type to Enum

Co-authored-by: stefanfuchs <stefan1234@gmail.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* feat: Adding file size by bytes to MessageMedia (#1273)

* Update index.d.ts

* Update Message.js

* Update Message.js

* Update MessageMedia.js

* Update MessageMedia.js

* Fix: Cannot read properties of undefined (reading 'id') (#1604)

This change fix `react` evaluation:

```
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'id')
    at Object.<anonymous> (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:103021)
    at Generator.next (<anonymous>)
    at t (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66483)
    at s (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66694)
    at https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66753
    at Y (https://web.whatsapp.com/bootstrap_qr.f74b98c729dd38392a5f.js:37:128505)
    at new y (https://web.whatsapp.com/bootstrap_qr.f74b98c729dd38392a5f.js:37:121072)
    at Object.<anonymous> (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66634)
    at Object.k (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:105511)
    at Object.t.sendReactionToMsg (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:102647)
    at ExecutionContext._evaluateInternal (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Message.react (/app/node_modules/whatsapp-web.js/src/structures/Message.js:344:9)
```

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* Feat: add message_reaction event (#1619)

* Add 'message_reaction' event

Co-authored-by: Nowbie S <33182389+NowDev@users.noreply.github.com>
Co-authored-by: Ruvian S <12111730+matricce@users.noreply.github.com>
Co-authored-by: Yehuda Eisenberg <32451776+YehudaEi@users.noreply.github.com>
Co-authored-by: tonbotfy <106827778+tonbotfy@users.noreply.github.com>
Co-authored-by: stefanfuchs <stefan1234@gmail.com>
Co-authored-by: Jeremy Andes <73316325+jeremyandes@users.noreply.github.com>
Co-authored-by: Wictor Nogueira <57378387+wictornogueira@users.noreply.github.com>
2022-08-10 13:46:16 +03:00
Alon Schwartzblat
61c0a6be56 Reaction feature added. (#1400)
* Fix get order.

* Fix types.

* Add set picture for profile and for groups.

* Fix bug.

* Fix

* Fix types

* Fix eslint

* Add send reaction feature.

* Add send reaction feature.

* Add set picture for profile and for groups.

* Add send reaction feature.

* Add send reaction feature.

* Add send reaction feature.

* Add send reaction feature.

* Add send reaction feature.

* Add send reaction feature.

* Update src/structures/Reaction.js

Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>

* Bug fixes.

* Bug fixes.

* Bug fixes.

* Fix

* Fix

* Fix example

* Fix conflict

* Fix conflict

* Fix conflict

* Fix conflict

* Fix conflict

* Fix conflict

* move implementation to message model

Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
2022-06-21 00:46:07 -04:00
Pedro S. Lopez
f6de161c7d Auth Strategies (#1257)
* auth strategies

* default to no auth

* rename base auth strategy

* rename base strategy cont.

* refactor auth strategy methods and LocalAuth

* activate old session options even if is falsy value

* move restartOnAuthFail to LegacyAuthStrategy option

* add link to guide item

* update example/shell

* types
2022-02-27 22:02:49 -04:00
Rajeh Taher
0d55d40885 feat: Multi-device support (#889)
* 🚑 Added ready selector for multi-device

* SendMessage fix

* File management system and some fixes

* cleanup

* cleanup again

* eslint

* critical fix for reloading the same session

* Checking for valid folder name (regex)

* ESLint hotfix (regex escapes)

* Typings cleanup

* cleanup listener

* Multi-device Branch merge (#888)

* Duplicate

* qr fix and allow non-beta users to connect

* urgent: selector fix

* urgent: qr timeout fix

* fix

* Updated type so no TS error when sending list/buttons

* Update index.d.ts

* fix QueryExist for Multidevice (#928)

* creates isRegisteredUserBeta

* fix QueryExist

* fix Error: GROUP_JID: invalid jid type: Not an instance of WID issue (#926)

* fix Error: GROUP_JID: invalid jid type: Not an instance of WID issue

* clean code

* Cleanup

* Fix for update chrome error

* ESLint fix

* :red_light: fix for RMDIR

* Update README.md

* Update README.md

* fix: getProfilePicUrl fix by victormga (#941)

* fix: MD presence available/unavailable (#942)

* delete session when appropriate & fix for SW

* ignore QR timeout errors

* Presence and ChatState updates working for MD+Non-MD

* shell uses new session storage

* lint fix

* support session.json-based auth for non-md

* md fix

* md fix

* fix shell clientId

* remove exclusive mocha test

* make linkPreview default to false

* remove ignored errors on getQuotedMessage

* fix: dont modify existing this.options.puppeteer object

* tests work with new dir auth

* remove exclusive test

* fixes and tests for group creation and participant functions

* remove unused function

* wip fix group settings functions

* isRegisteredUser && getNumberId hotFix (#955)

* isRegisteredUser && getNumberId hotFix

A fix for client.isRegisteredUser and client.getNumberId. Use for reference or if you are stuck with MD and NEEDS this function. Problably Whatsapp will break this in a couple weeks

* fix for non-md

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* Fix WA 2.2146.9 MD +  victormga branch (#991)

* qrcode now uses observers instead of timeout

* automatic auth/qrcode detection

* Fix WA 2.2146.9 MD

Got from github:victormga/whatsapp-web.js#multidevice maybe it's behind pedro branch

Co-authored-by: victormga <victor_mga@hotmail.com>

* fix

* fix*

* getnumberid to multidevice (#1027)

* getNumberId to main

 isRegisteredUser && getNumberId hotFix #955 To main

* Update Client.js

Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>

* Update Client.js

* Message.raw() (#1005)

* Message.raw()

* i just noticed

* Update index.d.ts

* Update index.d.ts

* Update Message.js

* Get rid of sharp now!!!!!!!! (#1045)

* commit 1

* finally, gotten rid of sharp

* pckg.json

* service worker fix & disableMessage option

* typings

* Update example.js

* clear session system

* Update Client.js

* Update Client.js

* Fix accepting group private invite (#1094)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [MD] Add getCommonGroups with specific user. (#1097)

* Add getCommonGroups with specific user.

* Fix

* Fix

* Fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix getCommonGroups. (#1122)

* Fix of Unexpected identifier async destroy() (#1123)

* Fix of Unexpected identifier async destroy()

* Fix made in #1107

* Temporary fix for "Sticker" module

* some really quick changes

* Update Injected.js

* Update Injected.js

* Update index.d.ts

* fix: getNumberId Solved (#1142)

* getNumberId Solved

* isRegisteredUser Solved

* formmated

* Apply suggestions from code review

* Update src/util/Injected.js

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* Fix: "Chrome user data dir was not found ..."

fixes the error caused by puppeteer.

* Update Client.js (#1154)

* fix: getNumberId and isRegisteredUser (#1159)

* fix: getNumberId and isRegisteredUser

* Apply suggestions from code review

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

* Update client.js

* Update Injected.js

* Update Client.js

* Update index.d.ts

* Update Client.js

* Update Client.js

* fix lint indentation

* fix auth_failure event for non-md, tests

* fix setting group subject

* fix finding Label module

* set remember-me after clearing localStorage

* fix: send messages to groups correctly on MD, use new ID format

* fix setting / getting contact status

* fix msg.getInfo, add message tests

* fix group settings functions

* fix set group description, handle errors in setSubject

* fix group invite functions

* fix leaving group

* bring back phone info for non-md users

* remove unused option, update typings

* add back jsdoc for qr event

* fix setting sticker metadata, clean up sticker functions

* rawData is a get only property

* fix and simplify getNumberId/isRegisteredUser

* fix getInviteInfo

* setDisplayName returns bool, not yet implemented for md

* fix: stream module (#1241)

* linkPreview has no effect on MD, return default to true

* fix: del linkPreview option on md

* cleanup, types and docs updates

* update readmes / test notes

* remove DS_Store

* DS_Store in gitignore

* test stability (timeouts/sleeps)

Co-authored-by: Rajeh Taher <rajeh@reforward.tk>
Co-authored-by: Gustavo B <52040719+Gugabit@users.noreply.github.com>
Co-authored-by: Maikel Ortega Hernández <maikeloh@gmail.com>
Co-authored-by: victormga <victor_mga@hotmail.com>
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
Co-authored-by: gon <68490103+nekiak@users.noreply.github.com>
Co-authored-by: Alon Schwartzblat <63599777+Schwartzblat@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Šebestíček <44745014+SebestikCZ@users.noreply.github.com>
Co-authored-by: Emmanuel Anaya Luna <38712443+KeruMx@users.noreply.github.com>
Co-authored-by: L337C0D3R <51872799+L337C0D3R@users.noreply.github.com>
Co-authored-by: Reni Delonzek <renidelonzek@gmail.com>
2022-02-27 18:51:08 -04:00
tuyuribr
b60029ed09 feat: Send buttons and Lists (#756) 2021-09-14 00:06:05 +03:00
Edson Tégila
cd52075447 Add the option to use "browserWSEndpoint" (#727)
* Update Client.js

* Update package.json

* Update package.json

* 🚨🔥 Fixed ESLint and removed old code.

* Update README.md

* Update README.md

* Update Client.js

* chore(deps): bump sharp from 0.26.3 to 0.28.3

Bumps [sharp](https://github.com/lovell/sharp) from 0.26.3 to 0.28.3.
- [Release notes](https://github.com/lovell/sharp/releases)
- [Changelog](https://github.com/lovell/sharp/blob/master/docs/changelog.md)
- [Commits](https://github.com/lovell/sharp/compare/v0.26.3...v0.28.3)

---
updated-dependencies:
- dependency-name: sharp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update package.json

* Update README.md

* Update example.js

* Update README.md

Co-authored-by: Rajeh Taher <52720753+PurpShell@users.noreply.github.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.tk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aliyss Snow <33941859+Aliyss@users.noreply.github.com>
2021-07-13 10:27:00 -07:00
Aliyss Snow
63d11d3f84 feat: disable / enable WA Web features (#543)
* Added Features and Enabling/Disabling of Features within WhatsappWeb

* remove feature commands from example

Co-authored-by: Pedro S. Lopez <pslamoros@hotmail.com>
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
2021-05-31 20:58:55 -04:00
Pedro Lopez
6cece4a006 fix: emit disconnected event on page navigation
This also addresses an issue due to a change in behavior from WhatsApp Web when the session is logged out from the device.
2021-04-20 20:02:22 -04:00
Aliyss Snow
87cb5a0519 feat(interface): Open chat search, open chat at message position (#447) 2020-12-29 00:33:49 -04:00
Aliyss Snow
aedf41b762 feat: Pin and unpin Chats (#166)
* Added Pinning
- chat.pin() to pin
- chat.unpin() to unpin

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-10-11 15:50:12 -04:00
Aliyss Snow
4beeab9b2c feat: mute/unmute chats (#168)
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-05-24 00:10:26 -04:00
Aliyss Snow
93a617336a feat: battery percentage changed event (#126)
New "change_battery" event is triggered when the battery percentage changes. Has current battery percentage and charging state as object param.

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-04-05 23:36:03 -04:00
sahalMoidu
98458f760e feat : send conversation seen (#66)
After this commit, chats will be automatically marked as seen when a message is sent to it. If this is not the intended behavior, `sendSeen: false` can be set as part of the options object. 

You can also manually mark a conversation as seen by calling the sendSeen() function on the Chat.

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-03-01 14:42:35 -04:00
Aliyss Snow
48b9ae1e81 feat: listen to group events (#90)
This allows you to listen for user joins or leaves, description updates, subject updates, picture updates, and group settings updates.

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-03-01 14:32:58 -04:00
Pedro Lopez
b07b38bbe8 feat: Simulate recording audio in chat, clear recording/typing state, standardize chatstate change function names 2020-02-29 14:07:47 -04:00
Anderson de Oliveira Machado
d35f101fac feat: send typing in chat (#87)
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
2020-02-29 13:55:27 -04:00
Gabriel
72441beb37 feat(example): better sesion data save (#79)
For more consistency whenever I have a successful authentication I write
to the json file the session data
2020-02-28 17:02:10 -04:00
Pedro Lopez
e6ef5929fc added ack constants and brief example 2020-02-26 23:18:09 -04:00
Aliyss Snow
132424ea08 feat: archive chats (#63) 2020-02-25 20:06:46 -04:00
Pedro Lopez
3c500a6474 Merge branch 'master' of https://github.com/pedroslopez/whatsapp-web.js 2020-02-22 17:28:15 -04:00
Pedro Lopez
1c60c83e80 feat: Delete messages 2020-02-22 17:28:03 -04:00
sahalMoidu
6ade08e814 Implemented changes mentioned in SimiPrambos PR#28 (#52)
* Implemented changes mentioned in SimiPrambos PR#28
To reflect new code structure
2020-02-14 17:53:28 -04:00
Pedro Lopez
74cfc69367 fix location example 2020-02-09 20:10:56 -04:00
Pedro Lopez
5fbd8ddf68 feat(example): auto restore session
This is as suggested in #29. Mainly implemeted to ease work while developing, but also serves as an example.
2020-02-09 01:52:38 -04:00
Pedro Lopez
d1dba0f4c0 add disconnect reason 2020-02-09 00:53:00 -04:00
Pedro Lopez
5616613807 feat: Mention users, get user number from Contact model 2020-02-08 03:19:51 -04:00
Pedro Lopez
edc2c7022d feat: change status message 2020-02-08 01:32:15 -04:00
Pedro Lopez
065a9212ba add another location example 2020-02-08 00:54:21 -04:00
Pedro Lopez
7b229a39a4 feat: Send and receive location 2020-02-08 00:46:55 -04:00
Pedro Lopez
a098d61b03 feat: send messages with attachments
close #3
2020-02-04 21:11:20 -04:00
Pedro Lopez
e717915f94 fix: don't get chat after accepting invite
This will now only return the chatId, since getting the chat at this point is unreliable.
2020-02-02 20:37:51 -04:00
Aliyss Snow
b597e4a504 Added delete event message(#33)
* A hacky way of doing things but seems to work. Also after client restart.
2020-02-02 19:00:23 -04:00
Pedro Lopez
cc477f9545 Add eslint config and fix linting issues 2020-02-02 14:50:04 -04:00
Pedro Lopez
7243240568 fix !quoteinfo example 2020-02-02 13:52:25 -04:00
Pedro Lopez
caa8598ec1 [+] Join groups by invite code 2020-02-02 00:52:51 -04:00
Pedro Lopez
a6cc5e5bf2 [+] Get quoted message
[FIX] Properly reply to messages sent by the current user
2020-02-01 22:41:53 -04:00
Pedro S. Lopez
ba8edc8d40 [+] Expose information about the logged in client (#19) 2020-02-01 21:16:03 -04:00
Pedro Lopez
64912dccfd Download message attachments (images, documents, etc) 2019-11-24 04:23:08 -04:00
Pedro Lopez
18199d8120 [+] New message_create event that is fired on all message creations.
A new property "fromMe" has also been added to messages.

Close #8
2019-09-08 03:48:19 -04:00
Pedro Lopez
cde0034d93 [+] Implement function to get all open chats.
Close #14
2019-09-08 03:18:40 -04:00
Pedro Lopez
a7a7034e75 [ADD] Session restore functionality 2019-03-17 05:42:29 -04:00
Pedro Lopez
1b7376885d Add group chat functions, slight refactoring 2019-02-20 02:42:19 -04:00
Pedro Lopez
9032025920 [ADD] Disconnected event 2019-02-17 22:32:37 -04:00
Pedro Lopez
812e3dc7a7 Support replying directly to messages 2019-02-17 21:50:28 -04:00
Pedro Lopez
6442469437 Basic Chat and Message model implementation 2019-02-17 21:14:31 -04:00
Pedro Lopez
c166e24ea5 Get and send messages 2019-02-17 04:18:16 -04:00
Pedro Lopez
bcbd16f196 Initial simple client implementation 2019-02-17 00:03:07 -04:00