fca-priyansh 17.0.0 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/Main.js +0 -154
  2. package/package.json +1 -1
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fca-priyansh",
3
- "version": "17.0.0",
3
+ "version": "18.0.0",
4
4
  "description": "Facebook-chat-api made by Priyansh rajput",
5
5
  "main": "index.js",
6
6
  "scripts": {