constcache={};if(typeofDiscordNative==='undefined')console.log('Browser is not supported. Please use Discord client :wilted_rose:.',);else{constreq=webpackChunkdiscord_app.push([[Symbol()],{},(r)=>r]);webpackChunkdiscord_app.pop();constmods=Object.values(req.c),api=mods.find((x)=>x?.exports?.Bo?.get).exports.Bo;api.get('https://discord.com/api/v10/applications/detectable').then(async({body:apps})=>{while(Object.keys(cache).length<Math.min(100,apps.length)){consta=apps[(Math.random()*apps.length)|0];if(a?.id)cache[a.id]=a;}constids=Object.keys(cache);leti=0,t;asyncfunctionspoof(){consts=window.__rpcSpooferState;if(s){s.store.getRunningGames=s.getGames;s.store.getGameForPID=s.getPID;s.dispatcher.dispatch({type:'RUNNING_GAMES_CHANGE',removed:[s.game],added:[],games:[],});deletewindow.__rpcSpooferState;}if(i>=ids.length)return(clearInterval(t),console.log('All cached applications have been spoofed.',));try{constid=ids[i],{body}=awaitapi.get({url:`/applications/public?application_ids=${id}`,}),a=body[0];if(!a)return(i++,console.error(`Cannot fetch application ${id}`));conststore=mods.find((x)=>x?.exports?.Ay?.getRunningGames,).exports.Ay,dispatcher=mods.find((x)=>x?.exports?.h?.__proto__?.flushWaitQueue,).exports.h,pid=(Math.random()*3e4+1e3)|0;constexe=a.executables?.find((x)=>x.os==='win32')?.name?.replace('>','')||a.name.replace(/[\/\\:*?"<>|]/g,'');constgame={cmdLine:`C:\\Program Files\\${a.name}\\${exe}`,exeName:exe,exePath:`c:/program files/${a.name.toLowerCase()}/${exe}`,hidden:false,isLauncher:false,id,name:a.name,pid,pidPath:[pid],processName:a.name,start:Date.now(),},real=store.getRunningGames();window.__rpcSpooferState={store,dispatcher,game,getGames:store.getRunningGames,getPID:store.getGameForPID,};store.getRunningGames=()=>[game];store.getGameForPID=(p)=>(p===pid?game:void0);dispatcher.dispatch({type:'RUNNING_GAMES_CHANGE',removed:real,added:[game],games:[game],});console.log(`(${++i}) Playing: ${a.name} (${id})`);}catch(e){console.error('Spoof error:',e);i++;}}spoof();t=setInterval(spoof,((Math.random()*2)|0)+1*61000);}).catch(console.error);}