GlobalBadges: Add Paicord
This commit is contained in:
parent
7f79f9e445
commit
7b91723d49
3 changed files with 17 additions and 11 deletions
|
|
@ -7,6 +7,7 @@
|
|||
import "./styles.css";
|
||||
|
||||
import { BadgePosition, ProfileBadge } from "@api/Badges";
|
||||
import { migratePluginSetting } from "@api/Settings";
|
||||
import { Button } from "@components/Button";
|
||||
import { BadgeContextMenu } from "@plugins/_api/badges";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
|
|
@ -20,6 +21,7 @@ import { cl, GlobalBadges, INVITE_LINK, loadBadges } from "./utils";
|
|||
|
||||
let intervalId: any;
|
||||
|
||||
migratePluginSetting("GlobalBadges", "showRaincord", "showRa1ncord");
|
||||
export default definePlugin({
|
||||
name: "GlobalBadges",
|
||||
description: "Adds global badges from other client mods",
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ export const settings = definePluginSettings({
|
|||
default: true,
|
||||
restartNeeded: false
|
||||
},
|
||||
showRa1ncord: {
|
||||
showRaincord: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Show Ra1ncord Badges",
|
||||
description: "Show Raincord Badges",
|
||||
default: true,
|
||||
restartNeeded: false
|
||||
},
|
||||
|
|
@ -78,6 +78,12 @@ export const settings = definePluginSettings({
|
|||
default: true,
|
||||
restartNeeded: false
|
||||
},
|
||||
showPaicord: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Show Paicord Badges",
|
||||
default: true,
|
||||
restartNeeded: false
|
||||
},
|
||||
apiUrl: {
|
||||
type: OptionType.STRING,
|
||||
description: "API to use",
|
||||
|
|
|
|||
|
|
@ -14,18 +14,19 @@ export let GlobalBadges = {};
|
|||
export const INVITE_LINK = "kwHCJPxp8t";
|
||||
export const cl = classNameFactory("vc-global-badges-");
|
||||
export const serviceMap: Record<string, string> = {
|
||||
badgevault: "BadgeVault",
|
||||
nekocord: "Nekocord",
|
||||
reviewdb: "ReviewDB",
|
||||
aero: "Aero",
|
||||
aliucord: "Aliucord",
|
||||
ra1ncord: "Ra1ncord",
|
||||
raincord: "Raincord",
|
||||
velocity: "Velocity",
|
||||
enmity: "Enmity",
|
||||
badgevault: "BadgeVault",
|
||||
vencord: "Vencord",
|
||||
equicord: "Equicord",
|
||||
paicord: "Paicord",
|
||||
};
|
||||
|
||||
const blockedMods = ["vencord", "equicord"];
|
||||
|
||||
export async function loadBadges() {
|
||||
const url = settings.store.apiUrl.endsWith("/") ? settings.store.apiUrl + "users" : settings.store.apiUrl + "/users";
|
||||
const globalBadges = await fetch(url, { cache: "no-cache" }).then(r => r.json());
|
||||
|
|
@ -34,10 +35,7 @@ export async function loadBadges() {
|
|||
for (const key in globalBadges.users) {
|
||||
filteredUsers[key] = globalBadges.users[key].filter(b => {
|
||||
const { mod } = b;
|
||||
if (!mod) return false;
|
||||
|
||||
const blockedMods = ["vencord", "equicord"];
|
||||
if (blockedMods.includes(mod)) return false;
|
||||
if (!mod || blockedMods.includes(mod)) return false;
|
||||
|
||||
const conditionalMods = {
|
||||
aero: settings.store.showAero,
|
||||
|
|
@ -46,7 +44,7 @@ export async function loadBadges() {
|
|||
nekocord: settings.store.showNekocord,
|
||||
reviewdb: settings.store.showReviewDB,
|
||||
aliucord: settings.store.showAliucord,
|
||||
ra1ncord: settings.store.showRa1ncord,
|
||||
raincord: settings.store.showRaincord,
|
||||
enmity: settings.store.showEnmity
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue