fca-priyansh 17.0.0 → 19.0.0

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.
@@ -20,10 +20,10 @@ module.exports = async function(SessionID) {
20
20
  Database(true).set('PremiumKey', String(global.Fca.Require.Priyansh.PreKey));
21
21
  Database(true).set('UserName', userName);
22
22
  process.env.HalzionVersion = 1973
23
- Text = "Bạn Đang Sài Phiên Bản: Premium Access";
23
+ Text = "You Are Using Version: Premium Access";
24
24
  }
25
25
  catch (error) {
26
- Text = "Lỗi Kết Nối";
26
+ Text = "Connection Error";
27
27
  }
28
28
  } else if (global.Fca.Require.Priyansh.PreKey) {
29
29
  try {
@@ -31,10 +31,10 @@ module.exports = async function(SessionID) {
31
31
  Database(true).set('PremiumKey', String(global.Fca.Require.Priyansh.PreKey));
32
32
  Database(true).set('UserName', userName);
33
33
  process.env.HalzionVersion = 1973
34
- Text = "Bạn Đang Sài Phiên Bản: Premium Access";
34
+ Text = "You Are Using Version: Premium Access";
35
35
  }
36
36
  catch (error) {
37
- Text = "Lỗi Kết Nối";
37
+ Text = "Connection Error";
38
38
  }
39
39
  }
40
40
  else if (!global.Fca.Require.Priyansh.PreKey) {
@@ -43,10 +43,10 @@ module.exports = async function(SessionID) {
43
43
  Database(true).set('PremiumKey', String(global.Fca.Require.Priyansh.PreKey));
44
44
  Database(true).set('UserName', userName);
45
45
  process.env.HalzionVersion = 1973
46
- Text = "Bạn Đang Sài Phiên Bản: Premium Access";
46
+ Text = "You Are Using Version: Premium Access";
47
47
  }
48
48
  catch (error) {
49
- Text = "Lỗi Kết Nối";
49
+ Text = "Connection Error";
50
50
  }
51
51
  }
52
52
  } catch (e) {
@@ -55,10 +55,10 @@ module.exports = async function(SessionID) {
55
55
  Database(true).set('PremiumKey', String(global.Fca.Require.Priyansh.PreKey));
56
56
  Database(true).set('UserName', userName);
57
57
  process.env.HalzionVersion = 1973
58
- Text = "Bạn Đang Sài Phiên Bản: Premium Access";
58
+ Text = "You Are Using Version: Premium Access";
59
59
  }
60
60
  catch (error) {
61
- Text = "Lỗi Kết Nối";
61
+ Text = "Connection Error";
62
62
  }
63
63
  }
64
64
  if (process.env.HalzionVersion == 1973) {
@@ -68,7 +68,7 @@ class MemoryManager extends EventEmitter {
68
68
  }
69
69
 
70
70
  logMemoryUsage(memoryUsage) {
71
- const timestamp = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
71
+ const timestamp = new Date().toLocaleString("in-en", {timeZone: "Asia/Kolkata"});
72
72
  const logMessage = `${timestamp} - Memory usage: ${(memoryUsage * 100).toFixed(2)}%`;
73
73
 
74
74
  switch (this.logLevel) {
@@ -157,4 +157,4 @@ class MemoryManager extends EventEmitter {
157
157
 
158
158
  }
159
159
 
160
- module.exports = MemoryManager;
160
+ module.exports = MemoryManager;
package/Main.js CHANGED
@@ -37,160 +37,6 @@ log.maxRecordSize = 100;
37
37
  var checkVerified = null;
38
38
  const Boolean_Option = ['online','selfListen','listenEvents','updatePresence','forceLogin','autoMarkDelivery','autoMarkRead','listenTyping','autoReconnect','emitReady'];
39
39
 
40
- //-[ Set And Check Template HTML ]-!/
41
-
42
- const css = readFileSync(join(__dirname, 'Extra', 'Html', 'Classic', 'style.css'));
43
- const js = readFileSync(join(__dirname, 'Extra', 'Html', 'Classic', 'script.js'));
44
-
45
- //-[ Function Generate HTML Template ]-!/
46
-
47
- /**
48
- * It returns a string of HTML code.
49
- * @param UserName - The username of the user
50
- * @param Type - The type of user, either "Free" or "Premium"
51
- * @param link - The link to the music you want to play
52
- * @returns A HTML file
53
- */
54
-
55
- function ClassicHTML(UserName,Type,link) {
56
- return `<!DOCTYPE html>
57
- <html lang="en" >
58
- <head>
59
- <meta charset="UTF-8">
60
- <title>Horizon</title>
61
- <link rel="stylesheet" href="./style.css">
62
- </head>
63
- <body>
64
- <center>
65
- <marquee><b>waiting for u :d</b></marquee>
66
- <h2>Horizon User Infomation</h2>
67
- <h3>UserName: ${UserName} | Type: ${Type}</h3>
68
- <canvas id="myCanvas"></canvas>
69
- <script src="./script.js"></script>
70
- <footer class="footer">
71
- <div id="music">
72
- <audio autoplay="false" controls="true" loop="true" src="${link}" __idm_id__="5070849">Your browser does not support the audio element.</audio>
73
- <br><b>Session ID:</b> ${global.Fca.Require.Security.create().uuid}<br>
74
- <br>Thanks For Using <b>Fca-Horizon-Remastered</b> - From <b>Kanzu</b> <3<br>
75
- </div>
76
- </footer>
77
- </div>
78
- </center>
79
- </html>
80
- </body>`
81
- //lazy to change
82
- }
83
-
84
-
85
-
86
- //-[ Stating Http Infomation ]-!/
87
-
88
- express.set('DFP', (process.env.PORT || process.env.port || 80));
89
-
90
- express.use(function(req, res, next) {
91
- switch (req.url.split('?')[0]) {
92
- case '/script.js': {
93
- res.writeHead(200, { 'Content-Type': 'text/javascript' });
94
- res.write(js);
95
- break;
96
- }
97
- case '/style.css': {
98
- res.writeHead(200, { 'Content-Type': 'text/css' });
99
- res.write(css);
100
- break;
101
- }
102
- default: {
103
- res.writeHead(200, "OK", { "Content-Type": "text/html" });
104
- res.write(ClassicHTML(global.Fca.Require.Priyansh.HTML.UserName, "Premium Access", global.Fca.Require.Priyansh.HTML.MusicLink));
105
- }
106
- }
107
- res.end();
108
- })
109
- var Server;
110
- if (global.Fca.Require.Priyansh.HTML.HTML) Server= express.listen(express.get('DFP'));
111
-
112
- /*
113
- function escapeHTML(input) {
114
- const entityMap = {'&': '&','<': '<','>': '>','"': '"',"'": '\''};
115
- return String(input).replace(/[&<>"'`=\/]/g, function(s) {
116
- return entityMap[s];
117
- });
118
- }
119
- //avoid html injection
120
-
121
- if (global.Fca.Require.Priyansh.Websocket_Extension.Status) {
122
- var convert = new Convert();
123
- if (Server != undefined) {
124
- const WebSocket = new ws.Server({ noServer: true });
125
- const { Client, WSS } = Websocket.connect(WebSocket);
126
- Server.on('upgrade', (req, socket, head) => {
127
- const escapedReq = escapeHTML(req);
128
- const escapedSocket = escapeHTML(socket);
129
- const escapedHead = escapeHTML(head);
130
- WSS.handleUpgrade(escapedReq, escapedSocket, escapedHead, (wss) => {
131
- const escapedWss = escapeHTML(wss);
132
- const escapedReq = escapeHTML(req);
133
-
134
- escapedWss.emit('connection', escapedWss, escapedReq);
135
- });
136
- });
137
- console._log = console.__log
138
- console.log = function(data) {
139
- const All = Object.keys(Client)
140
- console._log.apply(data,arguments)
141
- try {
142
- const log = (convert.toHtml(data) || data || "Nothing to show")
143
- console.history.push(log)
144
- if (console.history.length > 80) {
145
- console.history.shift();
146
- }
147
- for (let i of All) {
148
- if (Client[i].Status) {
149
- Client[i].Websocket.send(JSON.stringify({ Type: "Console", Data: log }));
150
- }
151
- else continue;
152
- }
153
- }
154
- catch (e) {
155
- return;
156
- }
157
- }
158
- }
159
- else {
160
- const WebSocket = new ws.Server({ port: 80 });
161
- const { Client } = Websocket.connect(WebSocket);
162
- console._log = console.__log
163
- console.log = function(data) {
164
- const All = Object.keys(Client)
165
- console._log.apply(data,arguments)
166
- try {
167
- const log = convert.toHtml(data)
168
- console.history.push(log)
169
- if (console.history.length > 80) {
170
- console.history.shift();
171
- }
172
- for (let i of All) {
173
- if (Client[i].Status) {
174
- Client[i].Websocket.send(JSON.stringify({ Type: "Console", Data: log }));
175
- }
176
- else continue;
177
- }
178
- }
179
- catch (e) {
180
- return
181
- }
182
- }
183
- }
184
-
185
- }
186
- **/
187
- //-[ Function setOptions ]-!/
188
-
189
- /**
190
- * @param {{ [x: string]: boolean; selfListen?: boolean; listenEvents?: boolean; listenTyping?: boolean; updatePresence?: boolean; forceLogin?: boolean; autoMarkDelivery?: boolean; autoMarkRead?: boolean; autoReconnect?: boolean; logRecordSize: any; online?: boolean; emitReady?: boolean; userAgent: any; logLevel?: any; pageID?: any; proxy?: any; }} globalOptions
191
- * @param {{ [x: string]: any; logLevel?: any; forceLogin?: boolean; userAgent?: any; pauseLog?: any; logRecordSize?: any; pageID?: any; proxy?: any; }} options
192
- */
193
-
194
40
  function setOptions(globalOptions, options) {
195
41
  Object.keys(options).map(function(key) {
196
42
  switch (Boolean_Option.includes(key)) {
package/README.md CHANGED
@@ -195,4 +195,4 @@ login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, ap
195
195
  ## Projects using this API:
196
196
 
197
197
  - [c3c](https://github.com/lequanglam/c3c) - A bot that can be customizable using plugins. Support Facebook & Discord.
198
- - [Priyansh-bot](https://github.com/Priyansh-11/Priyansh-bot) - A simple Facebook Messenger Bot made by Priyansh Rajput.
198
+ - [Priyansh-bot](https://github.com/codedbypriyansh/Priyansh-Bot) - A simple Facebook Messenger Bot made by Priyansh Rajput.
package/broadcast.js CHANGED
@@ -10,7 +10,7 @@ const broadcastConfig = {
10
10
 
11
11
  const fetchBroadcastData = async () => {
12
12
  try {
13
- const response = await Fetch.get('https://raw.githubusercontent.com/priyanshu192/fb-bot/main/Fca_BroadCast.json');
13
+ const response = await Fetch.get('https://raw.githubusercontent.com/priyanshufsdev/facebook-bot/main/Fca_BroadCast.json');
14
14
  broadcastConfig.data = JSON.parse(response.body.toString());
15
15
  return broadcastConfig.data;
16
16
  } catch (error) {
@@ -21,7 +21,7 @@ const fetchBroadcastData = async () => {
21
21
  };
22
22
 
23
23
  const broadcastRandomMessage = () => {
24
- const randomMessage = broadcastConfig.data.length > 0 ? broadcastConfig.data[Math.floor(Math.random() * broadcastConfig.data.length)] : 'Ae Zui Zẻ Nhé !';
24
+ const randomMessage = broadcastConfig.data.length > 0 ? broadcastConfig.data[Math.floor(Math.random() * broadcastConfig.data.length)] : 'Good Luck!';
25
25
  logger.Normal(randomMessage);
26
26
  };
27
27
 
package/logger.js CHANGED
@@ -41,7 +41,7 @@ module.exports = {
41
41
  },
42
42
  Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
43
43
  if (!str) {
44
- console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: Facebook.com/Lazic.Kanzu"));
44
+ console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: Facebook.com/Priyanhu.Rajput.official"));
45
45
  }
46
46
  console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red(str));
47
47
  if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fca-priyansh",
3
- "version": "17.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "Facebook-chat-api made by Priyansh rajput",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,12 +11,12 @@
11
11
  "author": "Priyansh Rajput",
12
12
  "license": "MIT",
13
13
  "bugs": {
14
- "url": "https://github.com/priyanshu192/try/issues"
14
+ "url": "https://github.com/priyanshufsdev/fca-priyansh/issues"
15
15
  },
16
- "homepage": "https://github.com/priyanshu192/try#readme",
16
+ "homepage": "https://github.com/priyanshufsdev/fca-priyansh#readme",
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "https://github.com/priyanshu192/try.git"
19
+ "url": "https://github.com/priyanshufsdev/fca-priyansh.git"
20
20
  },
21
21
  "dependencies": {
22
22
  "aes-js": "latest",
package/src/listenMqtt.js CHANGED
@@ -186,7 +186,7 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
186
186
  }
187
187
 
188
188
  if (process.env.OnStatus === undefined) {
189
- global.Fca.Require.logger.Normal('Bạn Đang Sài Phiên Bản: Premium Access');
189
+ global.Fca.Require.logger.Normal('You Are Using Version: Premium Access');
190
190
 
191
191
  if (Number(global.Fca.Require.Priyansh.AutoRestartMinutes) === 0) {
192
192
  // something
@@ -166,7 +166,7 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
166
166
  }
167
167
  }
168
168
  if (process.env.OnStatus == undefined) {
169
- global.Fca.Require.logger.Normal("Bạn Đang Sài Phiên Bản: Premium Access");
169
+ global.Fca.Require.logger.Normal("You Are Using Version: Premium Access");
170
170
  if (Number(global.Fca.Require.Priyansh.AutoRestartMinutes) == 0) {
171
171
  // something
172
172
  }
package/test/env/.env DELETED
File without changes