
[!CAUTION] NOTICE OF BREAKING CHANGE.
As of 7.0.0, multiple breaking changes were introduced into the library.
Please check out https://whiskey.so/migrate-latest for more information.
This is a temporary README.md, the new guide is in development and will this file will be replaced with .github/README.md (already a default on GitHub).
New guide link: https://baileys.wiki
If you'd like business to enterprise-level support from Rajeh, the current maintainer of Baileys, you can book a video chat. Book a 1 hour time slot by contacting him on Discord or pre-ordering here. The earlier you pre-order the better, as his time slots usually fill up very quickly. He offers immense value per hour and will answer all your questions before the time runs out.
If you are a business, we encourage you to contribute back to the high development costs of the project and to feed the maintainers who dump tens of hours a week on this. You can do so by booking meetings or sponsoring below. All support, even in bona fide / contribution hours, is welcome by businesses of all sizes. This is not condoning or endorsing businesses to use the library. See the Disclaimer below.
If you'd like to financially support this project, you can do so by supporting the current maintainer here.
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
The maintainers of Baileys do not in any way condone the use of this application in practices that violate the Terms of Service of WhatsApp. The maintainers of this application call upon the personal responsibility of its users to use this application in a fair way, as it is intended to be used. Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
[!IMPORTANT] The original repository had to be removed by the original author - we now continue development in this repository here. This is the only official repository and is maintained by the community. Join the Discord here
Do check out & run example.ts to see an example usage of the library.
The script covers most common use cases.
To run the example script, download or clone the repo and then type the following in a terminal:
1. cd path/to/Baileys
2. yarn
3. yarn example
Use the stable version:
yarn add @whiskeysockets/baileys
Use the edge version (no guarantee of stability, but latest fixes + features)
yarn add github:WhiskeySockets/Baileys
Then import your code using:
import makeWASocket from '@whiskeysockets/baileys'
WhatsApp provides a multi-device API that allows Baileys to be authenticated as a second WhatsApp client by scanning a QR code or Pairing Code with WhatsApp on your phone.
[!NOTE] Here is a simple example of event handling
[!TIP] You can see all supported socket configs in the SocketConfig type alias (Recommended)
[!TIP] You can customize browser name if you connect with QR-CODE, with
Browserconstant, we have some browsers config, see the BrowsersMap type alias
import makeWASocket from '@whiskeysockets/baileys'
const sock = makeWASocket({
// can provide additional config here
browser: Browsers.ubuntu('My App'),
printQRInTerminal: true
})
If the connection is successful, you will see a QR code printed on your terminal screen, scan it
| 日期 | 榜单 | 排名 | 周期新增 | 总 STAR |
|---|