You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`deviceDataChanged`| ❌ | 🟢 | Device data changed |
1374
+
|`raw`| 🔵 | 🟢 | Raw event from LightSpeed/whatsmeow |
1373
1375
|`fullyReady`| 🔵 | 🟢 | Client fully ready |
1374
1376
|`disconnected`| 🔵 | 🟢 | Disconnected |
1375
1377
|`error`| 🔵 | 🟢 | Error occurred |
@@ -1720,6 +1722,39 @@ This event is only emitted when you initialize the client with the `deviceData`
1720
1722
1721
1723
---
1722
1724
1725
+
<aname="event-raw"></a>
1726
+
## Event: 'raw'
1727
+
1728
+
> 🔵🟢 **Both Socket and E2EE** - All raw events from LightSpeed and whatsmeow
1729
+
1730
+
Emitted for all incoming events from the LightSpeed (regular messages) and whatsmeow (E2EE) channels. This is useful for debugging or accessing raw event data that may not be processed by standard event handlers.
1731
+
1732
+
```typescript
1733
+
client.on('raw', (data) => {
1734
+
console.log(`Raw event from ${data.from}: ${data.type}`)
1735
+
console.log(data.data)
1736
+
})
1737
+
```
1738
+
1739
+
__Data object__
1740
+
1741
+
*`from`: `'lightspeed'` | `'whatsmeow'` - Source channel of the event
1742
+
*`type`: string - Name of the event type (e.g., `"Event_Ready"`, `"FBMessage"`)
1743
+
*`data`: unknown - Raw event data (structure depends on the source)
1744
+
1745
+
__Event sources__
1746
+
1747
+
| Source | Description |
1748
+
|--------|-------------|
1749
+
|`lightspeed`| Events from LightSpeed protocol (regular Messenger) |
1750
+
|`whatsmeow`| Events from whatsmeow library (E2EE via WhatsApp protocol) |
1751
+
1752
+
__Note__
1753
+
1754
+
This event is emitted before the standard event handlers process the event. The raw data structure may vary depending on the source and event type. Use this for debugging or handling events not explicitly supported by the library.
1755
+
1756
+
---
1757
+
1723
1758
# Types
1724
1759
1725
1760
## Cookies
@@ -1734,22 +1769,41 @@ interface Cookies {
1734
1769
}
1735
1770
```
1736
1771
1737
-
## Message
1772
+
## BaseMessage
1773
+
1774
+
Base interface shared by regular and E2EE messages.
1738
1775
1739
1776
```typescript
1740
-
interfaceMessage {
1741
-
id:string
1742
-
threadId:number
1743
-
senderId:number
1744
-
text:string
1745
-
timestampMs:number
1746
-
isE2EE?:boolean
1747
-
chatJid?:string
1748
-
senderJid?:string
1777
+
interfaceBaseMessage {
1778
+
id:string// Message ID
1779
+
threadId:number// Thread ID (Facebook numeric ID)
1780
+
senderId:number// Sender's Facebook ID
1781
+
text:string// Message text content
1782
+
timestampMs:number// Timestamp in milliseconds
1749
1783
attachments?:Attachment[]
1750
1784
replyTo?:ReplyTo
1751
1785
mentions?:Mention[]
1752
-
isAdminMsg?:boolean
1786
+
}
1787
+
```
1788
+
1789
+
## Message
1790
+
1791
+
Regular message (non-E2EE). Extends [BaseMessage](#basemessage). Received via the `message` event.
1792
+
1793
+
```typescript
1794
+
interfaceMessageextendsBaseMessage {
1795
+
isAdminMsg?:boolean// Whether this is an admin/system message
1796
+
}
1797
+
```
1798
+
1799
+
## E2EEMessage
1800
+
1801
+
End-to-end encrypted message. Extends [BaseMessage](#basemessage). Received via the `e2eeMessage` event.
1802
+
1803
+
```typescript
1804
+
interfaceE2EEMessageextendsBaseMessage {
1805
+
chatJid:string// Chat JID (required for E2EE operations)
1806
+
senderJid:string// Sender JID (required for E2EE operations)
@@ -1720,6 +1722,39 @@ Event này chỉ được phát ra khi bạn khởi tạo client với option `d
1720
1722
1721
1723
---
1722
1724
1725
+
<aname="event-raw"></a>
1726
+
## Event: 'raw'
1727
+
1728
+
> 🔵🟢 **Cả Socket và E2EE** - Tất cả event thô từ LightSpeed và whatsmeow
1729
+
1730
+
Phát ra cho tất cả các event đến từ kênh LightSpeed (tin nhắn thường) và whatsmeow (E2EE). Hữu ích cho việc debug hoặc truy cập dữ liệu event thô không được xử lý bởi các event handler tiêu chuẩn.
1731
+
1732
+
```typescript
1733
+
client.on('raw', (data) => {
1734
+
console.log(`Raw event từ ${data.from}: ${data.type}`)
1735
+
console.log(data.data)
1736
+
})
1737
+
```
1738
+
1739
+
__Data object__
1740
+
1741
+
*`from`: `'lightspeed'` | `'whatsmeow'` - Kênh nguồn của event
1742
+
*`type`: string - Tên loại event (ví dụ: `"Event_Ready"`, `"FBMessage"`)
1743
+
*`data`: unknown - Dữ liệu event thô (cấu trúc phụ thuộc vào nguồn)
1744
+
1745
+
__Nguồn event__
1746
+
1747
+
| Nguồn | Mô tả |
1748
+
|--------|-------------|
1749
+
|`lightspeed`| Event từ giao thức LightSpeed (Messenger thường) |
1750
+
|`whatsmeow`| Event từ thư viện whatsmeow (E2EE qua giao thức WhatsApp) |
1751
+
1752
+
__Lưu ý__
1753
+
1754
+
Event này được phát ra trước khi các event handler tiêu chuẩn xử lý event. Cấu trúc dữ liệu thô có thể thay đổi tùy thuộc vào nguồn và loại event. Sử dụng để debug hoặc xử lý các event không được thư viện hỗ trợ rõ ràng.
1755
+
1756
+
---
1757
+
1723
1758
# Types
1724
1759
1725
1760
## Cookies
@@ -1734,22 +1769,41 @@ interface Cookies {
1734
1769
}
1735
1770
```
1736
1771
1737
-
## Message
1772
+
## BaseMessage
1773
+
1774
+
Interface cơ sở dùng chung cho tin nhắn thường và E2EE.
1738
1775
1739
1776
```typescript
1740
-
interfaceMessage {
1741
-
id:string
1742
-
threadId:number
1743
-
senderId:number
1744
-
text:string
1745
-
timestampMs:number
1746
-
isE2EE?:boolean
1747
-
chatJid?:string
1748
-
senderJid?:string
1777
+
interfaceBaseMessage {
1778
+
id:string// ID tin nhắn
1779
+
threadId:number// Thread ID (Facebook numeric ID)
1780
+
senderId:number// Facebook ID của người gửi
1781
+
text:string// Nội dung văn bản
1782
+
timestampMs:number// Timestamp tính bằng milliseconds
1749
1783
attachments?:Attachment[]
1750
1784
replyTo?:ReplyTo
1751
1785
mentions?:Mention[]
1752
-
isAdminMsg?:boolean
1786
+
}
1787
+
```
1788
+
1789
+
## Message
1790
+
1791
+
Tin nhắn thường (không E2EE). Kế thừa [BaseMessage](#basemessage). Nhận qua event `message`.
1792
+
1793
+
```typescript
1794
+
interfaceMessageextendsBaseMessage {
1795
+
isAdminMsg?:boolean// Có phải tin nhắn hệ thống không
1796
+
}
1797
+
```
1798
+
1799
+
## E2EEMessage
1800
+
1801
+
Tin nhắn mã hóa đầu cuối. Kế thừa [BaseMessage](#basemessage). Nhận qua event `e2eeMessage`.
1802
+
1803
+
```typescript
1804
+
interfaceE2EEMessageextendsBaseMessage {
1805
+
chatJid:string// Chat JID (bắt buộc cho các thao tác E2EE)
1806
+
senderJid:string// Sender JID (bắt buộc cho các thao tác E2EE)
0 commit comments