zaileys 0.28.97-beta → 0.28.98-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 +23 -23
- 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>
|
|
@@ -132,23 +132,23 @@ wa.on("connection", (ctx) => {
|
|
|
132
132
|
```ts
|
|
133
133
|
wa.on("message", (ctx) => {
|
|
134
134
|
if (ctx.text == "ping") {
|
|
135
|
-
|
|
135
|
+
wa.sendText("Hello! " + ctx.senderName);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// text from reply message
|
|
139
139
|
if (ctx.reply?.text == "ping") {
|
|
140
|
-
|
|
140
|
+
wa.sendText("Pong from reply!");
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
// text from nested reply message
|
|
144
144
|
// you can retrieve reply messages of any depth
|
|
145
145
|
if (ctx.reply?.reply?.reply?.text == "ping") {
|
|
146
|
-
|
|
146
|
+
wa.sendText("Pong from nested reply!");
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
// text with footer message (doesn't work on whatsapp desktop)
|
|
150
150
|
if (ctx.text == "pong") {
|
|
151
|
-
|
|
151
|
+
wa.sendText("Ping!", { footer: "Footer message" });
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
```
|
|
@@ -162,17 +162,17 @@ wa.on("message", (ctx) => {
|
|
|
162
162
|
```ts
|
|
163
163
|
wa.on("message", (ctx) => {
|
|
164
164
|
if (ctx.text == "ping") {
|
|
165
|
-
|
|
165
|
+
wa.sendReply("Pong!");
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// reply with footer message (doesn't work on whatsapp desktop)
|
|
169
169
|
if (ctx.text == "pong") {
|
|
170
|
-
|
|
170
|
+
wa.sendReply("Ping!", { footer: "Footer message" });
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
// reply with fake verified badge
|
|
174
174
|
if (ctx.text == "fake") {
|
|
175
|
-
|
|
175
|
+
wa.sendReply("Fake Verified!", { fakeVerified: "whatsapp" });
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
```
|
|
@@ -190,11 +190,11 @@ wa.on("message", async (ctx) => {
|
|
|
190
190
|
if (ctx.chatType == "sticker") {
|
|
191
191
|
const sticker = await ctx.media?.buffer!();
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
wa.sendSticker(sticker);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
if (ctx.text == "sticker") {
|
|
197
|
-
|
|
197
|
+
wa.sendSticker("https://gtihub.com/zeative.png");
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
```
|
|
@@ -210,17 +210,17 @@ wa.on("message", async (ctx) => {
|
|
|
210
210
|
if (ctx.chatType == "image") {
|
|
211
211
|
const image = await ctx.media?.buffer!();
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
wa.sendImage(image);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
if (ctx.text == "image") {
|
|
217
|
-
|
|
217
|
+
wa.sendImage("https://gtihub.com/zeative.png");
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
if (ctx.text == "mypp") {
|
|
221
221
|
const picture = await ctx.senderImage();
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
wa.sendImage(picture);
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
```
|
|
@@ -236,11 +236,11 @@ wa.on("message", async (ctx) => {
|
|
|
236
236
|
if (ctx.chatType == "video") {
|
|
237
237
|
const video = await ctx.media?.buffer!();
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
wa.sendVideo(video);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
if (ctx.text == "video") {
|
|
243
|
-
|
|
243
|
+
wa.sendVideo("https://gtihub.com/zeative.png");
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
```
|
|
@@ -256,11 +256,11 @@ wa.on("message", async (ctx) => {
|
|
|
256
256
|
if (ctx.chatType == "audio") {
|
|
257
257
|
const audio = await ctx.media?.buffer!();
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
wa.sendAudio(audio);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
if (ctx.text == "audio") {
|
|
263
|
-
|
|
263
|
+
wa.sendAudio("https://gtihub.com/zeative.png");
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
```
|
|
@@ -277,7 +277,7 @@ wa.on("message", async (ctx) => {
|
|
|
277
277
|
// for example set prefix to "/"
|
|
278
278
|
// and user text "/test"
|
|
279
279
|
if (ctx.command == "test") {
|
|
280
|
-
|
|
280
|
+
wa.sendText("From command message!");
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
283
|
```
|
|
@@ -292,7 +292,7 @@ wa.on("message", async (ctx) => {
|
|
|
292
292
|
```ts
|
|
293
293
|
wa.on("message", async (ctx) => {
|
|
294
294
|
if (ctx.text == "mentions") {
|
|
295
|
-
|
|
295
|
+
wa.sendText("Here user mentioned: @0 @18002428478");
|
|
296
296
|
// example output: "Here user mentioned: @WhatsApp @ChatGPT"
|
|
297
297
|
|
|
298
298
|
// if `autoMentions` is inactive or `false`
|
|
@@ -329,17 +329,17 @@ wa.on("message", async (ctx) => {
|
|
|
329
329
|
const isAuthors = ctx.citation?.isAuthors;
|
|
330
330
|
const isMyPrivateGroups = ctx.citation?.isMyPrivateGroups;
|
|
331
331
|
const isBannedUsers = ctx.citation?.isBannedUsers;
|
|
332
|
-
|
|
332
|
+
|
|
333
333
|
if (isAuthors && ctx.text == "test1") {
|
|
334
|
-
|
|
334
|
+
wa.sendText("Message for my author: kejaa");
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
if (isMyPrivateGroups && ctx.text == "test2") {
|
|
338
|
-
|
|
338
|
+
wa.sendText("Message for my private group!");
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
if (isBannedUsers && ctx.text) {
|
|
342
|
-
|
|
342
|
+
wa.sendText("Your number is banned!");
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
```
|