Skip to content

Instantly share code, notes, and snippets.

@aamiaa
Last active May 31, 2024 10:02
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!

This no longer works if you're alone in vc! Somebody else has to join you!

Warning

There are now two quest types ("stream" and "play")! Pay attention to the instructions!

How to use this script:

  1. Accept a quest under User Settings -> Gift Inventory
  2. Press Ctrl+Shift+I to open DevTools
  3. Go to the Console tab
  4. Paste the following code and hit enter:
Click to expand
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 RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).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 api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports;

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 {
	const pid = Math.floor(Math.random() * 30000) + 1000
	const secondsNeeded = quest.config.streamDurationRequirementMinutes * 60
	
	if(quest.config.variants.includes(2)) {
		api.HTTP.get({url: `/applications/public?application_ids=${quest.config.applicationId}`}).then(res => {
			const appData = res.body[0]
			const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","")
			
			const games = RunningGameStore.getRunningGames()
			const fakeGame = {
				cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`,
				exeName,
				exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`,
				hidden: false,
				isLauncher: false,
				id: quest.config.applicationId,
				name: appData.name,
				pid: pid,
				pidPath: [pid],
				processName: appData.name,
				start: Date.now(),
			}
			games.push(fakeGame)
			FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games})
			
			let fn = data => {
				let progress = data.userStatus.streamProgressSeconds
				console.log(`Quest progress: ${progress}/${secondsNeeded}`)
				
				if(progress >= secondsNeeded) {
					console.log("Quest completed!")
					
					const idx = games.indexOf(fakeGame)
					if(idx > -1) {
						games.splice(idx, 1)
						FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []})
					}
					FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
				}
			}
			FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
			
			console.log(`Spoofed your game to ${quest.config.applicationName}. Wait for ${Math.ceil(quest.config.streamDurationRequirementMinutes - (quest.userStatus?.streamProgressSeconds ?? 0) / 60)} more minutes.`)
		})
	} else {
		let realFunc = ApplicationStreamingStore.getStreamerActiveStreamMetadata
		ApplicationStreamingStore.getStreamerActiveStreamMetadata = () => ({
			id: quest.config.applicationId,
			pid,
			sourceName: null
		})
		
		let fn = data => {
			let progress = data.userStatus.streamProgressSeconds
			console.log(`Quest progress: ${progress}/${secondsNeeded}`)
			
			if(progress >= secondsNeeded) {
				console.log("Quest completed!")
				
				ApplicationStreamingStore.getStreamerActiveStreamMetadata = realFunc
				FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
			}
		}
		FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		
		console.log(`Spoofed your stream to ${quest.config.applicationName}. Stream any window 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. Follow the printed instructions depending on what type of quest you have
    • If your quest says to "play" the game, you can just wait and do nothing
    • If your quest says to "stream" the game, join a vc with a friend or alt and stream any window
  2. Wait for 15 minutes
  3. 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.

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.

@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

@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

@vrakelsmike
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

@sametaor
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

@Lampe2020
Copy link

Lampe2020 commented May 20, 2024

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

Yes, and in the "Quests" tab in the Discord settings.
I needed to restart Discord and reinsert the script for it to work with the PUBG one, because I clicked the "Accept quest" button for both PUBG and Honkai, so it chose to do Honkai first and then didn't automatically detect that the PUBG one was also open.

@sametaor
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

Yes, and in the "Quests" tab in the Discord settings. I needed to restart Discord and reinsert the script for it to work with the PUBG one, because I clicked the "Accept quest" button for both PUBG and Honkai, so it chose to do Honkai first and then didn't automatically detect that the PUBG one was also open.

Alr, thanks. I did the same mistake, ig I gotta restart the client or reinstall it. Will update if it works

@snackpackwayne
Copy link

genshin impact - v4.6 quest
6TJDZ5BUQ5E5

honkai: star rail - v2.2 quest
KBKTTYXHRS3T

pubg: battlegrounds - erangel classic quest
U01743-EVKS-000Z-ASN2U

@davehornik
Copy link

@aamiaa Any way to revert back the spoofing as PUBG? I am playing V-Rising, quest complete but Dsc is still thinkin I am playing PUBG 🤣

@swredderx
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

How did you bring up console on discord desktop app (Mac) ? I tried Command⌘ + Option + I but it does not work..

@sametaor
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

Yes, and in the "Quests" tab in the Discord settings. I needed to restart Discord and reinsert the script for it to work with the PUBG one, because I clicked the "Accept quest" button for both PUBG and Honkai, so it chose to do Honkai first and then didn't automatically detect that the PUBG one was also open.

Hey so I tried doing the same, but the error still persists, how exactly did you restart discord and start from scratch?

@Tr0llie
Copy link

Tr0llie commented May 20, 2024

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

Yes, and in the "Quests" tab in the Discord settings. I needed to restart Discord and reinsert the script for it to work with the PUBG one, because I clicked the "Accept quest" button for both PUBG and Honkai, so it chose to do Honkai first and then didn't automatically detect that the PUBG one was also open.

Hey so I tried doing the same, but the error still persists, how exactly did you restart discord and start from scratch?

TO restart discord, if you are on windows go to task manager and search for discord and end task
if ur on Linux (mint) right click on the discord applet and click force close

@Tr0llie
Copy link

Tr0llie commented May 20, 2024

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

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

How did you bring up console on discord desktop app (Mac) ? I tried Command⌘ + Option + I but it does not work..

u need to enable dev options in the settings
if not:
are you on discord ptb or stable? (ptb is recommanded)
if it still doesnt work, just install vencord.

@Tr0llie
Copy link

Tr0llie commented May 20, 2024

@aamiaa Any way to revert back the spoofing as PUBG? I am playing V-Rising, quest complete but Dsc is still thinkin I am playing PUBG 🤣

force shut discord close and open again

@czQery
Copy link

czQery commented May 20, 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.

I managed to claim it on alt, but it just doesn't work on my main.

@sametaor
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

Yes, and in the "Quests" tab in the Discord settings. I needed to restart Discord and reinsert the script for it to work with the PUBG one, because I clicked the "Accept quest" button for both PUBG and Honkai, so it chose to do Honkai first and then didn't automatically detect that the PUBG one was also open.

Hey so I tried doing the same, but the error still persists, how exactly did you restart discord and start from scratch?

TO restart discord, if you are on windows go to task manager and search for discord and end task if ur on Linux (mint) right click on the discord applet and click force close

That doesn't make any difference, the main difference here is that it just puts out "undefined" instead of "Quest Progress: x of 900" in the console.log, which I suspect is due to discord disabling it. Wonder if that can be bypassed, since I did manage to get the one for Honkai in the same way

@Tr0llie
Copy link

Tr0llie commented May 20, 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.

I managed to claim it on alt, but it just doesn't work on my main.

you probably ran the console first before you claim it, so try refresh discord and run the script again

@aamiaa
Copy link
Author

aamiaa commented May 20, 2024

The "undefined" doesn't matter. It's just a devtools shenanigan where it always outputs the value returned by the code you ran, and this one doesn't return anything.

The script is still working, discord didn't disable anything.

@sametaor
Copy link

The "undefined" doesn't matter. It's just a devtools shenanigan where it always outputs the value returned by the code you ran, and this one doesn't return anything.

The script is still working, discord didn't disable anything.

That's what I assumed as well, but it doesn't display any sort of progress on the PUBG quest, it remains at 0%. Is there any way of fixing this? Cause I really don't wanna install a 40GB game just to complete a quest lol.

@czQery
Copy link

czQery commented May 20, 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.

I managed to claim it on alt, but it just doesn't work on my main.

you probably ran the console first before you claim it, so try refresh discord and run the script again

I started the quest 2 days ago and retried many times exactly like it's said in the steps.
I would like to provide some debug information to help this figure it out but id don't know what.

@aamiaa
Copy link
Author

aamiaa commented May 20, 2024

I'm not sure why wouldn't it work for you guys.
If you run it and leave devtools open for a while, do you see any requests labeled "heartbeat" in the Network tab?

@sametaor
Copy link

sametaor commented May 20, 2024

I'm not sure why wouldn't it work for you guys. If you run it and leave devtools open for a while, do you see any requests labeled "heartbeat" in the Network tab?

Nope, all I see is a zstd-stream request being there, no sign of a heartbeat request, but I did notice the heartbeat ACK message being pushed into the console.log as the code defines.
I am guessing it has something to do with starting two quests at the same time, wherein, I accepted the PUBG quest first, followed by the Honkai one(which also worked as expected, unlike PUBG).

@czQery
Copy link

czQery commented May 20, 2024

in network tab no, just in console.

[RTCControlSocket] Sending heartbeat
[RTCControlSocket] Heartbeat ACK received
[DirectVideo] attaching srcObject for 25
Subscribing to direct frames for streamId 25
[RTCControlSocket] Sending heartbeat
[DirectVideo] handleReady for 25, have onReady callback = true
[RTCControlSocket] Heartbeat ACK received
[RTCControlSocket] Sending heartbeat
[RTCControlSocket] Heartbeat ACK received
Unsubscribing from direct frames for streamId 25

image

@Tr0llie
Copy link

Tr0llie commented May 20, 2024

@aamiaa Im pree

I'm not sure why wouldn't it work for you guys. If you run it and leave devtools open for a while, do you see any requests labeled "heartbeat" in the Network tab?

@aamiaa Im pretty sure that discord change it so that someone must be watching the stream no?
because i tried it with a music bot and it doesnt work on all 4 of my accounts

@sametaor
Copy link

@aamiaa Im pree

I'm not sure why wouldn't it work for you guys. If you run it and leave devtools open for a while, do you see any requests labeled "heartbeat" in the Network tab?

@aamiaa Im pretty sure that discord change it so that someone must be watching the stream no? because i tried it with a music bot and it doesnt work on all 4 of my accounts

I am watching my own stream using my own alt right as we speak, yet it doesn't do anything. Must be smth else, or just the usual fallback of discord trying to patch it up.

@Tr0llie
Copy link

Tr0llie commented May 20, 2024

@aamiaa Im pree

I'm not sure why wouldn't it work for you guys. If you run it and leave devtools open for a while, do you see any requests labeled "heartbeat" in the Network tab?

@aamiaa Im pretty sure that discord change it so that someone must be watching the stream no? because i tried it with a music bot and it doesnt work on all 4 of my accounts

I am watching my own stream using my own alt right as we speak, yet it doesn't do anything. Must be smth else, or just the usual fallback of discord trying to patch it up.

i do watxh my own stream but it used to work with bots

@Nixeld
Copy link

Nixeld commented May 20, 2024

The script is not working on my main account but works on 2 other alt accounts.

@zRamoox
Copy link

zRamoox commented May 20, 2024

5TJSSXP2QUXF Honkai Star Rail, thx

@reomix
Copy link

reomix commented May 20, 2024

Enjoy
Honkai gifts :

2AKS98C25827
3T3B89UJM2HX

@reomix
Copy link

reomix commented May 20, 2024

Enjoy
Pubg gifts :

U01743-5K4V-FBPZ-SO2FS
U01743-5NN5-6N5T-J3NXW

@Kekssaege
Copy link

Enjoy
Honkia gifts:
LA3S99S66D9F

@savoie7304
Copy link

PUBG : U01743-F98D-ID6N-0U2ZZ

@Ixnayed
Copy link

Ixnayed commented May 20, 2024

Can somebody please give me a pubg code? My ds is: Azarenkaa

@TfDucchi
Copy link

PUBG: U01743-ES2C-5XWM-ABD80

I can't seem to get the one for PUBG, does it show you the Quest Progress in the console logs?

it dont show in console log

@ktot404
Copy link

ktot404 commented May 21, 2024

Honkai: Star Rail: FBKTAW4FACTB, MT2ASDXTGRZK
PUBG: U01743-FP9S-MVT0-L6R5V, U01743-BM2P-DZDV-N2R1V

@vperpl
Copy link

vperpl commented May 21, 2024

Weird like created new discord account works now but on my main acc icant do it :suspect:

@artemk1z
Copy link

artemk1z commented May 21, 2024

Pubg: U01743-FV68-XAWP-MLXR4
Genshin Impact: YTKCH3GKMHNV
Honkai Star Rail: CT2SBXLE2KEX
enjoy)

@moseybat
Copy link

Genshin: 6T2DG7Z5CYE9
Honkai: YTKAADC28PHK
PUBG: U01743-G19V-GD4I-4B8BM

@rizzomz
Copy link

rizzomz commented May 22, 2024

PUBG: U01743-BFGK-SSAR-B29XR

@Yamac12345
Copy link

Completed a Quest

@Yamac12345
Copy link

Completed a Quest

@Yamac12345
Copy link

"9b1481cc0bc4f8...

@AyelenTH
Copy link

PUBG code: U01743-HMJ4-RU6I-XFDHD

@el-l33v
Copy link

el-l33v commented May 23, 2024

pupbg: U01743-HQ54-5ABY-FUSBB

@GoOfficial
Copy link

GoOfficial commented May 23, 2024

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: https://gist.github.com/RussDev7/4744bd50dd65db27f9fd162e911fd936

@aamiaa
Copy link
Author

aamiaa commented May 23, 2024

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: https://gist.github.com/RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

@UltraBot05
Copy link

UltraBot05 commented May 24, 2024

PUBG: U01743-I7JN-OVES-SCGB8
and if the above doesnt work, https://gist.github.com/UltraBot05/06af64592d07e963a1f46e743bc53c29
my link will 100% work cuz i got badge xd

@sametaor
Copy link

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

True, but it's slightly different, since somehow that worked for me as well. You can take a look as to why that worked when this one didn't, especially for us folks. Then you can add that as an alternative code snippet/solution for those who face similar issues in the future

@SoldMomForWiFi
Copy link

PUBG: U01743-I7JN-OVES-SCGB8 and if the above doesnt work, https://gist.github.com/UltraBot05/06af64592d07e963a1f46e743bc53c29 my link will 100% work cuz i got badge xd

this one worked for me

@aamiaa
Copy link
Author

aamiaa commented May 24, 2024

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

True, but it's slightly different, since somehow that worked for me as well. You can take a look as to why that worked when this one didn't, especially for us folks. Then you can add that as an alternative code snippet/solution for those who face similar issues in the future

No it's literally 1:1 same code. If you look at revisions it's just a fork of this gist without any changes.

@sametaor
Copy link

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

True, but it's slightly different, since somehow that worked for me as well. You can take a look as to why that worked when this one didn't, especially for us folks. Then you can add that as an alternative code snippet/solution for those who face similar issues in the future

No it's literally 1:1 same code. If you look at revisions it's just a fork of this gist without any changes.

Ah I see it now. So if there's no issue, could you paste this as an alternative solution if current one doesn't work? As I said, might prove helpful in the future if people do the same blunders like accepting two quests at once or not being able to use this one in a proper way.

@aamiaa
Copy link
Author

aamiaa commented May 24, 2024

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

True, but it's slightly different, since somehow that worked for me as well. You can take a look as to why that worked when this one didn't, especially for us folks. Then you can add that as an alternative code snippet/solution for those who face similar issues in the future

No it's literally 1:1 same code. If you look at revisions it's just a fork of this gist without any changes.

Ah I see it now. So if there's no issue, could you paste this as an alternative solution if current one doesn't work? As I said, might prove helpful in the future if people do the same blunders like accepting two quests at once or not being able to use this one in a proper way.

There is no alternative solution, it's literally the same code 😭

@K33ko
Copy link

K33ko commented May 25, 2024

hey aamiaa the code does the code not work anymore? im pasting it in the console and i am seeing heartbeat messages but no progress, it also said "undefined" can you help? or is it patched

@aamiaa
Copy link
Author

aamiaa commented May 25, 2024

It should still work. The "undefined" doesn't matter.

@tismofied
Copy link

Thank you @aamiaa . Worked like a charm. gave star ⭐⭐⭐⭐⭐

@sametaor
Copy link

Honestly guys, I tried this code and it didn't work several times. I keep getting "undefined" instead of the quest time. I found another GitHub page with another persons code and it worked for me. If you want to use it then here's the link: RussDev7/4744bd50dd65db27f9fd162e911fd936

But you know that's the exact same code? lol

True, but it's slightly different, since somehow that worked for me as well. You can take a look as to why that worked when this one didn't, especially for us folks. Then you can add that as an alternative code snippet/solution for those who face similar issues in the future

No it's literally 1:1 same code. If you look at revisions it's just a fork of this gist without any changes.

Ah I see it now. So if there's no issue, could you paste this as an alternative solution if current one doesn't work? As I said, might prove helpful in the future if people do the same blunders like accepting two quests at once or not being able to use this one in a proper way.

There is no alternative solution, it's literally the same code 😭

My bad, really sorry for misunderstanding. And thanks a lot for the code, it did help me out on the other two quests after all!

@K33ko
Copy link

K33ko commented May 25, 2024

It should still work. The "undefined" doesn't matter.

oohh my bad i just realized something, my quest is not to stream any game, it says "play pubg battlegrounds for 15 minutes" just that. is there any other code or something to get me dont with this quest that requires me to play and not stream the game?

@courfazor
Copy link

courfazor commented May 25, 2024

It should still work. The "undefined" doesn't matter.

oohh my bad i just realized something, my quest is not to stream any game, it says "play pubg battlegrounds for 15 minutes" just that. is there any other code or something to get me dont with this quest that requires me to play and not stream the game?

You are actually on to something and we are all being idiots!

Maybe some people got the quest to stream the game and others to just play the game?
Here's what it says on the account where it doesn't work: "Play PUBG for 15 minutes"
Screenshot 2024-05-25 at 22 08 12

Also to all the 1:1 forks and people who said the fork worked out and not this exact same code: lol, I feel sorry for you @aamiaa
Beware of people changing it to malicious code later and people running that. I could see that happening... Better to not link anything external here. Remember the XZ backdoor had a ton of social engineering before they decided to act.

@courfazor
Copy link

courfazor commented May 25, 2024

This is how I got the PUBG quest: Rename any .exe file on Windows to TslGame.exe, run it and Discord will think you are playing PUBG and it will progress.

For example:

  1. Find any installer. For example anything in the Downloads folder. If you don't have any download for example 7Zip installer from 7-zip.org, or if you want to be funny use the Discord installer from discord.com
  2. Re-name the .exe installer to TslGame.exe
  3. Run it, you do not have to install anything just keep it running for 15 minutes

Play PUBG for 15 minutes Quest should unlock in 15 minutes.

@aamiaa
Copy link
Author

aamiaa commented May 25, 2024

You guys are right, I didn't notice the "play" vs "stream" variants.
From what I see, they introduced this on May 13th, and the script worked fine with that a day later, tho I wouldn't be surprised if this has broken since then.

For those who have the "play" variant, does the script work for you when you follow the instructions regardless?
If not, can you try the following and see if it works:

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);

let RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).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 api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports;

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 {
	api.HTTP.get({url: `/applications/public?application_ids=${quest.config.applicationId}`}).then(res => {
		const appData = res.body[0]
		const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","")
		
		const pid = Math.floor(Math.random() * 30000) + 1000
		const games = RunningGameStore.getRunningGames()
		const fakeGame = {
			cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`,
			exeName,
			exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`,
			hidden: false,
			isLauncher: false,
			id: quest.config.applicationId,
			name: appData.name,
			pid: pid,
			pidPath: [pid],
			processName: appData.name,
			start: Date.now(),
		}
		games.push(fakeGame)
		FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games})
		
		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!")
				
				const idx = games.indexOf(fakeGame)
				if(idx > -1) {
					games.splice(idx, 1)
					FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []})
				}
				FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
			}
		}
		FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		
		console.log(`Spoofed your game to ${quest.config.applicationName}. Wait for ${Math.ceil(quest.config.streamDurationRequirementMinutes - (quest.userStatus?.streamProgressSeconds ?? 0) / 60)} more minutes.`)
	})
}

@itskenili
Copy link

PUBG: U01743-KGZ0-2LLV-FLUW8
Honkai: YAKTR9J4FC4X

@K33ko
Copy link

K33ko commented May 26, 2024

just tried that new script and it worked, didn't need to be in a vc nor needed any other alt account. just pasted that in the console and waited 15 minutes thank you aamiaa! (how did we not notice the play quest before lmfao)

@aamiaa
Copy link
Author

aamiaa commented May 26, 2024

Okay awesome, thanks for testing it!
I will update the main gist tomorrow to make it automatically choose which version of the code to run.

@barraIhsan
Copy link

barraIhsan commented May 26, 2024

You guys are right, I didn't notice the "play" vs "stream" variants. From what I see, they introduced this on May 13th, and the script worked fine with that a day later, tho I wouldn't be surprised if this has broken since then.

For those who have the "play" variant, does the script work for you when you follow the instructions regardless? If not, can you try the following and see if it works:

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);

let RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).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 api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports;

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 {
	api.HTTP.get({url: `/applications/public?application_ids=${quest.config.applicationId}`}).then(res => {
		const appData = res.body[0]
		const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","")
		
		const pid = Math.floor(Math.random() * 30000) + 1000
		const games = RunningGameStore.getRunningGames()
		const fakeGame = {
			cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`,
			exeName,
			exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`,
			hidden: false,
			isLauncher: false,
			id: quest.config.applicationId,
			name: appData.name,
			pid: pid,
			pidPath: [pid],
			processName: appData.name,
			start: Date.now(),
		}
		games.push(fakeGame)
		FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games})
		
		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!")
				
				const idx = games.indexOf(fakeGame)
				if(idx > -1) {
					games.splice(idx, 1)
					FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []})
				}
				FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
			}
		}
		FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		
		console.log(`Spoofed your game to ${quest.config.applicationName}. Wait for ${Math.ceil(quest.config.streamDurationRequirementMinutes - (quest.userStatus?.streamProgressSeconds ?? 0) / 60)} more minutes.`)
	})
}

ohhhh... that's why the pubg didnt work (I was confused why it didn'r print out "Quest Progress"), it's PLAY not STREAM, thanks! it's working now

@sametaor
Copy link

sametaor commented May 26, 2024

You guys are right, I didn't notice the "play" vs "stream" variants. From what I see, they introduced this on May 13th, and the script worked fine with that a day later, tho I wouldn't be surprised if this has broken since then.

For those who have the "play" variant, does the script work for you when you follow the instructions regardless? If not, can you try the following and see if it works:

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);

let RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).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 api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports;

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 {
	api.HTTP.get({url: `/applications/public?application_ids=${quest.config.applicationId}`}).then(res => {
		const appData = res.body[0]
		const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","")
		
		const pid = Math.floor(Math.random() * 30000) + 1000
		const games = RunningGameStore.getRunningGames()
		const fakeGame = {
			cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`,
			exeName,
			exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`,
			hidden: false,
			isLauncher: false,
			id: quest.config.applicationId,
			name: appData.name,
			pid: pid,
			pidPath: [pid],
			processName: appData.name,
			start: Date.now(),
		}
		games.push(fakeGame)
		FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games})
		
		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!")
				
				const idx = games.indexOf(fakeGame)
				if(idx > -1) {
					games.splice(idx, 1)
					FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []})
				}
				FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
			}
		}
		FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
		
		console.log(`Spoofed your game to ${quest.config.applicationName}. Wait for ${Math.ceil(quest.config.streamDurationRequirementMinutes - (quest.userStatus?.streamProgressSeconds ?? 0) / 60)} more minutes.`)
	})
}

Yep, it works!
PUBG: U01743-KILK-F3HI-FG5RQ

@barraIhsan
Copy link

PUBG: U01743-KKGB-BN2H-VUO2X

@kacygd
Copy link

kacygd commented May 26, 2024

PUBG U01743-KQYI-LDRY-1MRF7

@K33ko
Copy link

K33ko commented May 26, 2024

Okay awesome, thanks for testing it! I will update the main gist tomorrow to make it automatically choose which version of the code to run.

no problem! thanks for your work, dropped a follow.

@Rayyan2650
Copy link

it doesn't work in browser
image
is it patched now? (my quest was the pubg one play it for 15minutes)

@Azqupai
Copy link

Azqupai commented May 26, 2024

PUBG: U01743-KUQH-RNR9-XKQDV

@Rayyan2650
Copy link

it doesn't work in browser
image
is it patched now? (my quest was the pubg one play it for 15minutes)

@sametaor
Copy link

it doesn't work in browser image is it patched now? (my quest was the pubg one play it for 15minutes)

Browser won't work for this anyways, as the description says, you're better off using discord ptb or enabling the inspect mode in discord app on desktop

@K33ko
Copy link

K33ko commented May 26, 2024

it doesn't work in browser image is it patched now? (my quest was the pubg one play it for 15minutes)

it doesnt work in browser you have to do it in the discord app but to be able to open console in the discord app you have to enable that first in the settings.json file of discord (u can easily find a quick tutorial on that)

@BSNIKYT
Copy link

BSNIKYT commented May 26, 2024

I set the resolution, opened the console and pasted the code. But I don't receive 0/900 data in response. What's the matter?
image

@Tifanadputra
Copy link

Same problem, I just tried it and the quest process didn't increase the percent

I set the resolution, opened the console and pasted the code. But I don't receive 0/900 data in response. What's the matter? image
Same problem, I just tried it and the quest process didn't increase the percent

@Hacktiv8or
Copy link

Hacktiv8or commented May 28, 2024

I set the resolution, opened the console and pasted the code. But I don't receive 0/900 data in response. What's the matter? image

Same Problem with me too... it just gives this error
Screenshot 2024-05-28 095754

@Tanishq-rwt9
Copy link

same

@Aviviviviveee
Copy link

mmm, ive got the same problem as the people above me. the progress bar just doesnt move.

@quincynyan
Copy link

U01743-OJM4-AC41-KHI45
PUBG

@ZeLemun
Copy link

ZeLemun commented May 29, 2024

why i havent got anything? yesterday i had the pubg quest but now nothing? why?

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