@fvckerss/baileys 1.0.18 → 1.0.20

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 CHANGED
@@ -283,6 +283,71 @@ await sock.sendMessage(jid, {
283
283
 
284
284
  ---
285
285
 
286
+ ### 📍 Button Location
287
+
288
+ ```
289
+ const fs = require("fs");
290
+ const sharp = require("sharp");
291
+ const axios = require("axios");
292
+ let prefix = ".";
293
+ async function getLocationThumb(input = './media/image/thumbnail.jpg') {
294
+ try {
295
+ let buffer;
296
+ if (/^https?:\/\//.test(input)) {
297
+ const res = await axios.get(input, { responseType: 'arraybuffer', timeout: 15000 });
298
+ buffer = Buffer.from(res.data);
299
+ } else {
300
+ if (!fs.existsSync(input)) return Buffer.alloc(0);
301
+ buffer = fs.readFileSync(input);
302
+ }
303
+ return await sharp(buffer).resize(300, 180, { fit: 'cover' }).jpeg({ quality: 70 }).toBuffer();
304
+ } catch (e) {
305
+ console.error("Gagal mengompres gambar menu:", e);
306
+ return Buffer.alloc(0);
307
+ }
308
+ }
309
+ const thumb = await getLocationThumb('./media/image/thumbnail.jpg');
310
+ const buttonMessage = {
311
+ location: {
312
+ degreesLatitude: 0,
313
+ degreesLongitude: 0,
314
+ name: 'Swiper Fvck',
315
+ address: 'Fvckers',
316
+ jpegThumbnail: thumb
317
+ },
318
+ caption: `Swiper Fvck`,
319
+ footer: `Fvckers`,
320
+ headerType: 6,
321
+ viewOnce: true,
322
+ buttons: [
323
+ {
324
+ buttonId: 'action',
325
+ buttonText: { displayText: 'Touch Me' },
326
+ type: 1,
327
+ nativeFlowInfo: {
328
+ name: 'single_select',
329
+ paramsJson: JSON.stringify({
330
+ title: `Fvckers Botz`,
331
+ sections: [{
332
+ title: "",
333
+ highlight_label: "Fvckers",
334
+ rows: [
335
+ { title: "Swiper", description: "", id: `${prefix}menu` },
336
+ { title: "Swiper", description: "", id: `${prefix}menu`}
337
+ ]
338
+ }]
339
+ })
340
+ }
341
+ },
342
+ { buttonId: `${prefix}tools`, buttonText: { displayText: 'Tools' }, type: 1 },
343
+ ],
344
+ };
345
+ await sock.sendMessage(m.chat, buttonMessage, { quoted: m });
346
+ })()
347
+ ```
348
+
349
+ ---
350
+
286
351
  ### 📋 List Message
287
352
 
288
353
  ```
@@ -2,7 +2,7 @@ import { proto } from '../../WAProto/index.js';
2
2
  import { makeLibSignalRepository } from '../Signal/libsignal.js';
3
3
  import { Browsers } from '../Utils/browser-utils.js';
4
4
  import logger from '../Utils/logger.js';
5
- const version = [2, 3000, 1033846690];
5
+ const version = [2, 3000, 1033105955];
6
6
  export const UNAUTHORIZED_CODES = [401, 403, 419];
7
7
  export const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"should_upload_client_logs":false,"should_show_system_message":false,"ticket_id":"7004947587700716","citation_items":[],"ticket_locale":"us"}';
8
8
  export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';