Skip to content

Instantly share code, notes, and snippets.

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

@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

@blakewitha4
Copy link

it still works if you do it in discord. for people having problems what i did was just delete
(its at the very end of the code) and make sure to add back the "}" so the code works
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!")
}

@Tr0llie
Copy link

Tr0llie commented May 17, 2024

it still works if you do it in discord. for people having problems what i did was just delete (its at the very end of the code) and make sure to add back the "}" so the code works 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!") }

per your comment, i am not sure what you're tryn to imply, it still work with a music bot? because i tried it on multiple account and it does not work anymore

@x-xhai
Copy link

x-xhai commented May 17, 2024

HONKAI:

HSKT8RAA6FTF

@nixielectra
Copy link

PUBG: U01743-9V5K-P5ZM-C8N84

@WilkorPLYT
Copy link

WilkorPLYT commented May 17, 2024

Genshin:

MA3TTWQ8YKFB

@arpan-khan
Copy link

PUBG: U01743-A6WL-S6SY-MT9HB

@MrBaconHat
Copy link

how do i use this script on desktop? can anyone guide me?

@TropicalBeach
Copy link

U01743-AO3C-51B7-1LYVI pubg reward

@aamiaa
Copy link
Author

aamiaa commented May 17, 2024

how do i use this script on desktop? can anyone guide me?

Yes. You'll find a guide at the top of the page.

@truja000
Copy link

not workin??

@BubblzxD
Copy link

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

@aamiaa
Copy link
Author

aamiaa commented May 17, 2024

what
it can't make your discord slow, it just overwrites an existing function

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