@d0v3riz/baileys 6.7.9 → 6.7.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +38 -883
  3. package/WAProto/index.d.ts +16106 -2739
  4. package/WAProto/index.js +128593 -73944
  5. package/engine-requirements.js +10 -0
  6. package/lib/Defaults/baileys-version.json +3 -3
  7. package/lib/Defaults/index.d.ts +51 -53
  8. package/lib/Defaults/index.js +105 -105
  9. package/lib/Signal/libsignal.d.ts +3 -3
  10. package/lib/Signal/libsignal.js +161 -152
  11. package/lib/Socket/Client/index.d.ts +2 -2
  12. package/lib/Socket/Client/index.js +18 -18
  13. package/lib/Socket/Client/types.d.ts +15 -17
  14. package/lib/Socket/Client/types.js +13 -13
  15. package/lib/Socket/Client/websocket.d.ts +12 -12
  16. package/lib/Socket/Client/websocket.js +62 -62
  17. package/lib/Socket/business.d.ts +146 -149
  18. package/lib/Socket/business.js +260 -260
  19. package/lib/Socket/chats.d.ts +85 -84
  20. package/lib/Socket/chats.js +880 -880
  21. package/lib/Socket/groups.d.ts +124 -124
  22. package/lib/Socket/groups.js +314 -314
  23. package/lib/Socket/index.d.ts +146 -149
  24. package/lib/Socket/index.js +10 -10
  25. package/lib/Socket/messages-recv.d.ts +135 -136
  26. package/lib/Socket/messages-recv.js +920 -864
  27. package/lib/Socket/messages-send.d.ts +130 -129
  28. package/lib/Socket/messages-send.js +683 -692
  29. package/lib/Socket/socket.d.ts +42 -45
  30. package/lib/Socket/socket.js +622 -614
  31. package/lib/Socket/usync.d.ts +36 -0
  32. package/lib/Socket/usync.js +70 -0
  33. package/lib/Types/Auth.d.ts +103 -105
  34. package/lib/Types/Auth.js +2 -2
  35. package/lib/Types/Call.d.ts +13 -13
  36. package/lib/Types/Call.js +2 -2
  37. package/lib/Types/Chat.d.ts +112 -107
  38. package/lib/Types/Chat.js +4 -4
  39. package/lib/Types/Contact.d.ts +19 -19
  40. package/lib/Types/Contact.js +2 -2
  41. package/lib/Types/Events.d.ts +172 -172
  42. package/lib/Types/Events.js +2 -2
  43. package/lib/Types/GroupMetadata.d.ts +56 -56
  44. package/lib/Types/GroupMetadata.js +2 -2
  45. package/lib/Types/Label.d.ts +46 -46
  46. package/lib/Types/Label.js +27 -27
  47. package/lib/Types/LabelAssociation.d.ts +29 -29
  48. package/lib/Types/LabelAssociation.js +9 -9
  49. package/lib/Types/Message.d.ts +269 -273
  50. package/lib/Types/Message.js +7 -9
  51. package/lib/Types/Product.d.ts +78 -78
  52. package/lib/Types/Product.js +2 -2
  53. package/lib/Types/Signal.d.ts +57 -57
  54. package/lib/Types/Signal.js +2 -2
  55. package/lib/Types/Socket.d.ts +121 -116
  56. package/lib/Types/Socket.js +2 -2
  57. package/lib/Types/State.d.ts +27 -27
  58. package/lib/Types/State.js +2 -2
  59. package/lib/Types/USync.d.ts +25 -0
  60. package/lib/Types/USync.js +2 -0
  61. package/lib/Types/index.d.ts +63 -63
  62. package/lib/Types/index.js +41 -41
  63. package/lib/Utils/auth-utils.d.ts +18 -18
  64. package/lib/Utils/auth-utils.js +200 -200
  65. package/lib/Utils/baileys-event-stream.d.ts +16 -16
  66. package/lib/Utils/baileys-event-stream.js +63 -63
  67. package/lib/Utils/business.d.ts +22 -22
  68. package/lib/Utils/business.js +234 -234
  69. package/lib/Utils/chat-utils.d.ts +70 -72
  70. package/lib/Utils/chat-utils.js +745 -745
  71. package/lib/Utils/crypto.d.ts +40 -42
  72. package/lib/Utils/crypto.js +193 -153
  73. package/lib/Utils/decode-wa-message.d.ts +36 -20
  74. package/lib/Utils/decode-wa-message.js +205 -189
  75. package/lib/Utils/event-buffer.d.ts +35 -35
  76. package/lib/Utils/event-buffer.js +520 -520
  77. package/lib/Utils/generics.d.ts +90 -94
  78. package/lib/Utils/generics.js +398 -421
  79. package/lib/Utils/history.d.ts +19 -19
  80. package/lib/Utils/history.js +94 -94
  81. package/lib/Utils/index.d.ts +17 -17
  82. package/lib/Utils/index.js +33 -33
  83. package/lib/Utils/link-preview.d.ts +21 -21
  84. package/lib/Utils/link-preview.js +126 -116
  85. package/lib/Utils/logger.d.ts +11 -4
  86. package/lib/Utils/logger.js +7 -7
  87. package/lib/Utils/lt-hash.d.ts +12 -12
  88. package/lib/Utils/lt-hash.js +51 -51
  89. package/lib/Utils/make-mutex.d.ts +7 -7
  90. package/lib/Utils/make-mutex.js +44 -44
  91. package/lib/Utils/messages-media.d.ts +104 -108
  92. package/lib/Utils/messages-media.js +677 -667
  93. package/lib/Utils/messages.d.ts +75 -78
  94. package/lib/Utils/messages.js +765 -760
  95. package/lib/Utils/noise-handler.d.ts +19 -21
  96. package/lib/Utils/noise-handler.js +150 -150
  97. package/lib/Utils/process-message.d.ts +41 -42
  98. package/lib/Utils/process-message.js +382 -355
  99. package/lib/Utils/signal.d.ts +33 -32
  100. package/lib/Utils/signal.js +153 -163
  101. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -12
  102. package/lib/Utils/use-multi-file-auth-state.js +125 -94
  103. package/lib/Utils/validate-connection.d.ts +10 -10
  104. package/lib/Utils/validate-connection.js +175 -171
  105. package/lib/WABinary/constants.d.ts +27 -27
  106. package/lib/WABinary/constants.js +40 -40
  107. package/lib/WABinary/decode.d.ts +6 -8
  108. package/lib/WABinary/decode.js +264 -254
  109. package/lib/WABinary/encode.d.ts +2 -4
  110. package/lib/WABinary/encode.js +252 -234
  111. package/lib/WABinary/generic-utils.d.ts +14 -16
  112. package/lib/WABinary/generic-utils.js +110 -110
  113. package/lib/WABinary/index.d.ts +5 -5
  114. package/lib/WABinary/index.js +21 -21
  115. package/lib/WABinary/jid-utils.d.ts +33 -31
  116. package/lib/WABinary/jid-utils.js +66 -62
  117. package/lib/WABinary/types.d.ts +18 -18
  118. package/lib/WABinary/types.js +2 -2
  119. package/lib/WAM/BinaryInfo.d.ts +8 -18
  120. package/lib/WAM/BinaryInfo.js +13 -13
  121. package/lib/WAM/constants.d.ts +39 -39
  122. package/lib/WAM/constants.js +15350 -15350
  123. package/lib/WAM/encode.d.ts +2 -4
  124. package/lib/WAM/encode.js +155 -155
  125. package/lib/WAM/index.d.ts +3 -3
  126. package/lib/WAM/index.js +19 -19
  127. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  128. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  129. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  130. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  131. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  132. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  133. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  134. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  135. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  136. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  137. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  138. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  139. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  140. package/lib/WAUSync/Protocols/index.js +20 -0
  141. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  142. package/lib/WAUSync/USyncQuery.js +89 -0
  143. package/lib/WAUSync/USyncUser.d.ts +12 -0
  144. package/lib/WAUSync/USyncUser.js +26 -0
  145. package/lib/WAUSync/index.d.ts +3 -0
  146. package/lib/WAUSync/index.js +19 -0
  147. package/lib/index.d.ts +11 -11
  148. package/lib/index.js +30 -30
  149. package/package.json +26 -34
  150. package/WAProto/GenerateStatics.sh +0 -4
  151. package/WAProto/WAProto.proto +0 -3344
  152. package/WASignalGroup/readme.md +0 -6
  153. package/lib/Store/index.d.ts +0 -3
  154. package/lib/Store/index.js +0 -10
  155. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  156. package/lib/Store/make-cache-manager-store.js +0 -83
  157. package/lib/Store/make-in-memory-store.d.ts +0 -118
  158. package/lib/Store/make-in-memory-store.js +0 -420
  159. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  160. package/lib/Store/make-ordered-dictionary.js +0 -81
  161. package/lib/Store/object-repository.d.ts +0 -10
  162. package/lib/Store/object-repository.js +0 -27
package/README.md CHANGED
@@ -1,889 +1,44 @@
1
- # Baileys - Typescript/Javascript WhatsApp Web API
1
+ <h1><img alt="Baileys logo" src="https://raw.githubusercontent.com/WhiskeySockets/Baileys/refs/heads/master/Media/logo.png" height="75"/></h1>
2
2
 
3
- ### Important Note
3
+ ![NPM Downloads](https://img.shields.io/npm/dw/%40whiskeysockets%2Fbaileys?label=npm&color=%23CB3837)
4
+ ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/whiskeysockets/baileys)
5
+ ![Discord](https://img.shields.io/discord/725839806084546610?label=discord&color=%235865F2)
4
6
 
5
- This library was originally a project for **CS-2362 at Ashoka University** and is in no way affiliated with or endorsed by WhatsApp. Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
7
+ Baileys is a WebSockets-based TypeScript library for interacting with the WhatsApp Web API.
6
8
 
7
- #### Liability and License Notice
8
- Baileys and its maintainers cannot be held liable for misuse of this application, as stated in the [MIT license](https://github.com/WhiskeySockets/Baileys/blob/master/LICENSE).
9
- 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.
10
- ##
11
-
12
- Baileys does not require Selenium or any other browser to be interface with WhatsApp Web, it does so directly using a **WebSocket**.
13
- Not running Selenium or Chromimum saves you like **half a gig** of ram :/
14
- Baileys supports interacting with the multi-device & web versions of WhatsApp.
15
- Thank you to [@pokearaujo](https://github.com/pokearaujo/multidevice) for writing his observations on the workings of WhatsApp Multi-Device. Also, thank you to [@Sigalor](https://github.com/sigalor/whatsapp-web-reveng) for writing his observations on the workings of WhatsApp Web and thanks to [@Rhymen](https://github.com/Rhymen/go-whatsapp/) for the __go__ implementation.
16
-
17
- ## Please Read
18
-
19
- The original repository had to be removed by the original author - we now continue development in this repository here.
20
- This is the only official repository and is maintained by the community.
21
- **Join the Discord [here](https://discord.gg/WeJM5FP9GG)**
22
-
23
- ## Example
24
-
25
- Do check out & run [example.ts](Example/example.ts) to see an example usage of the library.
26
- The script covers most common use cases.
27
- To run the example script, download or clone the repo and then type the following in a terminal:
28
- 1. ``` cd path/to/Baileys ```
29
- 2. ``` yarn ```
30
- 3. ``` yarn example ```
31
-
32
- ## Install
33
-
34
- Use the stable version:
35
- ```
36
- yarn add @whiskeysockets/baileys
37
- ```
38
-
39
- Use the edge version (no guarantee of stability, but latest fixes + features)
40
- ```
41
- yarn add github:WhiskeySockets/Baileys
42
- ```
43
-
44
- Then import your code using:
45
- ``` ts
46
- import makeWASocket from '@whiskeysockets/baileys'
47
- ```
48
-
49
- ## Unit Tests
50
-
51
- TODO
52
-
53
- ## Connecting multi device (recommended)
54
-
55
- WhatsApp provides a multi-device API that allows Baileys to be authenticated as a second WhatsApp client by scanning a QR code with WhatsApp on your phone.
56
-
57
- ``` ts
58
- import makeWASocket, { DisconnectReason } from '@whiskeysockets/baileys'
59
- import { Boom } from '@hapi/boom'
60
-
61
- async function connectToWhatsApp () {
62
- const sock = makeWASocket({
63
- // can provide additional config here
64
- printQRInTerminal: true
65
- })
66
- sock.ev.on('connection.update', (update) => {
67
- const { connection, lastDisconnect } = update
68
- if(connection === 'close') {
69
- const shouldReconnect = (lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut
70
- console.log('connection closed due to ', lastDisconnect.error, ', reconnecting ', shouldReconnect)
71
- // reconnect if not logged out
72
- if(shouldReconnect) {
73
- connectToWhatsApp()
74
- }
75
- } else if(connection === 'open') {
76
- console.log('opened connection')
77
- }
78
- })
79
- sock.ev.on('messages.upsert', m => {
80
- console.log(JSON.stringify(m, undefined, 2))
81
-
82
- console.log('replying to', m.messages[0].key.remoteJid)
83
- await sock.sendMessage(m.messages[0].key.remoteJid!, { text: 'Hello there!' })
84
- })
85
- }
86
- // run in main file
87
- connectToWhatsApp()
88
- ```
89
-
90
- If the connection is successful, you will see a QR code printed on your terminal screen, scan it with WhatsApp on your phone and you'll be logged in!
91
-
92
- ## Configuring the Connection
93
-
94
- You can configure the connection by passing a `SocketConfig` object.
95
-
96
- The entire `SocketConfig` structure is mentioned here with default values:
97
- ``` ts
98
- type SocketConfig = {
99
- /** the WS url to connect to WA */
100
- waWebSocketUrl: string | URL
101
- /** Fails the connection if the socket times out in this interval */
102
- connectTimeoutMs: number
103
- /** Default timeout for queries, undefined for no timeout */
104
- defaultQueryTimeoutMs: number | undefined
105
- /** ping-pong interval for WS connection */
106
- keepAliveIntervalMs: number
107
- /** proxy agent */
108
- agent?: Agent
109
- /** pino logger */
110
- logger: Logger
111
- /** version to connect with */
112
- version: WAVersion
113
- /** override browser config */
114
- browser: WABrowserDescription
115
- /** agent used for fetch requests -- uploading/downloading media */
116
- fetchAgent?: Agent
117
- /** should the QR be printed in the terminal */
118
- printQRInTerminal: boolean
119
- /** should events be emitted for actions done by this socket connection */
120
- emitOwnEvents: boolean
121
- /** provide a cache to store media, so does not have to be re-uploaded */
122
- mediaCache?: NodeCache
123
- /** custom upload hosts to upload media to */
124
- customUploadHosts: MediaConnInfo['hosts']
125
- /** time to wait between sending new retry requests */
126
- retryRequestDelayMs: number
127
- /** max msg retry count */
128
- maxMsgRetryCount: number
129
- /** time to wait for the generation of the next QR in ms */
130
- qrTimeout?: number;
131
- /** provide an auth state object to maintain the auth state */
132
- auth: AuthenticationState
133
- /** manage history processing with this control; by default will sync up everything */
134
- shouldSyncHistoryMessage: (msg: proto.Message.IHistorySyncNotification) => boolean
135
- /** transaction capability options for SignalKeyStore */
136
- transactionOpts: TransactionCapabilityOptions
137
- /** provide a cache to store a user's device list */
138
- userDevicesCache?: NodeCache
139
- /** marks the client as online whenever the socket successfully connects */
140
- markOnlineOnConnect: boolean
141
- /**
142
- * map to store the retry counts for failed messages;
143
- * used to determine whether to retry a message or not */
144
- msgRetryCounterMap?: MessageRetryMap
145
- /** width for link preview images */
146
- linkPreviewImageThumbnailWidth: number
147
- /** Should Baileys ask the phone for full history, will be received async */
148
- syncFullHistory: boolean
149
- /** Should baileys fire init queries automatically, default true */
150
- fireInitQueries: boolean
151
- /**
152
- * generate a high quality link preview,
153
- * entails uploading the jpegThumbnail to WA
154
- * */
155
- generateHighQualityLinkPreview: boolean
156
-
157
- /** options for axios */
158
- options: AxiosRequestConfig<any>
159
- /**
160
- * fetch a message from your store
161
- * implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried
162
- * */
163
- getMessage: (key: proto.IMessageKey) => Promise<proto.IMessage | undefined>
164
- }
165
- ```
166
-
167
- ### Emulating the Desktop app instead of the web
168
-
169
- 1. Baileys, by default, emulates a chrome web session
170
- 2. If you'd like to emulate a desktop connection (and receive more message history), add this to your Socket config:
171
- ``` ts
172
- const conn = makeWASocket({
173
- ...otherOpts,
174
- // can use Windows, Ubuntu here too
175
- browser: Browsers.macOS('Desktop'),
176
- syncFullHistory: true
177
- })
178
- ```
179
-
180
- ## Saving & Restoring Sessions
181
-
182
- You obviously don't want to keep scanning the QR code every time you want to connect.
183
-
184
- So, you can load the credentials to log back in:
185
- ``` ts
186
- import makeWASocket, { BufferJSON, useMultiFileAuthState } from '@whiskeysockets/baileys'
187
- import * as fs from 'fs'
188
-
189
- // utility function to help save the auth state in a single folder
190
- // this function serves as a good guide to help write auth & key states for SQL/no-SQL databases, which I would recommend in any production grade system
191
- const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
192
- // will use the given state to connect
193
- // so if valid credentials are available -- it'll connect without QR
194
- const conn = makeWASocket({ auth: state })
195
- // this will be called as soon as the credentials are updated
196
- conn.ev.on ('creds.update', saveCreds)
197
- ```
198
-
199
- **Note:** When a message is received/sent, due to signal sessions needing updating, the auth keys (`authState.keys`) will update. Whenever that happens, you must save the updated keys (`authState.keys.set()` is called). Not doing so will prevent your messages from reaching the recipient & cause other unexpected consequences. The `useMultiFileAuthState` function automatically takes care of that, but for any other serious implementation -- you will need to be very careful with the key state management.
200
-
201
- ## Listening to Connection Updates
202
-
203
- Baileys now fires the `connection.update` event to let you know something has updated in the connection. This data has the following structure:
204
- ``` ts
205
- type ConnectionState = {
206
- /** connection is now open, connecting or closed */
207
- connection: WAConnectionState
208
- /** the error that caused the connection to close */
209
- lastDisconnect?: {
210
- error: Error
211
- date: Date
212
- }
213
- /** is this a new login */
214
- isNewLogin?: boolean
215
- /** the current QR code */
216
- qr?: string
217
- /** has the device received all pending notifications while it was offline */
218
- receivedPendingNotifications?: boolean
219
- }
220
- ```
221
-
222
- **Note:** this also offers any updates to the QR
223
-
224
- ## Handling Events
225
-
226
- Baileys uses the EventEmitter syntax for events.
227
- They're all nicely typed up, so you shouldn't have any issues with an Intellisense editor like VS Code.
228
-
229
- The events are typed as mentioned here:
230
-
231
- ``` ts
232
-
233
- export type BaileysEventMap = {
234
- /** connection state has been updated -- WS closed, opened, connecting etc. */
235
- 'connection.update': Partial<ConnectionState>
236
- /** credentials updated -- some metadata, keys or something */
237
- 'creds.update': Partial<AuthenticationCreds>
238
- /** history sync, everything is reverse chronologically sorted */
239
- 'messaging-history.set': {
240
- chats: Chat[]
241
- contacts: Contact[]
242
- messages: WAMessage[]
243
- isLatest: boolean
244
- }
245
- /** upsert chats */
246
- 'chats.upsert': Chat[]
247
- /** update the given chats */
248
- 'chats.update': Partial<Chat>[]
249
- /** delete chats with given ID */
250
- 'chats.delete': string[]
251
- 'labels.association': LabelAssociation
252
- 'labels.edit': Label
253
- /** presence of contact in a chat updated */
254
- 'presence.update': { id: string, presences: { [participant: string]: PresenceData } }
255
-
256
- 'contacts.upsert': Contact[]
257
- 'contacts.update': Partial<Contact>[]
258
-
259
- 'messages.delete': { keys: WAMessageKey[] } | { jid: string, all: true }
260
- 'messages.update': WAMessageUpdate[]
261
- 'messages.media-update': { key: WAMessageKey, media?: { ciphertext: Uint8Array, iv: Uint8Array }, error?: Boom }[]
262
- /**
263
- * add/update the given messages. If they were received while the connection was online,
264
- * the update will have type: "notify"
265
- * */
266
- 'messages.upsert': { messages: WAMessage[], type: MessageUpsertType }
267
- /** message was reacted to. If reaction was removed -- then "reaction.text" will be falsey */
268
- 'messages.reaction': { key: WAMessageKey, reaction: proto.IReaction }[]
269
-
270
- 'message-receipt.update': MessageUserReceiptUpdate[]
271
-
272
- 'groups.upsert': GroupMetadata[]
273
- 'groups.update': Partial<GroupMetadata>[]
274
- /** apply an action to participants in a group */
275
- 'group-participants.update': { id: string, participants: string[], action: ParticipantAction }
276
-
277
- 'blocklist.set': { blocklist: string[] }
278
- 'blocklist.update': { blocklist: string[], type: 'add' | 'remove' }
279
- /** Receive an update on a call, including when the call was received, rejected, accepted */
280
- 'call': WACallEvent[]
281
- }
282
- ```
283
-
284
- You can listen to these events like this:
285
- ``` ts
286
-
287
- const sock = makeWASocket()
288
- sock.ev.on('messages.upsert', ({ messages }) => {
289
- console.log('got messages', messages)
290
- })
291
-
292
- ```
293
-
294
- ## Implementing a Data Store
295
-
296
- Baileys does not come with a defacto storage for chats, contacts, or messages. However, a simple in-memory implementation has been provided. The store listens for chat updates, new messages, message updates, etc., to always have an up-to-date version of the data.
297
-
298
- It can be used as follows:
299
-
300
- ``` ts
301
- import makeWASocket, { makeInMemoryStore } from '@whiskeysockets/baileys'
302
- // the store maintains the data of the WA connection in memory
303
- // can be written out to a file & read from it
304
- const store = makeInMemoryStore({ })
305
- // can be read from a file
306
- store.readFromFile('./baileys_store.json')
307
- // saves the state to a file every 10s
308
- setInterval(() => {
309
- store.writeToFile('./baileys_store.json')
310
- }, 10_000)
311
-
312
- const sock = makeWASocket({ })
313
- // will listen from this socket
314
- // the store can listen from a new socket once the current socket outlives its lifetime
315
- store.bind(sock.ev)
316
-
317
- sock.ev.on('chats.upsert', () => {
318
- // can use "store.chats" however you want, even after the socket dies out
319
- // "chats" => a KeyedDB instance
320
- console.log('got chats', store.chats.all())
321
- })
322
-
323
- sock.ev.on('contacts.upsert', () => {
324
- console.log('got contacts', Object.values(store.contacts))
325
- })
326
-
327
- ```
328
-
329
- The store also provides some simple functions such as `loadMessages` that utilize the store to speed up data retrieval.
330
-
331
- **Note:** I highly recommend building your own data store especially for MD connections, as storing someone's entire chat history in memory is a terrible waste of RAM.
332
-
333
- ## Sending Messages
334
-
335
- **Send all types of messages with a single function:**
336
-
337
- ### Non-Media Messages
9
+ # Usage
10
+ A new guide has been posted at https://baileys.wiki.
338
11
 
339
- ``` ts
340
- import { MessageType, MessageOptions, Mimetype } from '@whiskeysockets/baileys'
12
+ # Sponsor
13
+ If you'd like to financially support this project, you can do so by supporting the current maintainer [here](https://purpshell.dev/sponsor).
341
14
 
342
- const id = 'abcd@s.whatsapp.net' // the WhatsApp ID
343
- // send a simple text!
344
- const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' })
345
- // send a reply messagge
346
- const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' }, { quoted: message })
347
- // send a mentions message
348
- const sentMsg = await sock.sendMessage(id, { text: '@12345678901', mentions: ['12345678901@s.whatsapp.net'] })
349
- // send a location!
350
- const sentMsg = await sock.sendMessage(
351
- id,
352
- { location: { degreesLatitude: 24.121231, degreesLongitude: 55.1121221 } }
353
- )
354
- // send a contact!
355
- const vcard = 'BEGIN:VCARD\n' // metadata of the contact card
356
- + 'VERSION:3.0\n'
357
- + 'FN:Jeff Singh\n' // full name
358
- + 'ORG:Ashoka Uni;\n' // the organization of the contact
359
- + 'TEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890\n' // WhatsApp ID + phone number
360
- + 'END:VCARD'
361
- const sentMsg = await sock.sendMessage(
362
- id,
363
- {
364
- contacts: {
365
- displayName: 'Jeff',
366
- contacts: [{ vcard }]
367
- }
368
- }
369
- )
15
+ # Disclaimer
16
+ 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.
17
+ 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.
370
18
 
371
- const reactionMessage = {
372
- react: {
373
- text: "💖", // use an empty string to remove the reaction
374
- key: message.key
375
- }
376
- }
377
-
378
- const sendMsg = await sock.sendMessage(id, reactionMessage)
379
- ```
380
-
381
- ### Sending messages with link previews
382
-
383
- 1. By default, WA MD does not have link generation when sent from the web
384
- 2. Baileys has a function to generate the content for these link previews
385
- 3. To enable this function's usage, add `link-preview-js` as a dependency to your project with `yarn add link-preview-js`
386
- 4. Send a link:
387
- ``` ts
388
- // send a link
389
- const sentMsg = await sock.sendMessage(id, { text: 'Hi, this was sent using https://github.com/adiwajshing/baileys' })
390
- ```
391
-
392
- ### Media Messages
393
-
394
- Sending media (video, stickers, images) is easier & more efficient than ever.
395
- - You can specify a buffer, a local url or even a remote url.
396
- - When specifying a media url, Baileys never loads the entire buffer into memory; it even encrypts the media as a readable stream.
397
-
398
- ``` ts
399
- import { MessageType, MessageOptions, Mimetype } from '@whiskeysockets/baileys'
400
- // Sending gifs
401
- await sock.sendMessage(
402
- id,
403
- {
404
- video: fs.readFileSync("Media/ma_gif.mp4"),
405
- caption: "hello!",
406
- gifPlayback: true
407
- }
408
- )
409
-
410
- await sock.sendMessage(
411
- id,
412
- {
413
- video: "./Media/ma_gif.mp4",
414
- caption: "hello!",
415
- gifPlayback: true,
416
- ptv: false // if set to true, will send as a `video note`
417
- }
418
- )
419
-
420
- // send an audio file
421
- await sock.sendMessage(
422
- id,
423
- { audio: { url: "./Media/audio.mp3" }, mimetype: 'audio/mp4' }
424
- { url: "Media/audio.mp3" }, // can send mp3, mp4, & ogg
425
- )
426
- ```
427
-
428
- ### Notes
429
-
430
- - `id` is the WhatsApp ID of the person or group you're sending the message to.
431
- - It must be in the format ```[country code][phone number]@s.whatsapp.net```
432
- - Example for people: ```+19999999999@s.whatsapp.net```.
433
- - For groups, it must be in the format ``` 123456789-123345@g.us ```.
434
- - For broadcast lists, it's `[timestamp of creation]@broadcast`.
435
- - For stories, the ID is `status@broadcast`.
436
- - For media messages, the thumbnail can be generated automatically for images & stickers provided you add `jimp` or `sharp` as a dependency in your project using `yarn add jimp` or `yarn add sharp`. Thumbnails for videos can also be generated automatically, though, you need to have `ffmpeg` installed on your system.
437
- - **MiscGenerationOptions**: some extra info about the message. It can have the following __optional__ values:
438
- ``` ts
439
- const info: MessageOptions = {
440
- quoted: quotedMessage, // the message you want to quote
441
- contextInfo: { forwardingScore: 2, isForwarded: true }, // some random context info (can show a forwarded message with this too)
442
- timestamp: Date(), // optional, if you want to manually set the timestamp of the message
443
- caption: "hello there!", // (for media messages) the caption to send with the media (cannot be sent with stickers though)
444
- jpegThumbnail: "23GD#4/==", /* (for location & media messages) has to be a base 64 encoded JPEG if you want to send a custom thumb,
445
- or set to null if you don't want to send a thumbnail.
446
- Do not enter this field if you want to automatically generate a thumb
447
- */
448
- mimetype: Mimetype.pdf, /* (for media messages) specify the type of media (optional for all media types except documents),
449
- import {Mimetype} from '@whiskeysockets/baileys'
450
- */
451
- fileName: 'somefile.pdf', // (for media messages) file name for the media
452
- /* will send audio messages as voice notes, if set to true */
453
- ptt: true,
454
- /** Should it send as a disappearing messages.
455
- * By default 'chat' -- which follows the setting of the chat */
456
- ephemeralExpiration: WA_DEFAULT_EPHEMERAL
457
- }
458
- ```
459
- ## Forwarding Messages
460
-
461
- ``` ts
462
- const msg = getMessageFromStore('455@s.whatsapp.net', 'HSJHJWH7323HSJSJ') // implement this on your end
463
- await sock.sendMessage('1234@s.whatsapp.net', { forward: msg }) // WA forward the message!
464
- ```
465
-
466
- ## Reading Messages
467
-
468
- A set of message keys must be explicitly marked read now.
469
- In multi-device, you cannot mark an entire "chat" read as it were with Baileys Web.
470
- This means you have to keep track of unread messages.
471
-
472
- ``` ts
473
- const key = {
474
- remoteJid: '1234-123@g.us',
475
- id: 'AHASHH123123AHGA', // id of the message you want to read
476
- participant: '912121232@s.whatsapp.net' // the ID of the user that sent the message (undefined for individual chats)
477
- }
478
- // pass to readMessages function
479
- // can pass multiple keys to read multiple messages as well
480
- await sock.readMessages([key])
481
- ```
482
-
483
- The message ID is the unique identifier of the message that you are marking as read.
484
- On a `WAMessage`, the `messageID` can be accessed using ```messageID = message.key.id```.
485
-
486
- ## Update Presence
487
-
488
- ``` ts
489
- await sock.sendPresenceUpdate('available', id)
490
-
491
- ```
492
- This lets the person/group with ``` id ``` know whether you're online, offline, typing etc.
493
-
494
- ``` presence ``` can be one of the following:
495
- ``` ts
496
- type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'
497
- ```
498
-
499
- The presence expires after about 10 seconds.
500
-
501
- **Note:** In the multi-device version of WhatsApp -- if a desktop client is active, WA doesn't send push notifications to the device. If you would like to receive said notifications -- mark your Baileys client offline using `sock.sendPresenceUpdate('unavailable')`
502
-
503
- ## Downloading Media Messages
504
-
505
- If you want to save the media you received
506
- ``` ts
507
- import { writeFile } from 'fs/promises'
508
- import { downloadMediaMessage } from '@whiskeysockets/baileys'
509
-
510
- sock.ev.on('messages.upsert', async ({ messages }) => {
511
- const m = messages[0]
512
-
513
- if (!m.message) return // if there is no text or media message
514
- const messageType = Object.keys (m.message)[0]// get what type of message it is -- text, image, video
515
- // if the message is an image
516
- if (messageType === 'imageMessage') {
517
- // download the message
518
- const buffer = await downloadMediaMessage(
519
- m,
520
- 'buffer',
521
- { },
522
- {
523
- logger,
524
- // pass this so that baileys can request a reupload of media
525
- // that has been deleted
526
- reuploadRequest: sock.updateMediaMessage
527
- }
528
- )
529
- // save to file
530
- await writeFile('./my-download.jpeg', buffer)
531
- }
532
- }
533
- ```
534
-
535
- **Note:** WhatsApp automatically removes old media from their servers. For the device to access said media -- a re-upload is required by another device that has it. This can be accomplished using:
536
- ``` ts
537
- const updatedMediaMsg = await sock.updateMediaMessage(msg)
538
- ```
539
-
540
- ## Deleting Messages
541
-
542
- ``` ts
543
- const jid = '1234@s.whatsapp.net' // can also be a group
544
- const response = await sock.sendMessage(jid, { text: 'hello!' }) // send a message
545
- // sends a message to delete the given message
546
- // this deletes the message for everyone
547
- await sock.sendMessage(jid, { delete: response.key })
548
- ```
549
-
550
- **Note:** deleting for oneself is supported via `chatModify` (next section)
551
-
552
- ## Updating Messages
553
-
554
- ``` ts
555
- const jid = '1234@s.whatsapp.net'
556
-
557
- await sock.sendMessage(jid, {
558
- text: 'updated text goes here',
559
- edit: response.key,
560
- });
561
- ```
562
-
563
- ## Modifying Chats
564
-
565
- WA uses an encrypted form of communication to send chat/app updates. This has been implemented mostly and you can send the following updates:
566
-
567
- - Archive a chat
568
- ``` ts
569
- const lastMsgInChat = await getLastMessageInChat('123456@s.whatsapp.net') // implement this on your end
570
- await sock.chatModify({ archive: true, lastMessages: [lastMsgInChat] }, '123456@s.whatsapp.net')
571
- ```
572
- - Mute/unmute a chat
573
- ``` ts
574
- // mute for 8 hours
575
- await sock.chatModify({ mute: 8*60*60*1000 }, '123456@s.whatsapp.net', [])
576
- // unmute
577
- await sock.chatModify({ mute: null }, '123456@s.whatsapp.net', [])
578
- ```
579
- - Mark a chat read/unread
580
- ``` ts
581
- const lastMsgInChat = await getLastMessageInChat('123456@s.whatsapp.net') // implement this on your end
582
- // mark it unread
583
- await sock.chatModify({ markRead: false, lastMessages: [lastMsgInChat] }, '123456@s.whatsapp.net')
584
- ```
585
-
586
- - Delete a message for me
587
- ``` ts
588
- await sock.chatModify(
589
- { clear: { messages: [{ id: 'ATWYHDNNWU81732J', fromMe: true, timestamp: "1654823909" }] } },
590
- '123456@s.whatsapp.net',
591
- []
592
- )
593
-
594
- ```
595
-
596
- - Delete a chat
597
- ``` ts
598
- const lastMsgInChat = await getLastMessageInChat('123456@s.whatsapp.net') // implement this on your end
599
- await sock.chatModify({
600
- delete: true,
601
- lastMessages: [{ key: lastMsgInChat.key, messageTimestamp: lastMsgInChat.messageTimestamp }]
602
- },
603
- '123456@s.whatsapp.net')
604
- ```
605
-
606
- - Pin/unpin a chat
607
- ``` ts
608
- await sock.chatModify({
609
- pin: true // or `false` to unpin
610
- },
611
- '123456@s.whatsapp.net')
612
- ```
613
-
614
- - Star/unstar a message
615
- ``` ts
616
- await sock.chatModify({
617
- star: {
618
- messages: [{ id: 'messageID', fromMe: true // or `false` }],
619
- star: true // - true: Star Message; false: Unstar Message
620
- }},'123456@s.whatsapp.net');
621
- ```
622
-
623
- **Note:** if you mess up one of your updates, WA can log you out of all your devices and you'll have to log in again.
624
-
625
- ## Disappearing Messages
626
-
627
- ``` ts
628
- const jid = '1234@s.whatsapp.net' // can also be a group
629
- // turn on disappearing messages
630
- await sock.sendMessage(
631
- jid,
632
- // this is 1 week in seconds -- how long you want messages to appear for
633
- { disappearingMessagesInChat: WA_DEFAULT_EPHEMERAL }
634
- )
635
- // will send as a disappearing message
636
- await sock.sendMessage(jid, { text: 'hello' }, { ephemeralExpiration: WA_DEFAULT_EPHEMERAL })
637
- // turn off disappearing messages
638
- await sock.sendMessage(
639
- jid,
640
- { disappearingMessagesInChat: false }
641
- )
642
-
643
- ```
644
-
645
- ## Misc
646
-
647
- - To check if a given ID is on WhatsApp
648
- ``` ts
649
- const id = '123456'
650
- const [result] = await sock.onWhatsApp(id)
651
- if (result.exists) console.log (`${id} exists on WhatsApp, as jid: ${result.jid}`)
652
- ```
653
- - To query chat history on a group or with someone
654
- TODO, if possible
655
- - To get the status of some person
656
- ``` ts
657
- const status = await sock.fetchStatus("xyz@s.whatsapp.net")
658
- console.log("status: " + status)
659
- ```
660
- - To change your profile status
661
- ``` ts
662
- const status = 'Hello World!'
663
- await sock.updateProfileStatus(status)
664
- ```
665
- - To change your profile name
666
- ``` ts
667
- const name = 'My name'
668
- await sock.updateProfileName(name)
669
- ```
670
- - To get the display picture of some person/group
671
- ``` ts
672
- // for low res picture
673
- const ppUrl = await sock.profilePictureUrl("xyz@g.us")
674
- console.log("download profile picture from: " + ppUrl)
675
- // for high res picture
676
- const ppUrl = await sock.profilePictureUrl("xyz@g.us", 'image')
677
- ```
678
- - To change your display picture or a group's
679
- ``` ts
680
- const jid = '111234567890-1594482450@g.us' // can be your own too
681
- await sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' })
682
- ```
683
- - To remove your display picture or a group's
684
- ``` ts
685
- const jid = '111234567890-1594482450@g.us' // can be your own too
686
- await sock.removeProfilePicture(jid)
687
- ```
688
- - To get someone's presence (if they're typing or online)
689
- ``` ts
690
- // the presence update is fetched and called here
691
- sock.ev.on('presence.update', json => console.log(json))
692
- // request updates for a chat
693
- await sock.presenceSubscribe("xyz@s.whatsapp.net")
694
- ```
695
- - To block or unblock user
696
- ``` ts
697
- await sock.updateBlockStatus("xyz@s.whatsapp.net", "block") // Block user
698
- await sock.updateBlockStatus("xyz@s.whatsapp.net", "unblock") // Unblock user
699
- ```
700
- - To get a business profile, such as description or category
701
- ```ts
702
- const profile = await sock.getBusinessProfile("xyz@s.whatsapp.net")
703
- console.log("business description: " + profile.description + ", category: " + profile.category)
704
- ```
705
- Of course, replace ``` xyz ``` with an actual ID.
706
-
707
- ## Groups
708
- - To create a group
709
- ``` ts
710
- // title & participants
711
- const group = await sock.groupCreate("My Fab Group", ["1234@s.whatsapp.net", "4564@s.whatsapp.net"])
712
- console.log ("created group with id: " + group.gid)
713
- sock.sendMessage(group.id, { text: 'hello there' }) // say hello to everyone on the group
714
- ```
715
- - To add/remove people to a group or demote/promote people
716
- ``` ts
717
- // id & people to add to the group (will throw error if it fails)
718
- const response = await sock.groupParticipantsUpdate(
719
- "abcd-xyz@g.us",
720
- ["abcd@s.whatsapp.net", "efgh@s.whatsapp.net"],
721
- "add" // replace this parameter with "remove", "demote" or "promote"
722
- )
723
- ```
724
- - To change the group's subject
725
- ``` ts
726
- await sock.groupUpdateSubject("abcd-xyz@g.us", "New Subject!")
727
- ```
728
- - To change the group's description
729
- ``` ts
730
- await sock.groupUpdateDescription("abcd-xyz@g.us", "New Description!")
731
- ```
732
- - To change group settings
733
- ``` ts
734
- // only allow admins to send messages
735
- await sock.groupSettingUpdate("abcd-xyz@g.us", 'announcement')
736
- // allow everyone to send messages
737
- await sock.groupSettingUpdate("abcd-xyz@g.us", 'not_announcement')
738
- // allow everyone to modify the group's settings -- like display picture etc.
739
- await sock.groupSettingUpdate("abcd-xyz@g.us", 'unlocked')
740
- // only allow admins to modify the group's settings
741
- await sock.groupSettingUpdate("abcd-xyz@g.us", 'locked')
742
- ```
743
- - To leave a group
744
- ``` ts
745
- await sock.groupLeave("abcd-xyz@g.us") // (will throw error if it fails)
746
- ```
747
- - To get the invite code for a group
748
- ``` ts
749
- const code = await sock.groupInviteCode("abcd-xyz@g.us")
750
- console.log("group code: " + code)
751
- ```
752
- - To revoke the invite code in a group
753
- ```ts
754
- const code = await sock.groupRevokeInvite("abcd-xyz@g.us")
755
- console.log("New group code: " + code)
756
- ```
757
- - To query the metadata of a group
758
- ``` ts
759
- const metadata = await sock.groupMetadata("abcd-xyz@g.us")
760
- console.log(metadata.id + ", title: " + metadata.subject + ", description: " + metadata.desc)
761
- ```
762
- - To join the group using the invitation code
763
- ``` ts
764
- const response = await sock.groupAcceptInvite("xxx")
765
- console.log("joined to: " + response)
766
- ```
767
- Of course, replace ``` xxx ``` with invitation code.
768
- - To get group info by invite code
769
- ```ts
770
- const response = await sock.groupGetInviteInfo("xxx")
771
- console.log("group information: " + response)
772
- ```
773
- - To join the group using groupInviteMessage
774
- ``` ts
775
- const response = await sock.groupAcceptInviteV4("abcd@s.whatsapp.net", groupInviteMessage)
776
- console.log("joined to: " + response)
777
- ```
778
- Of course, replace ``` xxx ``` with invitation code.
779
-
780
- - To get list request join
781
- ``` ts
782
- const response = await sock.groupRequestParticipantsList("abcd-xyz@g.us")
783
- console.log(response)
784
- ```
785
- - To approve/reject request join
786
- ``` ts
787
- const response = await sock.groupRequestParticipantsUpdate(
788
- "abcd-xyz@g.us", // id group,
789
- ["abcd@s.whatsapp.net", "efgh@s.whatsapp.net"],
790
- "approve" // replace this parameter with "reject"
791
- )
792
- console.log(response)
793
- ```
794
-
795
- ## Privacy
796
- - To get the privacy settings
797
- ``` ts
798
- const privacySettings = await sock.fetchPrivacySettings(true)
799
- console.log("privacy settings: " + privacySettings)
800
- ```
801
- - To update the LastSeen privacy
802
- ``` ts
803
- const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
804
- await sock.updateLastSeenPrivacy(value)
805
- ```
806
- - To update the Online privacy
807
- ``` ts
808
- const value = 'all' // 'match_last_seen'
809
- await sock.updateOnlinePrivacy(value)
810
- ```
811
- - To update the Profile Picture privacy
812
- ``` ts
813
- const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
814
- await sock.updateProfilePicturePrivacy(value)
815
- ```
816
- - To update the Status privacy
817
- ``` ts
818
- const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
819
- await sock.updateStatusPrivacy(value)
820
- ```
821
- - To update the Read Receipts privacy
822
- ``` ts
823
- const value = 'all' // 'none'
824
- await sock.updateReadReceiptsPrivacy(value)
825
- ```
826
- - To update the Groups Add privacy
827
- ``` ts
828
- const value = 'all' // 'contacts' | 'contact_blacklist'
829
- await sock.updateGroupsAddPrivacy(value)
830
- ```
831
- - To update the Default Disappearing Mode
832
- ``` ts
833
- const duration = 86400 // 604800 | 7776000 | 0
834
- await sock.updateDefaultDisappearingMode(duration)
835
- ```
836
- ## Broadcast Lists & Stories
837
-
838
- Messages can be sent to broadcasts & stories.
839
- you need to add the following message options in sendMessage, like this:
840
- ```ts
841
- sock.sendMessage(jid, {image: {url: url}, caption: caption}, {backgroundColor : backgroundColor, font : font, statusJidList: statusJidList, broadcast : true})
842
- ```
843
- - the message body can be a extendedTextMessage or imageMessage or videoMessage or voiceMessage
844
- - You can add backgroundColor and other options in the message options
845
- - broadcast: true enables broadcast mode
846
- - statusJidList: a list of people that you can get which you need to provide, which are the people who will get this status message.
847
-
848
- - You can send messages to broadcast lists the same way you send messages to groups & individual chats.
849
- - Right now, WA Web does not support creating broadcast lists, but you can still delete them.
850
- - Broadcast IDs are in the format `12345678@broadcast`
851
- - To query a broadcast list's recipients & name:
852
- ``` ts
853
- const bList = await sock.getBroadcastListInfo("1234@broadcast")
854
- console.log (`list name: ${bList.name}, recps: ${bList.recipients}`)
855
- ```
856
-
857
- ## Writing Custom Functionality
858
- Baileys is written with custom functionality in mind. Instead of forking the project & re-writing the internals, you can simply write your own extensions.
859
-
860
- First, enable the logging of unhandled messages from WhatsApp by setting:
861
- ``` ts
862
- const sock = makeWASocket({
863
- logger: P({ level: 'debug' }),
864
- })
865
- ```
866
- This will enable you to see all sorts of messages WhatsApp sends in the console.
867
-
868
- Some examples:
869
-
870
- 1. Functionality to track the battery percentage of your phone.
871
- You enable logging and you'll see a message about your battery pop up in the console:
872
- ```{"level":10,"fromMe":false,"frame":{"tag":"ib","attrs":{"from":"@s.whatsapp.net"},"content":[{"tag":"edge_routing","attrs":{},"content":[{"tag":"routing_info","attrs":{},"content":{"type":"Buffer","data":[8,2,8,5]}}]}]},"msg":"communication"} ```
873
-
874
- The "frame" is what the message received is, it has three components:
875
- - `tag` -- what this frame is about (eg. message will have "message")
876
- - `attrs` -- a string key-value pair with some metadata (contains ID of the message usually)
877
- - `content` -- the actual data (eg. a message node will have the actual message content in it)
878
- - read more about this format [here](/src/WABinary/readme.md)
879
-
880
- You can register a callback for an event using the following:
881
- ``` ts
882
- // for any message with tag 'edge_routing'
883
- sock.ws.on(`CB:edge_routing`, (node: BinaryNode) => { })
884
- // for any message with tag 'edge_routing' and id attribute = abcd
885
- sock.ws.on(`CB:edge_routing,id:abcd`, (node: BinaryNode) => { })
886
- // for any message with tag 'edge_routing', id attribute = abcd & first content node routing_info
887
- sock.ws.on(`CB:edge_routing,id:abcd,routing_info`, (node: BinaryNode) => { })
888
- ```
889
- Also, this repo is now licenced under GPL 3 since it uses [libsignal-node](https://git.questbook.io/backend/service-coderunner/-/merge_requests/1)
19
+ 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.
20
+ Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
21
+
22
+ # License
23
+ Copyright (c) 2025 Rajeh Taher/WhiskeySockets
24
+
25
+ Licensed under the MIT License:
26
+ Permission is hereby granted, free of charge, to any person obtaining a copy
27
+ of this software and associated documentation files (the "Software"), to deal
28
+ in the Software without restriction, including without limitation the rights
29
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30
+ copies of the Software, and to permit persons to whom the Software is
31
+ furnished to do so, subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in all
34
+ copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
+ SOFTWARE.
43
+
44
+ Thus, the maintainers of the project can't be held liable for any potential misuse of this project.