Skip to content

Instantly share code, notes, and snippets.

@Shuruhatik
Forked from aamiaa/CompleteDiscordQuest.md
Last active February 6, 2025 22:09
Show Gist options
  • Save Shuruhatik/985f1308c1f0f3bd5935cbdf568a5104 to your computer and use it in GitHub Desktop.
Save Shuruhatik/985f1308c1f0f3bd5935cbdf568a5104 to your computer and use it in GitHub Desktop.
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Join the same vc on an alt
  4. Stream any window (can be notepad or something)
  5. Press Ctrl+Shift+I to open DevTools
  6. Go to the Console tab
  7. Paste the following code and hit enter:
let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);

let ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getStreamerActiveStreamMetadata).exports.default;
let QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getQuest).exports.default;
let FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.default?.flushWaitQueue).exports.default;

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("[\u001b[34;1mShuruhatik\u001b[0m] This no longer works in browser. \n\u001b[42;1m NEW \u001b[0m Tutorial video ↓\n\u001b[32;1mhttps://youtu.be/WIa8ZKfLJnk\u001b[0m")
} else if(!quest) {
	console.log("[\u001b[34;1mShuruhatik\u001b[0m] You don't have any uncompleted quests!\n\u001b[0mTutorial video ↓\n\u001b[32;1mhttps://youtu.be/WIa8ZKfLJnk\u001b[0m")
} else {
	let pid = Math.floor(Math.random() * 30000) + 1000
	ApplicationStreamingStore.getStreamerActiveStreamMetadata = () => ({
		id: quest.config.applicationId,
		pid,
		sourceName: null
	})
	
	let secondsNeeded = quest.config.streamDurationRequirementMinutes * 60
	let fn = data => {
		let progress = data.userStatus.streamProgressSeconds
		console.log(`[\u001b[34;1mShuruhatik\u001b[0m] Quest progress: ${progress}/${secondsNeeded}`)
		
		if(progress >= secondsNeeded) {
			console.log("[\u001b[34;1mShuruhatik\u001b[0m] \u001b[32mQuest completed 🎉!\u001b[0m")
			FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		}
	}
	FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
	
	console.log(`[\u001b[34;1mShuruhatik\u001b[0m] Spoofed your stream to ${quest.config.applicationName}. Stay in vc for ${Math.ceil(quest.config.streamDurationRequirementMinutes - (quest.userStatus?.streamProgressSeconds ?? 0) / 60)} more minutes.`)
	console.log("[\u001b[34;1mShuruhatik\u001b[0m] Remember that you need at least 1 other person to be in the vc!")
}
  1. Keep the stream running for 15 minutes
  2. 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. The progress should update every 30s.

FAQ

Q: Ctrl + Shift + I doesn't work

A: Either download the ptb client, Or you can turn it back on using by setting "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true in %appdata%/discord/settings.json to enable DevTools on stable client

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've started streaming before running the script. Also make sure you're copy/pasting it correctly.

Credits

  • The code in this gist is authored by aamiaa.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment