Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active May 12, 2024 17:42
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!

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("This no longer works in browser. Use the desktop app!")
} else if(!quest) {
	console.log("You don't have any uncompleted quests!")
} 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(`Quest progress: ${progress}/${secondsNeeded}`)
		
		if(progress >= secondsNeeded) {
			console.log("Quest completed!")
			FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		}
	}
	FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
	
	console.log(`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("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 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.

@TazeXL
Copy link

TazeXL commented May 11, 2024

patched?

nop still working im doing it rn

@RetroDogo
Copy link

for some reason every time i do it, it keeps saying "undefined" right after the warning text telling you to join on an alt wtfff

@8bitblock
Copy link

for some reason every time i do it, it keeps saying "undefined" right after the warning text telling you to join on an alt wtfff

its doing that because the code you input isnt defined in the code orignaly it will still work and make sure you have an alt in the call to "watch" the stream

@xPapy
Copy link

xPapy commented May 11, 2024

'' This no longer works in browser. Use the desktop app!'' how i use this code

@dreyware
Copy link

Honkai code for you: FBJTQRKSD7Y7

@8bitblock
Copy link

'' This no longer works in browser. Use the desktop app!'' how i use this code

have developer options on in discord app then hit ctrl+shift+i and do it then

@galaxyaiclub
Copy link

7B2STVC95EXX

@emrcaca
Copy link

emrcaca commented May 12, 2024

Honkai code 1: CAJBSVU8RUBF
Honkai code 2: JSJTQRHT3RQT
Honkai code 3: VA3BRQYS3DKP
Honkai code 4: TA2TSDC9LVNX
Honkai code 5: DTKSBUD3G797
Honkai code 6: VT2ABVUJC32B

@YousseffAB
Copy link

yo, also works with the new mission? for me it doesnt.

@Ma110w
Copy link

Ma110w commented May 12, 2024

yeah, i guess they patched it again, as currently even though im using the discord app, it claims im in the browser

@Ma110w
Copy link

Ma110w commented May 12, 2024

if you had my issue just swap to PTB, it seems to work flawlessly

@YousseffAB
Copy link

YousseffAB commented May 12, 2024 via email

@putmeinagrave
Copy link

Honkai: RB3BSVTZNVN3

@asxtroz
Copy link

asxtroz commented May 12, 2024

honkai: XSJBRQGCC28B

@SmartGuy09
Copy link

For Honkai
RSKA9RGD59T7

but seriously who tf play this game

@MrPiggy105
Copy link

This works (if you follow the instructions). For those badge goblins, the badge has been discontinued :(

The JavaScript works by spoofing the stream so make sure you are on the Desktop App and are streaming any window. (does not have to be named anything).

@apt9002
Copy link

apt9002 commented May 12, 2024

This works (if you follow the instructions). For those badge goblins, the badge has been discontinued :(

The JavaScript works by spoofing the stream so make sure you are on the Desktop App and are streaming any window. (does not have to be named anything).

thank you so much man, it worked!

@vmprs
Copy link

vmprs commented May 12, 2024

idk who plays this game but here
FBJA8RGQZE5P

@apt9002
Copy link

apt9002 commented May 12, 2024

Honkai code:
2B3ARRY74YW3
3SKT98G73MC7

@R-udren
Copy link

R-udren commented May 12, 2024

Honkai: QA3S8QGR5J6B

@R-udren
Copy link

R-udren commented May 12, 2024

'' This no longer works in browser. Use the desktop app!'' how i use this code

Try some discord clients such as Vencord where you can turn on developer console

@ahmedhoosam
Copy link

RBKSR9G2X9QT
LTKB9QH2W6BK

@omegion3
Copy link

Honkai: SAKB89ZJVQ3K

@Anonim-Anonim
Copy link

Now it always shows that I am streaming this game. How to remove it? Help me please.

@aamiaa
Copy link
Author

aamiaa commented May 12, 2024

Now it always shows that I am streaming this game. How to remove it? Help me please.

Restart discord

@azurexxxx
Copy link

Honkai code for u <3
3T3BBDBBJ9V7

@xm4r1us
Copy link

xm4r1us commented May 12, 2024

i pasted and didnt get any err but not responding after 15min. Im using ubuntu version of discord.

@GSaelor
Copy link

GSaelor commented May 12, 2024

You are welcome
LBJSBVSNF8NK

@MythicHH
Copy link

Honkai code: QB2TTUSQCSQF

@123SONIC321
Copy link

Honkai code: 3AJABUA2AWXB

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