@than-xs/baileys 2.0.4 → 2.0.5

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/lib/index.js +20 -31
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -6,50 +6,39 @@ const fs = require("fs");
6
6
  const stats = fs.statSync(__filename);
7
7
  const lastUpdate = new Date(stats.mtime).toLocaleString();
8
8
 
9
- const lines = [
10
- "Baileys Custom Build",
11
- "by @thanror",
12
- `Last Update : ${lastUpdate}`,
13
- "Status : Active & Ready"
14
- ];
15
-
16
- const maxLength = Math.max(...lines.map(l => l.length));
17
- const horizontal = "━".repeat(maxLength + 6);
18
-
19
- let hueOffset = 0;
20
- let bannerHeight = lines.length + 3;
9
+ const randomHue = Math.floor(Math.random() * 360);
21
10
 
22
11
  function gradient(text, offset = 0) {
23
12
  return text
24
13
  .split("")
25
14
  .map((char, i) => {
26
- const hue = (hueOffset + offset + i * 6) % 360;
27
- return chalk.hsl(hue, 100, 50)(char);
15
+ const hue = (randomHue + offset + i * 5) % 360;
16
+ return chalk.hsl(hue, 100, 55)(char);
28
17
  })
29
18
  .join("");
30
19
  }
31
20
 
32
- function render() {
33
- process.stdout.write(`\x1b[${bannerHeight}A`);
34
-
35
- process.stdout.write("\n");
36
- process.stdout.write(gradient("┏" + horizontal) + "\n");
21
+ const lines = [
22
+ "Baileys Custom Build",
23
+ "by @thanror",
24
+ `Last Update : ${lastUpdate}`,
25
+ "Status : Active & Ready"
26
+ ];
37
27
 
38
- lines.forEach((line, index) => {
39
- const padding = " ".repeat(maxLength - line.length);
40
- const content = " " + line + padding + " ";
41
- process.stdout.write(gradient("┃ " + content, index * 30) + "\n");
42
- });
28
+ const maxLength = Math.max(...lines.map(l => l.length));
29
+ const horizontal = "".repeat(maxLength + 4);
43
30
 
44
- process.stdout.write(gradient("┗" + horizontal, 120) + "\n\n");
45
- }
31
+ console.log();
32
+ console.log(gradient("┏" + horizontal));
46
33
 
47
- render();
34
+ lines.forEach((line, index) => {
35
+ const padding = " ".repeat(maxLength - line.length);
36
+ const content = " " + line + padding + " ";
37
+ console.log(gradient("┃" + content, index * 20));
38
+ });
48
39
 
49
- setInterval(() => {
50
- hueOffset += 20;
51
- render();
52
- }, 1000);
40
+ console.log(gradient("┗" + horizontal, 100));
41
+ console.log();
53
42
 
54
43
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
55
44
  if (k2 === undefined) k2 = k;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@than-xs/baileys",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Customized WhatsApp WebSocket API for Node.js",
5
5
  "keywords": [
6
6
  "whatsapp",