mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
Fix Formatting
This commit is contained in:
parent
5195317cc4
commit
557fdcfc60
2 changed files with 55 additions and 48 deletions
|
@ -115,6 +115,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
- NoMirroredCamera by Nyx
|
- NoMirroredCamera by Nyx
|
||||||
- NoModalAnimation by AutumnVN
|
- NoModalAnimation by AutumnVN
|
||||||
- NoNitroUpsell by thororen
|
- NoNitroUpsell by thororen
|
||||||
|
- NoOnboarding by omaw & Glitch
|
||||||
- NoRoleHeaders by Samwich
|
- NoRoleHeaders by Samwich
|
||||||
- NotificationTitle by Kyuuhachi
|
- NotificationTitle by Kyuuhachi
|
||||||
- OnePingPerDM by ProffDea
|
- OnePingPerDM by ProffDea
|
||||||
|
@ -126,7 +127,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
- QuestCompleter by Amia
|
- QuestCompleter by Amia
|
||||||
- QuestionMarkReplacement by nyx
|
- QuestionMarkReplacement by nyx
|
||||||
- Quoter by Samwich
|
- Quoter by Samwich
|
||||||
- RandomVoice by xijexo & omaw
|
- RandomVoice by xijexo, omaw, thororen
|
||||||
- Remix by MrDiamond
|
- Remix by MrDiamond
|
||||||
- RemixMe by kvba
|
- RemixMe by kvba
|
||||||
- RepeatMessage by Tolgchu
|
- RepeatMessage by Tolgchu
|
||||||
|
|
|
@ -1,56 +1,62 @@
|
||||||
import definePlugin from "@utils/types";
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2025 Vendicated and contributors
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
import { Devs, EquicordDevs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
import { RestAPI } from "@webpack/common";
|
import { RestAPI } from "@webpack/common";
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "NoOnboarding",
|
name: "NoOnboarding",
|
||||||
description: "Bypasses Discord's onboarding process for quicker server entry.",
|
description: "Bypasses Discord's onboarding process for quicker server entry.",
|
||||||
authors: [EquicordDevs.omaw, Devs.Glitch],
|
authors: [EquicordDevs.omaw, Devs.Glitch],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ",acceptInvite(",
|
find: ",acceptInvite(",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!=.+?;/,
|
match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!=.+?;/,
|
||||||
replace: (m, guildId) => `${m}$self.bypassOnboard(${guildId});`
|
replace: (m, guildId) => `${m}$self.bypassOnboard(${guildId});`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "{joinGuild:",
|
find: "{joinGuild:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /guildId:(\i),lurker:(\i).{0,20}}\)\);/,
|
match: /guildId:(\i),lurker:(\i).{0,20}}\)\);/,
|
||||||
replace: (m, guildId, lurker) => `${m}if(!${lurker})$self.bypassOnboard(${guildId});`
|
replace: (m, guildId, lurker) => `${m}if(!${lurker})$self.bypassOnboard(${guildId});`
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
bypassOnboard(guild_id: string) {
|
|
||||||
RestAPI.get({ url: `/guilds/${guild_id}/onboarding` }).then(res => {
|
|
||||||
const data = res.body;
|
|
||||||
if (!data?.prompts?.length) return;
|
|
||||||
|
|
||||||
const now = Math.floor(Date.now() / 1000);
|
|
||||||
const prompts_seen: Record<string, number> = {};
|
|
||||||
const responses_seen: Record<string, number> = {};
|
|
||||||
const responses: string[] = [];
|
|
||||||
|
|
||||||
for (const prompt of data.prompts) {
|
|
||||||
const options = prompt.options || [];
|
|
||||||
if (!options.length) continue;
|
|
||||||
prompts_seen[prompt.id] = now;
|
|
||||||
for (const opt of options) responses_seen[opt.id] = now;
|
|
||||||
responses.push(options[options.length - 1].id);
|
|
||||||
}
|
|
||||||
|
|
||||||
const payload = {
|
|
||||||
onboarding_responses: responses,
|
|
||||||
onboarding_prompts_seen: prompts_seen,
|
|
||||||
onboarding_responses_seen: responses_seen,
|
|
||||||
};
|
|
||||||
|
|
||||||
RestAPI.post({
|
|
||||||
url: `/guilds/${guild_id}/onboarding-responses`,
|
|
||||||
body: payload
|
|
||||||
}).catch(() => {});
|
|
||||||
}).catch(() => {});
|
|
||||||
}
|
}
|
||||||
});
|
],
|
||||||
|
bypassOnboard(guild_id: string) {
|
||||||
|
RestAPI.get({ url: `/guilds/${guild_id}/onboarding` }).then(res => {
|
||||||
|
const data = res.body;
|
||||||
|
if (!data?.prompts?.length) return;
|
||||||
|
|
||||||
|
const now = Math.floor(Date.now() / 1000);
|
||||||
|
const prompts_seen: Record<string, number> = {};
|
||||||
|
const responses_seen: Record<string, number> = {};
|
||||||
|
const responses: string[] = [];
|
||||||
|
|
||||||
|
for (const prompt of data.prompts) {
|
||||||
|
const options = prompt.options || [];
|
||||||
|
if (!options.length) continue;
|
||||||
|
prompts_seen[prompt.id] = now;
|
||||||
|
for (const opt of options) responses_seen[opt.id] = now;
|
||||||
|
responses.push(options[options.length - 1].id);
|
||||||
|
}
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
onboarding_responses: responses,
|
||||||
|
onboarding_prompts_seen: prompts_seen,
|
||||||
|
onboarding_responses_seen: responses_seen,
|
||||||
|
};
|
||||||
|
|
||||||
|
RestAPI.post({
|
||||||
|
url: `/guilds/${guild_id}/onboarding-responses`,
|
||||||
|
body: payload
|
||||||
|
}).catch(() => { });
|
||||||
|
}).catch(() => { });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue