wolfsocket 1.0.0 → 1.0.1
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.
- package/README.md +51 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,56 @@ await sock.sendGroupStatus(groupJid, { sticker: stickerBuffer })
|
|
|
39
39
|
|
|
40
40
|
`groupJid` is a normal group JID (ends in `@g.us`) — the same one you'd pass to `sock.sendMessage()`.
|
|
41
41
|
|
|
42
|
+
## Reliable DM replies
|
|
43
|
+
|
|
44
|
+
For direct-message bots, always reply using the incoming message's
|
|
45
|
+
`msg.key.remoteJid`. This may be a phone-number JID (`@s.whatsapp.net`) or a
|
|
46
|
+
Linked Device ID (`@lid`). Do not manually convert the JID or assume that every
|
|
47
|
+
contact uses the phone-number form; the socket uses the incoming JID together
|
|
48
|
+
with its LID mapping and device sessions to route the message correctly.
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
52
|
+
if (type !== 'notify') return
|
|
53
|
+
|
|
54
|
+
for (const msg of messages) {
|
|
55
|
+
const jid = msg.key.remoteJid
|
|
56
|
+
const text = msg.message?.conversation || msg.message?.extendedTextMessage?.text
|
|
57
|
+
if (!jid || !text || msg.key.fromMe) continue
|
|
58
|
+
|
|
59
|
+
if (text.trim() === '!ping') {
|
|
60
|
+
await sock.sendMessage(jid, { text: 'pong' })
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
When troubleshooting missing DM replies, log the returned message key and
|
|
67
|
+
listen for `messages.update` and `message-receipt.update` events using the same
|
|
68
|
+
message ID. A successful `sendMessage()` call confirms that the socket accepted
|
|
69
|
+
the message; delivery/read updates help confirm what happened afterward.
|
|
70
|
+
|
|
71
|
+
This repository also contains a local-only diagnostic script named `test.ts`
|
|
72
|
+
(ignored by Git). Run it with `npx tsx test.ts`, then send `!ping`, `!testdm`, or
|
|
73
|
+
`!testdm-one` in a direct chat. The script records the JID form and outgoing
|
|
74
|
+
message updates without becoming part of the published package.
|
|
75
|
+
|
|
76
|
+
### Sticker compatibility
|
|
77
|
+
|
|
78
|
+
When a bot receives a sticker and wants to repost it as a group status, it should
|
|
79
|
+
parse the sticker into a supported media format before posting it. Convert static
|
|
80
|
+
stickers to an image (such as PNG), and convert animated stickers to a video (such
|
|
81
|
+
as MP4) so the animation is preserved. Then post the converted media with
|
|
82
|
+
`sendGroupStatus()`:
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
// static sticker converted to an image
|
|
86
|
+
await sock.sendGroupStatus(groupJid, { image: imageBuffer })
|
|
87
|
+
|
|
88
|
+
// animated sticker converted to a video
|
|
89
|
+
await sock.sendGroupStatus(groupJid, { video: videoBuffer, gifPlayback: true })
|
|
90
|
+
```
|
|
91
|
+
|
|
42
92
|
## API
|
|
43
93
|
|
|
44
94
|
### `sock.sendGroupStatus(jid, content)`
|
|
@@ -58,4 +108,4 @@ Returns a `Promise<WAMessage>` with the sent message's key.
|
|
|
58
108
|
|
|
59
109
|
## License
|
|
60
110
|
|
|
61
|
-
MIT — see [LICENSE](./LICENSE). This package is a modified fork of [Baileys](https://github.com/WhiskeySockets/Baileys) by Rajeh Taher / WhiskeySockets, used under its original MIT license. The original copyright notice is preserved in full; modifications and additions (including Group Status support) by Briton Kiplangat (Silent Wolf) / WOLF TECH are licensed under the same terms.
|
|
111
|
+
MIT — see [LICENSE](./LICENSE). This package is a modified fork of [Baileys](https://github.com/WhiskeySockets/Baileys) by Rajeh Taher / WhiskeySockets, used under its original MIT license. The original copyright notice is preserved in full; modifications and additions (including Group Status support) by Briton Kiplangat (Silent Wolf) / WOLF TECH are licensed under the same terms.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolfsocket",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "WOLF TECH fork of Baileys with native Group Status (groupStatusMessageV2) support for text, image, video, audio, and sticker posts.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|