Note
This no longer works in browser!
This no longer works if you're alone in vc! Somebody else has to join you!
Warning
There are now two quest types ("stream" and "play")! Pay attention to the instructions!
How to use this script:
- Accept a quest under User Settings -> Gift Inventory
- Press Ctrl+Shift+I to open DevTools
- Go to the
Console
tab - Paste the following code and hit enter:
Click to expand
let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
let ApplicationStreamingStore, RunningGameStore, QuestsStore, ExperimentStore, FluxDispatcher, api
if(window.GLOBAL_ENV.SENTRY_TAGS.buildId === "366c746173a6ca0a801e9f4a4d7b6745e6de45d4") {
ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getStreamerActiveStreamMetadata).exports.default;
RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).exports.default;
QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getQuest).exports.default;
ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getGuildExperiments).exports.default;
FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.default?.flushWaitQueue).exports.default;
api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports.HTTP;
} else {
ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getStreamerActiveStreamMetadata).exports.Z;
RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.ZP?.getRunningGames).exports.ZP;
QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getQuest).exports.Z;
ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getGuildExperiments).exports.Z;
FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.Z?.flushWaitQueue).exports.Z;
api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;
}
let quest = [...QuestsStore.quests.values()].find(x => x.id !== "1245082221874774016" && x.userStatus?.enrolledAt && !x.userStatus?.completedAt && new Date(x.config.expiresAt).getTime() > Date.now())
let isApp = navigator.userAgent.includes("Electron/")
if(!isApp) {
console.log("This no longer works in browser. Use the desktop app!")
} else if(!quest) {
console.log("You don't have any uncompleted quests!")
} 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("Remember that you need at least 1 other person to be in the vc!")
}
}
- Follow the printed instructions depending on what type of quest you have
- If your quest says to "play" the game, you can just wait and do nothing
- If your quest says to "stream" the game, join a vc with a friend or alt and stream any window
- Wait for 15 minutes
- You can now claim the reward in User Settings -> Gift Inventory!
You can track the progress by looking at the Quest progress:
prints in the Console tab, or by reopening the Gift Inventory tab in settings.
While the script doesn't work on it, it is possible to complete the "play any game on your console" quest without owning a console by using Xbox's Cloud Gaming:
- Connect your Xbox (aka Microsoft) account to Discord (Settings -> Connections)
- Go to https://xbox.com/play and login via the same Xbox account
- Launch a free game (such as Fortnite)
- Leave it running for 10 minutes
Q: Ctrl + Shift + I doesn't work
A: Either download the ptb client, or use this to enable DevTools on stable
Q: I get an error saying "Unauthorized"
A: Discord has patched the script from working in browsers. Use the desktop app, or alternatively find some extension which lets you change your User-Agent and append the string Electron/
anywhere in it.
They have also started checking how many people are in the vc, so make sure you join it on at least 1 other account.
Q: I get a different error
A: Make sure you're copy/pasting the script correctly and that you've have done all the steps.
You need to enable the Console first, for that you can Press "WIN + R" a "run" window should now open, type "%appdata%".
Now an folder should open where you can find a "discord" folder.
Inside of that you should find a "settings" file, if you have Extensions Visible it's named "settings.json", you can just open it using any Text Editor like notepad or VSCode.
add following at the end of the File:
(Don't forget the , in the line above it )
![image](https://private-user-images.githubusercontent.com/44544317/326699861-d1336310-e1c3-480d-960f-ec86001e25e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5OTA4MzYsIm5iZiI6MTcyMTk5MDUzNiwicGF0aCI6Ii80NDU0NDMxNy8zMjY2OTk4NjEtZDEzMzYzMTAtZTFjMy00ODBkLTk2MGYtZWM4NjAwMWUyNWU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDEwNDIxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmNDgyZDRlYTYxZmM3M2M2NTkzMDg4MzNjZWNlMThjMWMyMTk1NzY4ZDdjZTM3YTcyMTljY2RkMzM3MGY2ZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qwRDseF_ia8dXI2nWvnwv38cGN-BgUUlqIIR3dRt9zM)
Should look like following:
After you done it, Save the File and Close Discord Completly, when you now Start it again you should be able to use "CTRL + Shift + I" if you're on Windows.
Linux has the same Shortcut if i remember correctly.
For MacOS:
(Thanks to MilanK1 for that Info)
Alternative:
Vencord
I think they just have a Plugin or Option to Enable it, i don't remember.
Keep in mind that Technically Vencord is against Discord TOS tho.