Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active June 26, 2024 19:07
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.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.

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.

@terrariapro147
Copy link

FW5Z-QZ25L-18CG, cod code

@TomerGamerTV
Copy link

TomerGamerTV commented Jun 18, 2024

Right i missed a spot This one should work now:

[removed to avoid confusing people]

Got this error
image

@aamiaa
Copy link
Author

aamiaa commented Jun 18, 2024

Run the script in the main gist, not random edits I post for specific people...

@aamiaa
Copy link
Author

aamiaa commented Jun 18, 2024

Your code works now but the logs are broken, it just returns an undefined error instead of logging the time. Still thx for the update :)

Should be fixed now

@Phantom-Noir
Copy link

Screenshot 2024-06-17 202550
Still receiving Type error

@GoopGhostt
Copy link

Screenshot 2024-06-17 202550 Still receiving Type error

I'm getting this as well

@ayaojee
Copy link

ayaojee commented Jun 18, 2024

Screenshot 2024-06-18 084639
how can i fix this please

@sirius-sama
Copy link

Thanks, it worked. Guys follow the instructions properly and it'll work fs.
image

@ayaojee
Copy link

ayaojee commented Jun 18, 2024

@sirius-sama
pls dm me in discord and tell me what i do
my name is : ayaojee

@sirius-sama
Copy link

@sirius-sama pls dm me in discord and tell me what i do my name is : ayaojee

check

@txmu1
Copy link

txmu1 commented Jun 18, 2024

Your code works now but the logs are broken, it just returns an undefined error instead of logging the time. Still thx for the update :)

Should be fixed now

image how can i fix this ?

discord ptb

@Jxnasus
Copy link

Jxnasus commented Jun 18, 2024

Another CoD Code: G1S8-J9633-BPBC
for someone to use, I am not playing that game

@MisterGambler
Copy link

Guys it doesnt work can someone send me the full code maybe i copied it wrong

@Trolleye-ux
Copy link

Guys,i didnt wanted to lie,but none of the codes work....But i think its not suprising after all wtf

@devii123i
Copy link

Im putting the script in and it is doing nothing?? someone help please
image

@devii123i
Copy link

nevermind it is working

@Trolleye-ux
Copy link

where did the script go?

@d3v7
Copy link

d3v7 commented Jun 18, 2024

where did the script go?
Click to expand
IMG_2034

@Suspectxyzz
Copy link

G5E1-N2N40-ZVQD

@epiwww
Copy link

epiwww commented Jun 18, 2024

hi ! dont work for me :(
image_2024-06-18_203013642

@Smilqo
Copy link

Smilqo commented Jun 20, 2024

image
how to fix

@aamiaa
Copy link
Author

aamiaa commented Jun 20, 2024

image
how to fix

Use the desktop app

@quincynyan
Copy link

image

@AnonymousUserInthisGithub

call of duty: 10B9-QZ5BG-1XJK

@Radiant-F
Copy link

can you guys shut the fuck up

@GuidingLight20
Copy link

the new code doesnt work :(

@sambecause
Copy link

I've updated the main gist with a workaround that handles both stable and canary/ptb, so it should be fine to use that one for now (more clutter in the code yay!)

I don't see ny quest in my gift inventory

@mi0lt
Copy link

mi0lt commented Jun 21, 2024

can someone send me a code i try this for like 13 times and it didn't work for me 🥲 if anyone have a code can you please give it to me my discord is xi0lt

@Sub-Archeo
Copy link

how about for minecraft?

@Xoncia
Copy link

Xoncia commented Jun 21, 2024

The script works perfectly fine, I'm not sure what everyone here is complaining about.
PS; on a side note @aamiaa (your bio is 120% relatable)

@Trolleye-ux
Copy link

Trolleye-ux commented Jun 21, 2024

or can someone send me a code?

name : wareye_yt

@rorixpatrick
Copy link

Minecraft Trial Mask : 2MY3J-3XHG7-YK4X9-2MKDM-3V3JZ

@Trolleye-ux
Copy link

not vaild xddddddd

@Trolleye-ux
Copy link

Trolleye-ux commented Jun 21, 2024

if anyone has a vaild code,text me on dc

@Konaimav2
Copy link

LETSGOOO MINECRAFT TIME

@truelockmc
Copy link

Screenshot 2024-06-18 084639 how can i fix this please

Use the desktop app, or just watch this tutorial by ntts https://www.youtube.com/watch?v=MV33-XB0gss

@clearnet
Copy link

MINECRAFT CODE: 23Y96-FVFPP-WY76V-PW62R-X7DPZ

@truelockmc
Copy link

Call of Duty Blueprint Code:
ER9R-DSLGC-JREC
I dont play it so you can have it :)

@NakkOfLegend
Copy link

MC:
2YPG6-MQCYQ-39D43-3MM3P-FX7DZ

@NakkOfLegend
Copy link

CALL OF DUTY
FWWV-8M7QN-481E

@bigmac2010
Copy link

bigmac2010 commented Jun 21, 2024

ngl this actually works ! maybe some can't figure it out so i'm here to help u , so the 1st thing is this doesnt work on browser so go through the discord desktop application and install the ptb client version to use the console tab using ctrl+shift+i and make sure someone is with u in vc there is no special thing u need a friend it could be a bot also like i did with lofi-radio and if u cant paste the command by aamia then type allow pasting to enter the command and wait for atleast 15 - 20 mins and u r done. And lastly don't be a badge goblin just to show off ur badges to ur friends cuz u r risking ur whole computer just for a simple reward and a fricking badge.

@InfoBlock
Copy link

if anyone has a vaild code,text me on dc

Bro... just do this trick yourself and you get a code!

@cxb190007
Copy link

cxb190007 commented Jun 22, 2024

Minecraft Bedrock Trial Mask
3FMW7-KDCCT-3C79M-HCVW9-M2DCZ
3FW9K-6DF2Q-3C664-WFKC3-TDT4Z

@bakaxiaofang
Copy link

Minecraft Trial Mask:3MFYF-YCP46-YWCJ4-F3363-6VD4Z

@NIKITA12340-sudo
Copy link

Minecraft Trial Mask:3Q4D6-TQTRX-39H4Y-GWVMC-P9XCZ

@felixcplus
Copy link

If anyone needs it:
Minecraft Trial Mask: 3QXFV-JWRC4-7VDGP-QGRYG-KYMMZ

@MatuTheDragonCat
Copy link

HOW DO I DO THIS ON THE DESKTOP APP

@LuizWT
Copy link

LuizWT commented Jun 23, 2024

HOW DO I DO THIS ON THE DESKTOP APP

U need to Ctrl + Shift + I

@asyncedd
Copy link

im on vesktop. how do i do this?

@mahin12-ngl
Copy link

image
How do i fix this up??

@mahin12-ngl
Copy link

mahin12-ngl commented Jun 23, 2024

ngl this actually works ! maybe some can't figure it out so i'm here to help u , so the 1st thing is this doesnt work on browser so go through the discord desktop application and install the ptb client version to use the console tab using ctrl+shift+i and make sure someone is with u in vc there is no special thing u need a friend it could be a bot also like i did with lofi-radio and if u cant paste the command by aamia then type allow pasting to enter the command and wait for atleast 15 - 20 mins and u r done. And lastly don't be a badge goblin just to show off ur badges to ur friends cuz u r risking ur whole computer just for a simple reward and a fricking badge.

I have Minecraft and i'm streaming it
no risk at all!!

@Dylanvanschouwen
Copy link

Skill issue honestly. just figure it out it aint that hard.

@ZatrexReal
Copy link

ZatrexReal commented Jun 24, 2024

if you have minecraft trial mask code please dm me in discord: zatrex_123

@Trolleye-ux
Copy link

for me too please : wareye_yt

@BarievArtem
Copy link

Minecraft Trial Mask : 4Y22Q-RDYRP-XCRXV-3K76Y-QDQ7Z

@Mohammedsssshgdhfaf
Copy link

no longer works in browser??, then how im gonna do it?

@ZatrexReal
Copy link

no longer works in browser??, then how im gonna do it?

Download the app.for windows

@ZatrexReal
Copy link

Minecraft Trial Mask : 4Y22Q-RDYRP-XCRXV-3K76Y-QDQ7Z

Not working

@An0nX
Copy link

An0nX commented Jun 25, 2024

649FR-97GQG-PKDY4-F32CF-Y7KWZ

@aix05
Copy link

aix05 commented Jun 25, 2024

Minecraft Trial Mask: 67HC3-G4P92-R3MDT-RGJJQ-G9T3Z

@diziu
Copy link

diziu commented Jun 25, 2024

or can someone send me a code?

name : wareye_yt

Minecraft Trial Mask: 69KQR-6TFGG-4C962-T7TFY-KHR6Z

@Jetsooonie
Copy link

Here's a minecraft trial mask code for anyone in need! : 6MY2R-2FQYV-MP4WC-J7HT4-9JK3Z

@Trolleye-ux
Copy link

not vaild xddd

@Dyrr0th12
Copy link

Tenkiu

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