Last active
September 12, 2024 12:55
-
-
Save syncordyt/6f405122d7948296a492a78e9e8e6d76 to your computer and use it in GitHub Desktop.
Discord Quest Completion Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let wpRequire; | |
| window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]); | |
| let ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getStreamerActiveStreamMetadata).exports.Z; | |
| let RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.ZP?.getRunningGames).exports.ZP; | |
| let QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getQuest).exports.Z; | |
| let ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getGuildExperiments).exports.Z; | |
| let FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.Z?.flushWaitQueue).exports.Z; | |
| let api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn; | |
| let quest = [...QuestsStore.quests.values()].find(x => x.id !== "1248385850622869556" && x.userStatus?.enrolledAt && !x.userStatus?.completedAt && new Date(x.config.expiresAt).getTime() > Date.now()) | |
| let isApp = navigator.userAgent.includes("Electron/") | |
| if(!isApp) { | |
| console.log("👉 Use Discord app to complete quests but if you REALLY want to do this on browser, watch this video - https://youtu.be/XGGh6_CxArg") | |
| } else if(!quest) { | |
| console.log("You don't have any uncompleted quests! Accept the quest that you want to complete and then run this.") | |
| } else { | |
| const pid = Math.floor(Math.random() * 30000) + 1000 | |
| let applicationId, applicationName, secondsNeeded, secondsDone, canPlay | |
| if(quest.config.configVersion === 1) { | |
| applicationId = quest.config.applicationId | |
| applicationName = quest.config.applicationName | |
| secondsNeeded = quest.config.streamDurationRequirementMinutes * 60 | |
| secondsDone = quest.userStatus?.streamProgressSeconds ?? 0 | |
| canPlay = quest.config.variants.includes(2) | |
| } else if(quest.config.configVersion === 2) { | |
| applicationId = quest.config.application.id | |
| applicationName = quest.config.application.name | |
| canPlay = ExperimentStore.getUserExperimentBucket("2024-04_quest_playtime_task") > 0 && quest.config.taskConfig.tasks["PLAY_ON_DESKTOP"] | |
| const taskName = canPlay ? "PLAY_ON_DESKTOP" : "STREAM_ON_DESKTOP" | |
| secondsNeeded = quest.config.taskConfig.tasks[taskName].target | |
| secondsDone = quest.userStatus?.progress?.[taskName]?.value ?? 0 | |
| } | |
| if(canPlay) { | |
| api.get({url: `/applications/public?application_ids=${applicationId}`}).then(res => { | |
| const appData = res.body[0] | |
| const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","") | |
| const games = RunningGameStore.getRunningGames() | |
| const fakeGame = { | |
| cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`, | |
| exeName, | |
| exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`, | |
| hidden: false, | |
| isLauncher: false, | |
| id: applicationId, | |
| name: appData.name, | |
| pid: pid, | |
| pidPath: [pid], | |
| processName: appData.name, | |
| start: Date.now(), | |
| } | |
| games.push(fakeGame) | |
| FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games}) | |
| let fn = data => { | |
| let progress = quest.config.configVersion === 1 ? data.userStatus.streamProgressSeconds : Math.floor(data.userStatus.progress.PLAY_ON_DESKTOP.value) | |
| console.log(`Quest progress: ${progress}/${secondsNeeded}`) | |
| if(progress >= secondsNeeded) { | |
| console.log("Quest completed!") | |
| const idx = games.indexOf(fakeGame) | |
| if(idx > -1) { | |
| games.splice(idx, 1) | |
| FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []}) | |
| } | |
| FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn) | |
| } | |
| } | |
| FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn) | |
| console.log(`Spoofed your game to ${applicationName}. Wait for ${Math.ceil((secondsNeeded - secondsDone) / 60)} more minutes.`) | |
| }) | |
| } else { | |
| let realFunc = ApplicationStreamingStore.getStreamerActiveStreamMetadata | |
| ApplicationStreamingStore.getStreamerActiveStreamMetadata = () => ({ | |
| id: applicationId, | |
| pid, | |
| sourceName: null | |
| }) | |
| let fn = data => { | |
| let progress = quest.config.configVersion === 1 ? data.userStatus.streamProgressSeconds : Math.floor(data.userStatus.progress.STREAM_ON_DESKTOP.value) | |
| console.log(`Quest progress: ${progress}/${secondsNeeded}`) | |
| if(progress >= secondsNeeded) { | |
| console.log("Quest completed!") | |
| ApplicationStreamingStore.getStreamerActiveStreamMetadata = realFunc | |
| FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn) | |
| } | |
| } | |
| FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn) | |
| console.log(`Spoofed your stream to ${applicationName}. Stream any window in vc for ${Math.ceil((secondsNeeded - secondsDone) / 60)} more minutes.`) | |
| console.log("You need 1 friend or an alt account in the same voice channel too.") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment