Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active May 16, 2024 18:45
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.

@Faris0520
Copy link

Just download Discord PTB / Beta. It will works

@se2ndDude
Copy link

PUBG: U01743-1WSD-8W0U-GLGNT

@Shroomisle
Copy link

Pubg code: U01743-1XBT-I73N-RF1WS

@MahmoudAli96505
Copy link

Pubg code: U01743-210P-4UYP-QHVNF

@asxtroz
Copy link

asxtroz commented May 15, 2024

Pubg : U01743-21IF-EYBZ-GX74P

@TracGlader
Copy link

HONKAI: STJBBXG2AE87

@aceyx3
Copy link

aceyx3 commented May 15, 2024

U01743-299L-GE4H-EOH0B - PUBG

@soldierguy
Copy link

PUBG code if anyone wants it U01743-2QO7-LSX7-3UCJE

@dx9scope
Copy link

pubg U01743-3538-QQPU-EH8KV

@Conkley
Copy link

Conkley commented May 15, 2024

PUBG U01743-3918-JBF7-T4S0H

@pofaknamak
Copy link

PUBG : U01743-4494-U7FC-OQLD4

@Abelkrijgtalles
Copy link

PUBG: U01743-4GO6-YVB7-WMJZV

@pleasegiverocket
Copy link

PUBG: U01743-5191-8VWW-STXK6

@valentineu0
Copy link

It's really great that this code works in all quests.

@atouu
Copy link

atouu commented May 15, 2024

PUBG: U01743-5AX4-PQ0V-WCMPP

@Glan51
Copy link

Glan51 commented May 15, 2024

PUBG: U01743-5N4Y-2XM6-U0SG7

@vmprs
Copy link

vmprs commented May 15, 2024

U01743-5NAZ-CZV9-JJCHD - PUBG

@Speedyu
Copy link

Speedyu commented May 15, 2024

I have tried every discord client, and betterdiscord, vencord and cant get the dev console/element inspect opened (Ctrl + Shift + I)

If you have AMD probably the shortcut for screenshot is interfering with the console shortcut. Try and disable the hotkey

@Dadan2002
Copy link

I would be the happiest dude if anyone could help me make the pubg quest, pleasee
here is my discord : justfullofsecrets with cat pfp

@ItsDevilCrossy69
Copy link

U01743-6104-LPD1-LHSKF PUBG

@ItsDevilCrossy69
Copy link

And Honkai: STJTRRD4D6BK

@AxB2002
Copy link

AxB2002 commented May 15, 2024

I have tried every discord client, and betterdiscord, vencord and cant get the dev console/element inspect opened (Ctrl + Shift + I)

Its working for me:

  • Completely close discord via the task manager
  • Win+R -> %appdata%\discord
  • Find settings.json and open it
  • Delete everything, add the following lines:
    {
    "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true,
    "chromiumSwitches": {}
    }
  • Relaucnh discord app and press Ctrl+Shift+I

Voilà :)

@Shakiozz
Copy link

Honkai Code: RBKS9QBY8MHT

@blackrider6066
Copy link

blackrider6066 commented May 16, 2024

Will it still work if I accept 2 quests together?

also, this isn't working even though I'm using discord clinet
if (!isApp) {
console.log("This no longer works in browser. Use the desktop app!")

@AxB2002
Copy link

AxB2002 commented May 16, 2024

Will it still work if I accept 2 quests together?

It will not do all the quest at the same time.
Finish one and then reload the script for the second quest

@OnePunchMan2718
Copy link

Pubg: U01743-74SX-Q4WM-SCG3O

@aix05
Copy link

aix05 commented May 16, 2024

PUBG: U01743-7GVF-ERL2-BYE18

@JosamX
Copy link

JosamX commented May 16, 2024

Honkai: 9S2ATZYH38RF

@TBTech205
Copy link

Honkai Star Rail code: 9TJATYGAP2BB

@Tr0llie
Copy link

Tr0llie commented May 16, 2024

Note

if im not wrong, discord recently fix it so that u can't do it with a music bot anymore, you need an alt that is watching the stream for it to progress.
If it does still work, please correct me, but as far as i know, someone needs to be watching the stream

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