Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active May 9, 2024 02:38
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.

@CheeseyPlayz
Copy link

i dont play genshin impact, so heres the code, enjoy
MS3DZZ97NPV9

@thisforest
Copy link

Thank you for this,

anyone wanting to redeem in Genshin heres mine

QT2UZYR7TET9

@panthercheats
Copy link

its not even working
image

@kzndotsh
Copy link

kzndotsh commented May 7, 2024

3TKDHGQVWFX5

@TheTrueShadow
Copy link

DAJDZZQCYBHM

@mi9khin12
Copy link

MTJVZGRW5A5V
Thx for this script

@RoyWillems137
Copy link

4BKDHHRFABR9

@mikoprimeb
Copy link

its not even working image

well now you just use desktop app, cant you read

@IshankShankerCodes
Copy link

its not even working image

well now you just use desktop app, cant you read

how to do it on desktop app :-:

@DELTA293
Copy link

DELTA293 commented May 7, 2024

This no longer works in browser. Use the desktop app!

@CamberWTF
Copy link

i dont play genshin impact so if you cant do it and want the code there it is: AS2UGXSVM4ZR

@arHSM
Copy link

arHSM commented May 8, 2024

IIFE version for vencord

(() => {
    const ApplicationStreamingStore = Vencord.Webpack.findStore(
        "ApplicationStreamingStore"
    );
    const QuestsStore = Vencord.Webpack.findStore("QuestsStore");
    const { FluxDispatcher } = Vencord.Webpack.Common;

    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!"
        );
    }
})();

@goat865
Copy link

goat865 commented May 8, 2024

2SKCGMHL738R (genshin)

@lastlament
Copy link

works with hsr! thx

@omarAtef101
Copy link

GT2SWJSXFY4F

@goat865
Copy link

goat865 commented May 8, 2024

CT2AX2SX2Z47 (honkai)

@Redblazer27
Copy link

i have 2 codes ( i have a life):

  1. ETJAWJBDA6BK
  2. US3AF3A6DWSK (from my friend)
    enjoy it broskys!

@famesxd
Copy link

famesxd commented May 8, 2024

9S2BW3TJDCCX honkai

@famesxd
Copy link

famesxd commented May 8, 2024

LSKDH6ZMXCXZ genshin

@OptioniaI
Copy link

Honkai

KSKSE48XDW3K

@BatchQuick
Copy link

my code is 8A3UG6C26TRV

@XenusDev
Copy link

XenusDev commented May 8, 2024

6S2BW59ZF63P Honkai !

@TwoPointInfinity
Copy link

TwoPointInfinity commented May 8, 2024

This works for me, the other person in vc doesnt even have to "watch stream" they can be afk or just a public server. (if you dont have an alt)

@NullDev
Copy link

NullDev commented May 8, 2024

Thanks! PT3TEM6AKJCT Honkai

@Shroomisle
Copy link

For those who want the genshin code: JSKCYGQBCGAM

For those who want the honkai code: 3T3TE5NU5R2X

Enjoy!

@corp14x3
Copy link

corp14x3 commented May 9, 2024

KS3AWMMSFGAX for honkai

@SpookZorp
Copy link

how do I do it on desktop app?

@4rvx
Copy link

4rvx commented May 9, 2024

Genshin Code: 7B2CGHJXWSUZ
Honkai code: PAJBELJY2XBK

@Higuyshowisitgoing
Copy link

Genshin Code: 7B2CGHJXWSUZ Honkai code: PAJBELJY2XBK

Do u get a new badge with honkai or it’s the same?

@0zul
Copy link

0zul commented May 9, 2024

Honkai Star Rail Code: AS3SXMJQPW9X

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