Skip to content

Commit 6b7efa0

Browse files
authored
Update QuestCompleter
1 parent bff85ef commit 6b7efa0

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/plusplugins/questCompleter/index.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ async function openCompleteQuestUI() {
5858

5959
const applicationId = quest.config.application.id;
6060
const applicationName = quest.config.application.name;
61-
const taskName = ["WATCH_VIDEO", "PLAY_ON_DESKTOP", "STREAM_ON_DESKTOP", "PLAY_ACTIVITY", "WATCH_VIDEO_ON_MOBILE"].find(x => quest.config.taskConfig.tasks[x] != null);
61+
const taskName = ["WATCH_VIDEO", "PLAY_ON_DESKTOP", "STREAM_ON_DESKTOP", "PLAY_ACTIVITY", "WATCH_VIDEO_ON_MOBILE"].find(x => quest.config.taskConfigV2.tasks[x] != null);
6262
const icon = `https://cdn.discordapp.com/quests/${quest.id}/${theme}/${quest.config.assets.gameTile}`;
6363
// @ts-ignore
64-
const secondsNeeded = quest.config.taskConfig.tasks[taskName].target;
64+
const secondsNeeded = quest.config.taskConfigV2.tasks[taskName].target;
6565
// @ts-ignore
6666
let secondsDone = quest.userStatus?.progress?.[taskName]?.value ?? 0;
6767
if (taskName === "WATCH_VIDEO" || taskName === "WATCH_VIDEO_ON_MOBILE") {
@@ -142,7 +142,11 @@ async function openCompleteQuestUI() {
142142
}
143143
};
144144
FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn);
145-
console.log(`Spoofed your game to ${applicationName}.`);
145+
showNotification({
146+
title: `${applicationName} - Quest Completer`,
147+
body: `Spoofed your application to ${applicationName}.`,
148+
icon: icon,
149+
});
146150
});
147151
} else if (taskName === "STREAM_ON_DESKTOP") {
148152
const stream = ApplicationStreamingStore.getAnyStreamForUser(UserStore.getCurrentUser()?.id);
@@ -185,7 +189,16 @@ async function openCompleteQuestUI() {
185189
}
186190
};
187191
FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn);
188-
console.log(`Spoofed your stream to ${applicationName}.`);
192+
showNotification({
193+
title: `${applicationName} - Quest Completer`,
194+
body: `Stream any window in a voice channel for ${Math.ceil((secondsNeeded - secondsDone) / 60)} more minutes.`,
195+
icon: icon,
196+
});
197+
showNotification({
198+
title: `${applicationName} - Quest Completer`,
199+
body: "There needs to be at least 1 other person in the voice channel!",
200+
icon: icon,
201+
});
189202
} else if (taskName === "PLAY_ACTIVITY") {
190203
const channelId = ChannelStore.getSortedPrivateChannels()[0]?.id ?? Object.values(GuildChannelStore.getAllGuilds() as any[]).find(x => x != null && x.VOCAL.length > 0).VOCAL[0].channel.id;
191204
const streamKey = `call:${channelId}:1`;

0 commit comments

Comments
 (0)