Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active May 20, 2024 07:09
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.

@Abd1lle
Copy link

Abd1lle commented May 18, 2024

Honkai: RAKATFNF3ZHX

@sealldeveloper
Copy link

Working great, thank you!

@misike12
Copy link

Honkai: YBKSSAJ38TEK

@sealldeveloper
Copy link

Honkai Star Rail: 5SKBBB32DJMK
PUBG: U01743-BPMD-AA8M-VJ51M

@searinminecraft
Copy link

searinminecraft commented May 18, 2024

I don't have any friends that play PUBG so here: U01743-BPD2-WX42-711VR

- Ryo again :3

@BernhardSigl
Copy link

honkai:
NA2BAT2298D7

@SpaceCat1748
Copy link

SpaceCat1748 commented May 18, 2024

Снимок экрана 2024-05-18 160456
Maybe someone can tell me how to complete this task? (I don’t have pubg)

@czQery
Copy link

czQery commented May 18, 2024

idk, for previous 2 quests it worked for me but not for pubg

@sealldeveloper
Copy link

Снимок экрана 2024-05-18 160456 Maybe someone can tell me how to complete this task? (I don’t have pubg)

Do the instructions it says and you will be able to get the reward, you don't have to own the game.

@sealldeveloper
Copy link

idk, for previous 2 quests it worked for me but not for pubg

Worked fine for me, did it on a Mac M1 btw

@cxb190007
Copy link

cxb190007 commented May 18, 2024

honkai: CB2SAAYEK293
GS2ABGXVWCQB

@6fq
Copy link

6fq commented May 18, 2024

PUBG : U01743-CIZA-QTT9-EX1X2
Genshin : LAKBTD3S8CJP

@strangerlel
Copy link

got this error how can i fix it?: VM186:2 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at :2:32

@Meredith666
Copy link

after I close discord the code will dissapear?

@strangerlel
Copy link

nevermind i got it to work heres the code for
honkai: MT2TSZWU47ZK

@courfazor
Copy link

courfazor commented May 19, 2024

Hi. I can confirm it does not work for PUBG, but it works for Genshin Impact.
I followed the instructions for both quests, and I tried it for PUBG multiple times. After getting the message that I need more people in vc there is two people, but nothing more happens. Using Macbook ARM if that makes any difference.
Screenshot 2024-05-19 at 02 33 50

@searinminecraft
Copy link

seems that it does not work for some reason but it worked for my other account (havent tested my 1 other account)

@cizg
Copy link

cizg commented May 19, 2024

honkai: ZBJABGF8HYUF

@cizg
Copy link

cizg commented May 19, 2024

pubg: U01743-DBKE-5M71-69V6J

@Lampe2020
Copy link

I don't play Honkai (I already slid into Genshin through the Discord Quests XD), so here's the Honkai code I got: 4BKABZFJFKUB
And because I have declared all violence-centric games off-limits for me I don't play PUBG either, so here's my PUBG code: U01743-DIF9-GZIG-VQ52H

@vperpl
Copy link

vperpl commented May 19, 2024

worked for genshit, not working for pubg having same shit as picture above by @courfazor

@H644b
Copy link

H644b commented May 19, 2024

@courfazor I noticed that it doesn't work on mac try using it on linux or pc. It didn't work for me while on mac either. Also @vperpl Are you using a mac too?

@czQery
Copy link

czQery commented May 19, 2024

I am on win11 so i don't think its os related, also tried with and without vencord, and with different alt connected from different ip in the vc, but no luck.

@SuchBlue
Copy link

SuchBlue commented May 19, 2024

Honkai: 7T2BSYCYT5N3
PUBG: U01743-EA95-52PJ-W29C8

@courfazor
Copy link

courfazor commented May 19, 2024

I have no idea why others have no problems with PUBG quest as they are posting codes, but I cannot get it to work when it worked for the two other quests. I tried it with Windows 10 today too and no luck with that either. I am using vanilla Discord with no mods just to be safe.
@H644b @czQery
Edit: They might be checking the graphics card I use too? I am grasping at straws here.

@aamiaa
Copy link
Author

aamiaa commented May 19, 2024

They aren't checking anything. Rerunning the script after completing other quests should be enough to complete PUBG.
I've also tried an hour ago on an alt and it worked fine.

@Aarondoran
Copy link

How do i disable this from my console its making my discord slow dm me on discord B3bblz @aamiaa

its called a low-end pc

@Ixnayed
Copy link

Ixnayed commented May 19, 2024

Can somebody give me a pugb code, im desperate. my ds is: Azarenkaa

@xaetacore
Copy link

Honkai: LAJABGDABMP7

@bigbearsl
Copy link

bigbearsl commented May 20, 2024

Honkai: QS3STHVDRL73
PUBG: U01743-ENRD-2FY3-01PHY

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