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.
Files changed (2) hide show
  1. package/README.md +24 -26
  2. 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" border='4' src="https://socialify.git.ci/zeative/zaileys/image?description=1&amp;descriptionEditable=Zaileys%20is%20a%20simplified%20version%20of%20the%20Baileys%20package%20%0Awhich%20is%20easier%20and%20faster.&amp;font=KoHo&amp;forks=1&amp;issues=1&amp;language=1&amp;name=1&amp;owner=1&amp;pattern=Circuit%20Board&amp;pulls=1&amp;stargazers=1&amp;theme=Auto">
2
+ <img alt="Zaileys - Simplify Typescript/Javascript WhatsApp NodeJS API" src="https://socialify.git.ci/zeative/zaileys/image?description=1&amp;descriptionEditable=Zaileys%20is%20a%20simplified%20version%20of%20the%20Baileys%20package%20%0Awhich%20is%20easier%20and%20faster.&amp;font=KoHo&amp;forks=1&amp;issues=1&amp;language=1&amp;name=1&amp;owner=1&amp;pattern=Circuit%20Board&amp;pulls=1&amp;stargazers=1&amp;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
  [![NPM Version](https://img.shields.io/npm/v/zaileys.svg)](https://www.npmjs.com/package/zaileys)
10
- [![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/zeative/zaileys/total)](https://www.npmjs.com/package/zaileys)
11
- [![NPM Downloads](https://img.shields.io/npm/dw/%40zeative%2Fzaileys?label=npm&color=%23CB3837)](https://www.npmjs.com/package/zaileys)
10
+ [![NPM Downloads](https://img.shields.io/npm/dw/zaileys?label=npm&color=%23CB3837)](https://www.npmjs.com/package/zaileys)
12
11
  [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/zeative/zaileys)](https://www.npmjs.com/package/zaileys)
13
12
  [![GitHub License](https://img.shields.io/github/license/zeative/zaileys)](https://github.com/zeative/zaileys)
14
- <br>
15
13
  [![GitHub Repo stars](https://img.shields.io/github/stars/zeative/zaileys)](https://github.com/zeative/zaileys)
16
14
  [![GitHub forks](https://img.shields.io/github/forks/zeative/zaileys)](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
- ctx.sendText("Hello! " + ctx.senderName);
133
+ wa.sendText("Hello! " + ctx.senderName);
136
134
  }
137
135
 
138
136
  // text from reply message
139
137
  if (ctx.reply?.text == "ping") {
140
- ctx.sendText("Pong from reply!");
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
- ctx.sendText("Pong from nested reply!");
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
- ctx.sendText("Ping!", { footer: "Footer message" });
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
- ctx.sendReply("Pong!");
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
- ctx.sendReply("Ping!", { footer: "Footer message" });
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
- ctx.sendReply("Fake Verified!", { fakeVerified: "whatsapp" });
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
- ctx.sendSticker(sticker);
191
+ wa.sendSticker(sticker);
194
192
  }
195
193
 
196
194
  if (ctx.text == "sticker") {
197
- ctx.sendSticker("https://gtihub.com/zeative.png");
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
- ctx.sendImage(image);
211
+ wa.sendImage(image);
214
212
  }
215
213
 
216
214
  if (ctx.text == "image") {
217
- ctx.sendImage("https://gtihub.com/zeative.png");
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
- ctx.sendImage(picture);
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
- ctx.sendVideo(video);
237
+ wa.sendVideo(video);
240
238
  }
241
239
 
242
240
  if (ctx.text == "video") {
243
- ctx.sendVideo("https://gtihub.com/zeative.png");
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
- ctx.sendAudio(audio);
257
+ wa.sendAudio(audio);
260
258
  }
261
259
 
262
260
  if (ctx.text == "audio") {
263
- ctx.sendAudio("https://gtihub.com/zeative.png");
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
- ctx.sendText("From command message!");
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
- ctx.sendText("Here user mentioned: @0 @18002428478");
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
- ctx.sendText("Message for my author: kejaa");
332
+ wa.sendText("Message for my author: kejaa");
335
333
  }
336
334
 
337
335
  if (isMyPrivateGroups && ctx.text == "test2") {
338
- ctx.sendText("Message for my private group!");
336
+ wa.sendText("Message for my private group!");
339
337
  }
340
338
 
341
339
  if (isBannedUsers && ctx.text) {
342
- ctx.sendText("Your number is banned!");
340
+ wa.sendText("Your number is banned!");
343
341
  }
344
342
  });
345
343
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zaileys",
3
- "version": "0.28.97-beta",
3
+ "version": "0.28.99-beta",
4
4
  "description": "Zaileys - Simplify Typescript/Javascript WhatsApp NodeJS API",
5
5
  "keywords": [
6
6
  "zaileys",