-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 4.12 KB
/
index.js
1
const _0x1234=require('axios'),_0x5678=require('ws'),_0x9abc=require('fs');let _0xdef0=JSON.parse(_0x9abc.readFileSync('config.json','utf8'));const _0x12345=async()=>{const _0x67890={method:'get',url:`https://discord.com/api/v9/channels/${_0xdef0.channel_id}`,headers:{'Authorization':`${_0xdef0.token}`,'Accept':'application/json'}};try{const _0xabcde=await _0x1234(_0x67890);return _0xabcde.data.guild_id}catch(_0xfedcb){console.log(('ERROR','31'),_0xfedcb);throw _0xfedcb}};const _0x56789=async(_0xabcdef)=>{const _0x6789a={method:'get',url:`https://discord.com/api/v9/channels/${_0xdef0.channel_id}/messages/${_0xabcdef}/interaction-data`,headers:{'Authorization':`${_0xdef0.token}`,'Accept':'application/json'}};try{const _0xabcde=await _0x1234(_0x6789a);return _0xabcde.data}catch(_0xfedcb){console.log(('ERROR','31'),_0xfedcb);throw _0xfedcb}};async function _0x98765(_0x123456,_0x789abc,_0xdef012){const _0x345678=_0xdef012.device_spoof==='pc'?'linux':'Discord Android';_0x123456.send(JSON.stringify({op:2,d:{token:_0x789abc,properties:{$os:_0x345678,$browser:_0x345678,$device:_0x345678},presence:{status:_0xdef012.status||'online',since:0,activities:[],afk:false}}}))}const _0x54321=(_0xabcdef)=>{const{name,options}=_0xabcdef;if(!options||options.length===0)return`/${name}`;const _0x12345=options.filter(_0xabcdef=>_0xabcdef.value!==undefined).map(_0xabcdef=>`${_0xabcdef.name}: ${_0xabcdef.value}`).join(' ');return`/${name} ${_0x12345}`};const _0x567890=async(_0xabcde,_0x123456,_0xfedcba)=>{const _0x67890={embeds:[{title:" ",color:_0xdef0.embed_color,fields:[{name:"Bot",value:`${_0xabcde.author.username} (${_0xabcde.author.id})`,inline:true},{name:"User",value:`${_0xabcde.interaction_metadata.user.username} (${_0xabcde.interaction_metadata.user.id})`,inline:true},{name:"Command",value:`${_0x123456}`,inline:false},{name:"Timestamp",value:`${new Date(_0xfedcba).toLocaleString()}`,inline:false}]}]};try{await _0x1234.post(_0xdef0.webhook_url,_0x67890,{headers:{'Content-Type':'application/json'}})}catch(_0xabcdef){console.log(_0x2345('ERROR','31'),_0xabcdef)}};function _0x2345(_0xabcdef,_0x12345){return`\x1b[37m[\x1b[0m\x1b[${_0x12345}m${_0xabcdef}\x1b[0m\x1b[37m]\x1b[0m`}function _0x6789a(_0xabcdef,_0x12345){return`\x1b[37m\x1b[0m\x1b[${_0x12345}m${_0xabcdef}\x1b[0m\x1b[37m\x1b[0m`}const _0x987654=async(_0xabcdef,_0x12345)=>{const _0x67890={method:'get',url:`https://discord.com/api/v9/guilds/${_0xabcdef}/messages/search?channel_id=${_0xdef0.channel_id}`,headers:{'Authorization':`${_0xdef0.token}`,'Accept':'*/*','Referer':`https://discord.com/channels/${_0xabcdef}/${_0xdef0.channel_id}`,'Accept-Encoding':'gzip, deflate, br, zstd','Accept-Language':'en-US,en;q=0.9'}};try{const _0xabcde=await _0x1234(_0x67890);const _0x123456=_0xabcde.data.messages.flat().filter(_0xabcdef=>_0xabcdef.author.bot);if(_0x123456.length>0){const _0xabcdef=_0x123456[0];const _0x789abc=new Date(_0xabcdef.timestamp).getTime();if(_0x789abc>_0x12345){const _0xdef012=await _0x56789(_0xabcdef.id);const _0x345678=_0x54321(_0xdef012);await _0x567890(_0xabcdef,_0x345678,_0x789abc);_0x12345=_0x789abc;_0xdef0.time=_0x789abc;_0x9abc.writeFileSync('config.json',JSON.stringify(_0xdef0,null,2),'utf8');_0xdef0=_0xdef0}}}catch(_0xfedcb){console.log(('ERROR','31'),_0xfedcb)}return _0x12345};const _0xmain=async()=>{try{const _0xtoken=_0xdef0.token;const _0xws=new _0x5678('wss://gateway.discord.gg/?v=9&encoding=json');_0xws.on('open',()=>_0x98765(_0xws,_0xtoken,_0xdef0));_0xws.on('message',async(_0xdata)=>{const _0xv=JSON.parse(_0xdata);const{op,d}= _0xv;if(op===10){const{heartbeat_interval}=d;setInterval(()=>{_0xws.send(JSON.stringify({op:1,d:null}))},heartbeat_interval)}});const _0xuser_info=await _0x1234.get('https://discord.com/api/v9/users/@me',{headers:{'Authorization':_0xtoken}});console.log(_0x6789a(`Made by shwp`,'35'));console.log(_0x6789a(`You have been logged in as ${_0xuser_info.data.username} (${_0xuser_info.data.id})`,'37'));const _0xid=await _0x12345();let _0xg=_0xdef0.time||0;while(true){_0xg=await _0x987654(_0xid,_0xg);await new Promise(_0xresolve=>setTimeout(_0xresolve,_0xdef0.check_last_used_command))}}catch(_0xfedcb){console.log(('ERROR','31'),_0xfedcb);process.exit(1)}};_0xmain();