zaileys 0.28.97-beta → 0.28.99-beta
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 +24 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align='center'>
|
|
2
|
-
<img alt="Zaileys - Simplify Typescript/Javascript WhatsApp NodeJS API"
|
|
2
|
+
<img alt="Zaileys - Simplify Typescript/Javascript WhatsApp NodeJS API" src="https://socialify.git.ci/zeative/zaileys/image?description=1&descriptionEditable=Zaileys%20is%20a%20simplified%20version%20of%20the%20Baileys%20package%20%0Awhich%20is%20easier%20and%20faster.&font=KoHo&forks=1&issues=1&language=1&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Auto">
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Zaileys - Simplify Typescript/Javascript WhatsApp NodeJS API</h1>
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
<div align='center'>
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/zaileys)
|
|
10
|
-
[](https://www.npmjs.com/package/zaileys)
|
|
10
|
+
[](https://www.npmjs.com/package/zaileys)
|
|
12
11
|
[](https://www.npmjs.com/package/zaileys)
|
|
13
12
|
[](https://github.com/zeative/zaileys)
|
|
14
|
-
<br>
|
|
15
13
|
[](https://github.com/zeative/zaileys)
|
|
16
14
|
[](https://github.com/zeative/zaileys)
|
|
17
15
|
|
|
@@ -132,23 +130,23 @@ wa.on("connection", (ctx) => {
|
|
|
132
130
|
```ts
|
|
133
131
|
wa.on("message", (ctx) => {
|
|
134
132
|
if (ctx.text == "ping") {
|
|
135
|
-
|
|
133
|
+
wa.sendText("Hello! " + ctx.senderName);
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
// text from reply message
|
|
139
137
|
if (ctx.reply?.text == "ping") {
|
|
140
|
-
|
|
138
|
+
wa.sendText("Pong from reply!");
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
// text from nested reply message
|
|
144
142
|
// you can retrieve reply messages of any depth
|
|
145
143
|
if (ctx.reply?.reply?.reply?.text == "ping") {
|
|
146
|
-
|
|
144
|
+
wa.sendText("Pong from nested reply!");
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
// text with footer message (doesn't work on whatsapp desktop)
|
|
150
148
|
if (ctx.text == "pong") {
|
|
151
|
-
|
|
149
|
+
wa.sendText("Ping!", { footer: "Footer message" });
|
|
152
150
|
}
|
|
153
151
|
});
|
|
154
152
|
```
|
|
@@ -162,17 +160,17 @@ wa.on("message", (ctx) => {
|
|
|
162
160
|
```ts
|
|
163
161
|
wa.on("message", (ctx) => {
|
|
164
162
|
if (ctx.text == "ping") {
|
|
165
|
-
|
|
163
|
+
wa.sendReply("Pong!");
|
|
166
164
|
}
|
|
167
165
|
|
|
168
166
|
// reply with footer message (doesn't work on whatsapp desktop)
|
|
169
167
|
if (ctx.text == "pong") {
|
|
170
|
-
|
|
168
|
+
wa.sendReply("Ping!", { footer: "Footer message" });
|
|
171
169
|
}
|
|
172
170
|
|
|
173
171
|
// reply with fake verified badge
|
|
174
172
|
if (ctx.text == "fake") {
|
|
175
|
-
|
|
173
|
+
wa.sendReply("Fake Verified!", { fakeVerified: "whatsapp" });
|
|
176
174
|
}
|
|
177
175
|
});
|
|
178
176
|
```
|
|
@@ -190,11 +188,11 @@ wa.on("message", async (ctx) => {
|
|
|
190
188
|
if (ctx.chatType == "sticker") {
|
|
191
189
|
const sticker = await ctx.media?.buffer!();
|
|
192
190
|
|
|
193
|
-
|
|
191
|
+
wa.sendSticker(sticker);
|
|
194
192
|
}
|
|
195
193
|
|
|
196
194
|
if (ctx.text == "sticker") {
|
|
197
|
-
|
|
195
|
+
wa.sendSticker("https://gtihub.com/zeative.png");
|
|
198
196
|
}
|
|
199
197
|
});
|
|
200
198
|
```
|
|
@@ -210,17 +208,17 @@ wa.on("message", async (ctx) => {
|
|
|
210
208
|
if (ctx.chatType == "image") {
|
|
211
209
|
const image = await ctx.media?.buffer!();
|
|
212
210
|
|
|
213
|
-
|
|
211
|
+
wa.sendImage(image);
|
|
214
212
|
}
|
|
215
213
|
|
|
216
214
|
if (ctx.text == "image") {
|
|
217
|
-
|
|
215
|
+
wa.sendImage("https://gtihub.com/zeative.png");
|
|
218
216
|
}
|
|
219
217
|
|
|
220
218
|
if (ctx.text == "mypp") {
|
|
221
219
|
const picture = await ctx.senderImage();
|
|
222
220
|
|
|
223
|
-
|
|
221
|
+
wa.sendImage(picture);
|
|
224
222
|
}
|
|
225
223
|
});
|
|
226
224
|
```
|
|
@@ -236,11 +234,11 @@ wa.on("message", async (ctx) => {
|
|
|
236
234
|
if (ctx.chatType == "video") {
|
|
237
235
|
const video = await ctx.media?.buffer!();
|
|
238
236
|
|
|
239
|
-
|
|
237
|
+
wa.sendVideo(video);
|
|
240
238
|
}
|
|
241
239
|
|
|
242
240
|
if (ctx.text == "video") {
|
|
243
|
-
|
|
241
|
+
wa.sendVideo("https://gtihub.com/zeative.png");
|
|
244
242
|
}
|
|
245
243
|
});
|
|
246
244
|
```
|
|
@@ -256,11 +254,11 @@ wa.on("message", async (ctx) => {
|
|
|
256
254
|
if (ctx.chatType == "audio") {
|
|
257
255
|
const audio = await ctx.media?.buffer!();
|
|
258
256
|
|
|
259
|
-
|
|
257
|
+
wa.sendAudio(audio);
|
|
260
258
|
}
|
|
261
259
|
|
|
262
260
|
if (ctx.text == "audio") {
|
|
263
|
-
|
|
261
|
+
wa.sendAudio("https://gtihub.com/zeative.png");
|
|
264
262
|
}
|
|
265
263
|
});
|
|
266
264
|
```
|
|
@@ -277,7 +275,7 @@ wa.on("message", async (ctx) => {
|
|
|
277
275
|
// for example set prefix to "/"
|
|
278
276
|
// and user text "/test"
|
|
279
277
|
if (ctx.command == "test") {
|
|
280
|
-
|
|
278
|
+
wa.sendText("From command message!");
|
|
281
279
|
}
|
|
282
280
|
});
|
|
283
281
|
```
|
|
@@ -292,7 +290,7 @@ wa.on("message", async (ctx) => {
|
|
|
292
290
|
```ts
|
|
293
291
|
wa.on("message", async (ctx) => {
|
|
294
292
|
if (ctx.text == "mentions") {
|
|
295
|
-
|
|
293
|
+
wa.sendText("Here user mentioned: @0 @18002428478");
|
|
296
294
|
// example output: "Here user mentioned: @WhatsApp @ChatGPT"
|
|
297
295
|
|
|
298
296
|
// if `autoMentions` is inactive or `false`
|
|
@@ -329,17 +327,17 @@ wa.on("message", async (ctx) => {
|
|
|
329
327
|
const isAuthors = ctx.citation?.isAuthors;
|
|
330
328
|
const isMyPrivateGroups = ctx.citation?.isMyPrivateGroups;
|
|
331
329
|
const isBannedUsers = ctx.citation?.isBannedUsers;
|
|
332
|
-
|
|
330
|
+
|
|
333
331
|
if (isAuthors && ctx.text == "test1") {
|
|
334
|
-
|
|
332
|
+
wa.sendText("Message for my author: kejaa");
|
|
335
333
|
}
|
|
336
334
|
|
|
337
335
|
if (isMyPrivateGroups && ctx.text == "test2") {
|
|
338
|
-
|
|
336
|
+
wa.sendText("Message for my private group!");
|
|
339
337
|
}
|
|
340
338
|
|
|
341
339
|
if (isBannedUsers && ctx.text) {
|
|
342
|
-
|
|
340
|
+
wa.sendText("Your number is banned!");
|
|
343
341
|
}
|
|
344
342
|
});
|
|
345
343
|
```
|