Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active July 16, 2024 00:24
Show Gist options
  • Save aamiaa/204cd9d42013ded9faf646fae7f89fbb to your computer and use it in GitHub Desktop.
Save aamiaa/204cd9d42013ded9faf646fae7f89fbb to your computer and use it in GitHub Desktop.
Complete Recent Discord Quest

Complete Recent Discord Quest

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:

  1. Accept a quest under User Settings -> Gift Inventory
  2. Press Ctrl+Shift+I to open DevTools
  3. Go to the Console tab
  4. 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!")
	}
}
  1. 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
  2. Wait for 15 minutes
  3. 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.

Completing The Console Quest

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:

  1. Connect your Xbox (aka Microsoft) account to Discord (Settings -> Connections)
  2. Go to https://xbox.com/play and login via the same Xbox account
  3. Launch a free game (such as Fortnite)
  4. Leave it running for 10 minutes

FAQ

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.

@i-likegithub
Copy link

i was just wondering if the console playing discord thingy works on linux, i know most people use windows but i use linux and idk if i have a spare windows computer

It should, if you try it, let me know!

idk if u noticed but xbox is not supported on linux

True. But for those who use Linux with the Play console for 10 minutes Quest, RISHAB-CREATOR's instructions do still work regardless if you use Linux. As long as you have an Xbox account connected to your discord it should be good to go—I used my phone instead since I don't like using a VPN on my computer:

its ez asf dude, create a microsoft account
link it with xbox , then link it with discord too
after this if not in unitedstates, then use a vpn for it
then just play this : https://www.xbox.com/en-us/play/games/bt5p2x999vh2
its free game,btw login here with the same account
wait for 10mins
NOTE : IF YOU ARE ON PC, ALL STEPS WOULD WORK, BUT IF U ON MOBILE JUST CHANGE THE VIEW TO DESKTOP WHILE VISITING THE XBOX PLAY LINK

I use Arch btw.

@IshtiakHossain
Copy link

IshtiakHossain commented Jul 8, 2024

The script worked and the console quest also worked with the xbox cloud gaming beta method. the console quest wasn't detecting games because my xbox account was in offline mode so when I got online discord started recognizing games and started counting.

@cxb190007
Copy link

cxb190007 commented Jul 8, 2024

ZENLESS ZONE ZERO - great game btw ;)
XBNUVB2PSJ39

@amryk2012
Copy link

ZENLESS ZONE ZERO
8T7UUAU86639

@amindhaw
Copy link

amindhaw commented Jul 9, 2024

ZENLESS ZONE ZERO
DBPDUUNQF3J5

@Pearl8520
Copy link

DBPDUUNQF3J5

tyty

@TomerGamerTV
Copy link

Im trying the script with the zzz quest but it doesn't seem to work..... tried relaunching the stream multiple times and rejoining

@Trojan-V
Copy link

Trojan-V commented Jul 9, 2024

ZENLESS ZONE ZERO
8SNUDCG2F2U5

@louiszn
Copy link

louiszn commented Jul 9, 2024

will it work when i play minecraft java edition? I'm currently on Linux rn

@sametaor
Copy link

will it work when i play minecraft java edition? I'm currently on Linux rn

Yes, Minecraft Java works, I myself completed it by streaming Minecraft 1.12.2

@Jojo24908
Copy link

ZZZ code: KBPVCFNLVXT9

@ilia-21
Copy link

ilia-21 commented Jul 10, 2024

More ZZZ Codes:
KANURBT5MQ8D
USNC9SB4499R
4BPDRBT459RH
NS6U9TTLM6AV
XTNDQAS44985
CATCHABOO

All working as of 2024/07/10 6PM UTC+3 on Europe Region

@VihaanVPGaming
Copy link

ZZZ Code: ZAPVDE5QGH9R
(Pls feel free to claim, I ain't gonna use it)

@User-Loading
Copy link

ZZZ Code :
HBNCUFM9NU7M

@TechySkills
Copy link

ZZZ Code (which i will never use cuz i dont play)
6ANVDEMKSABR

@EvySesta
Copy link

ZZZ CODE ( I don't play that game )

WT7VUSLAKZ4Z

@BarievArtem
Copy link

Zenless Zone Zero : 8BNDS7NVG84D

@SkyGodCheesey
Copy link

ZZZ Code: SANDB6PQZCTR

@Cleboost
Copy link

ZZZ code : TA6CS6PR5HB9

@MahmoudAli96505
Copy link

2 ZZZ Codes:

SB7VT75NBP7H

4B6CA74NA6H9

@ioniaer
Copy link

ioniaer commented Jul 11, 2024

free zzz code VS6US746MAG9

@playgamesgo
Copy link

ZENLESS ZONE ZERO
PA6VTKQ8STJV

@Perationale
Copy link

ZENLESS ZONE ZERO: XSNCVUAG9A89

@wissxi
Copy link

wissxi commented Jul 13, 2024

ZENLESS ZONE ZERO: EBNCSDBQVCEH

@Tr0llie
Copy link

Tr0llie commented Jul 14, 2024

zzz = ZA6CT7CZJK3R

@ColynOrg
Copy link

5APVB3PK3ZJR

@Kanoes2007
Copy link

GS6CTPV277V9
zonelesszero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment