forked from OFC-YOVANI/HADES-BOT-OMEGA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
1 lines (1 loc) · 1.49 KB
/
server.js
1
import _0x44f1cc from'express';import{createServer}from'http';import _0xc4c842 from'path';import{Socket}from'socket.io';import{toBuffer}from'qrcode';import _0x511ce1 from'node-fetch';function connect(_0x5113f9,_0x46f04c){const _0x38bb48=global['app']=_0x44f1cc();console['log'](_0x38bb48);const _0xbe7afd=global['server']=createServer(_0x38bb48);let _0x46d53a='The\x20QR\x20code\x20is\x20invalid,\x20possibly\x20the\x20QR\x20code\x20has\x20already\x20been\x20scanned.';_0x5113f9['ev']['on']('connection.update',function _0x2f0bdc({qr:_0x351fa9}){if(_0x351fa9)_0x46d53a=_0x351fa9;}),_0x38bb48['use'](async(_0x50f6a0,_0x5450c2)=>{_0x5450c2['setHeader']('content-type','image/png'),_0x5450c2['end'](await toBuffer(_0x46d53a));}),_0xbe7afd['listen'](_0x46f04c,()=>{console['log']('✔️\x20The\x20application\x20is\x20listening\x20to\x20the\x20port.',_0x46f04c,'(ignore\x20if\x20I\x20already\x20scan\x20the\x20QR\x20code)');if(opts['keepalive'])keepAlive();});}function pipeEmit(_0x1f58ed,_0xb73141,_0x2f9bca=''){const _0x4e6842=_0x1f58ed['emit'];return _0x1f58ed['emit']=function(_0x28d3b9,..._0x5392b3){_0x4e6842['emit'](_0x28d3b9,..._0x5392b3),_0xb73141['emit'](_0x2f9bca+_0x28d3b9,..._0x5392b3);},{'unpipeEmit'(){_0x1f58ed['emit']=_0x4e6842;}};}function keepAlive(){const _0x282899='https://'+process['env']['REPL_SLUG']+'.'+process['env']['REPL_OWNER']+'.repl.co';if(/(\/\/|\.)undefined\./['test'](_0x282899))return;setInterval(()=>{_0x511ce1(_0x282899)['catch'](console['error']);},0x5*0x3e8*0x3c);}export default connect;