mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-20 15:18:50 -05:00
Suncord EOL
This commit is contained in:
parent
0c97ef7e44
commit
f2404df3af
9 changed files with 7 additions and 202 deletions
|
@ -194,8 +194,6 @@ https://discord.gg/5Xh2W87egW
|
|||
|
||||
## Credits
|
||||
|
||||
Thank you to [Suncord](https://github.com/verticalsync/Suncord) by [VerticalSync](https://github.com/verticalsync) for helping me when needed.
|
||||
|
||||
Thank you to [Vendicated](https://github.com/Vendicated) for creating [Vencord](https://github.com/Vendicated/Vencord).
|
||||
|
||||
## Star History
|
||||
|
|
|
@ -92,10 +92,8 @@ export function _getBadges(args: BadgeUserArgs) {
|
|||
}
|
||||
const donorBadges = (Plugins.BadgeAPI as unknown as typeof import("../plugins/_api/badges").default).getDonorBadges(args.userId);
|
||||
const equicordDonorBadges = (Plugins.BadgeAPI as unknown as typeof import("../plugins/_api/badges").default).getEquicordDonorBadges(args.userId);
|
||||
const suncordDonorBadges = (Plugins.BadgeAPI as unknown as typeof import("../plugins/_api/badges").default).getSuncordDonorBadges(args.userId);
|
||||
if (donorBadges) badges.unshift(...donorBadges);
|
||||
if (equicordDonorBadges) badges.unshift(...equicordDonorBadges);
|
||||
if (suncordDonorBadges) badges.unshift(...suncordDonorBadges);
|
||||
|
||||
return badges;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useSettings } from "@api/Settings";
|
|||
import { classNameFactory } from "@api/Styles";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Link } from "@components/Link";
|
||||
import { EquicordDevsById, SuncordDevsById, VencordDevsById } from "@utils/constants";
|
||||
import { EquicordDevsById, VencordDevsById } from "@utils/constants";
|
||||
import { fetchUserProfile } from "@utils/discord";
|
||||
import { classes, pluralise } from "@utils/misc";
|
||||
import { ModalContent, ModalRoot, openModal } from "@utils/modal";
|
||||
|
@ -51,8 +51,8 @@ function ContributorModal({ user }: { user: User; }) {
|
|||
|
||||
const plugins = useMemo(() => {
|
||||
const allPlugins = Object.values(Plugins);
|
||||
const pluginsByAuthor = VencordDevsById[user.id] || EquicordDevsById[user.id] || SuncordDevsById[user.id]
|
||||
? allPlugins.filter(p => p.authors.includes(VencordDevsById[user.id] || EquicordDevsById[user.id] || SuncordDevsById[user.id]))
|
||||
const pluginsByAuthor = VencordDevsById[user.id] || EquicordDevsById[user.id]
|
||||
? allPlugins.filter(p => p.authors.includes(VencordDevsById[user.id] || EquicordDevsById[user.id]))
|
||||
: allPlugins.filter(p => p.authors.some(a => a.name === user.username));
|
||||
|
||||
return pluginsByAuthor
|
||||
|
|
|
@ -39,7 +39,7 @@ interface BadgeCache {
|
|||
let badgeImages;
|
||||
|
||||
// const API_URL = "https://clientmodbadges-api.herokuapp.com/";
|
||||
const API_URL = "https://globalbadges.suncord.rest/";
|
||||
const API_URL = "https://globalbadges.equicord.fyi/";
|
||||
|
||||
const cache = new Map<string, BadgeCache>();
|
||||
const EXPIRES = 1000 * 60 * 15;
|
||||
|
@ -88,7 +88,6 @@ const GlobalBadges = ({ userId }: { userId: string; }) => {
|
|||
Object.keys(badges).forEach(mod => {
|
||||
if (mod.toLowerCase() === "vencord") return;
|
||||
if (mod.toLowerCase() === "equicord") return;
|
||||
if (mod.toLowerCase() === "suncord") return;
|
||||
badges[mod].forEach(badge => {
|
||||
if (typeof badge === "string") {
|
||||
const fullNames = { "hunter": "Bug Hunter", "early": "Early User" };
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { addDecoration, removeDecoration } from "@api/MessageDecorations";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { isEquicordPluginDev, isPluginDev, isSuncordPluginDev } from "@utils/misc";
|
||||
import { isEquicordPluginDev, isPluginDev } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import badges from "plugins/_api/badges";
|
||||
|
@ -60,30 +60,6 @@ function CheckBadge({ badge, author }: { badge: string; author: User; }): JSX.El
|
|||
/>
|
||||
</span>
|
||||
) : null;
|
||||
case "SuncordDonor":
|
||||
return (
|
||||
<span style={{ order: settings.store.SuncordDonorPosition }}>
|
||||
{badges.getSuncordDonorBadges(author.id)?.map((badge: any) => (
|
||||
<RoleIconComponent
|
||||
className={roleIconClassName}
|
||||
name={badge.description}
|
||||
size={20}
|
||||
src={badge.image}
|
||||
/>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
case "SuncordContributer":
|
||||
return isSuncordPluginDev(author.id) ? (
|
||||
<span style={{ order: settings.store.SuncordContributorPosition }}>
|
||||
<RoleIconComponent
|
||||
className={roleIconClassName}
|
||||
name={"Suncord Contributor"}
|
||||
size={20}
|
||||
src={"https://raw.githubusercontent.com/verticalsync/Suncord/main/src/assets/icon.png"}
|
||||
/>
|
||||
</span>
|
||||
) : null;
|
||||
case "VencordDonor":
|
||||
return (
|
||||
<span style={{ order: settings.store.VencordDonorPosition }}>
|
||||
|
@ -150,8 +126,6 @@ function ChatBadges({ author }: { author: User; }) {
|
|||
<span className="vc-sbic-badge-row" style={{ margin: "2px" }}>
|
||||
{settings.store.showEquicordDonor && <CheckBadge badge={"EquicordDonor"} author={author} />}
|
||||
{settings.store.showEquicordContributor && <CheckBadge badge={"EquicordContributer"} author={author} />}
|
||||
{settings.store.showSuncordDonor && <CheckBadge badge={"SuncordDonor"} author={author} />}
|
||||
{settings.store.showSuncordContributor && <CheckBadge badge={"SuncordContributer"} author={author} />}
|
||||
{settings.store.showVencordDonor && <CheckBadge badge={"VencordDonor"} author={author} />}
|
||||
{settings.store.showVencordContributor && <CheckBadge badge={"VencordContributer"} author={author} />}
|
||||
{settings.store.showDiscordProfile && <CheckBadge badge={"DiscordProfile"} author={author} />}
|
||||
|
|
|
@ -33,30 +33,6 @@ const settings = definePluginSettings({
|
|||
hidden: true,
|
||||
default: 1
|
||||
},
|
||||
showSuncordDonor: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Enable to show Suncord Donor badges in chat.",
|
||||
hidden: true,
|
||||
default: true
|
||||
},
|
||||
SuncordDonorPosition: {
|
||||
type: OptionType.NUMBER,
|
||||
description: "The position of the Suncord Donor badges.",
|
||||
hidden: true,
|
||||
default: 2
|
||||
},
|
||||
showSuncordContributor: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Enable to show Suncord Contributor badges in chat.",
|
||||
hidden: true,
|
||||
default: true
|
||||
},
|
||||
SuncordContributorPosition: {
|
||||
type: OptionType.NUMBER,
|
||||
description: "The position of the Suncord Contributor badge.",
|
||||
hidden: true,
|
||||
default: 3
|
||||
},
|
||||
showVencordDonor: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Enable to show Vencord donor badges in chat.",
|
||||
|
@ -118,8 +94,6 @@ const BadgeSettings = () => {
|
|||
const [images, setImages] = useState([
|
||||
{ src: "https://i.imgur.com/KsxHlbD.png", shown: settings.store.showEquicordDonor, title: "Equicord donor badges", key: "EquicordDonor", position: settings.store.EquicordDonorPosition },
|
||||
{ src: "https://i.imgur.com/rJDRtUB.png", shown: settings.store.showEquicordContributor, title: "Equicord contributor badge", key: "EquicordContributer", position: settings.store.EquicordContributorPosition },
|
||||
{ src: "https://i.imgur.com/H3GPhpd.png", shown: settings.store.showSuncordDonor, title: "Suncord donor badges", key: "SuncordDonor", position: settings.store.SuncordDonorPosition },
|
||||
{ src: "https://raw.githubusercontent.com/verticalsync/Suncord/main/src/assets/icon.png", shown: settings.store.showSuncordContributor, title: "Suncord contributor badge", key: "SuncordContributer", position: settings.store.SuncordContributorPosition },
|
||||
{ src: "https://cdn.discordapp.com/emojis/1026533070955872337.png", shown: settings.store.showVencordDonor, title: "Vencord donor badges", key: "VencordDonor", position: settings.store.VencordDonorPosition },
|
||||
{ src: "https://vencord.dev/assets/favicon.png", shown: settings.store.showVencordContributor, title: "Vencord contributor badge", key: "VencordContributer", position: settings.store.VencordContributorPosition },
|
||||
{ src: "https://cdn.discordapp.com/badge-icons/bf01d1073931f921909045f3a39fd264.png", shown: settings.store.showDiscordProfile, title: "Discord profile badges (HypeSquad, Discord Staff, Active Developer, etc.)", key: "DiscordProfile", position: settings.store.DiscordProfilePosition },
|
||||
|
@ -137,14 +111,6 @@ const BadgeSettings = () => {
|
|||
settings.store.EquicordContributorPosition = image.position;
|
||||
settings.store.showEquicordContributor = image.shown;
|
||||
break;
|
||||
case "SuncordDonor":
|
||||
settings.store.SuncordDonorPosition = image.position;
|
||||
settings.store.showSuncordDonor = image.shown;
|
||||
break;
|
||||
case "SuncordContributer":
|
||||
settings.store.SuncordContributorPosition = image.position;
|
||||
settings.store.showSuncordContributor = image.shown;
|
||||
break;
|
||||
case "VencordDonor":
|
||||
settings.store.VencordDonorPosition = image.position;
|
||||
settings.store.showVencordDonor = image.shown;
|
||||
|
|
|
@ -27,7 +27,7 @@ import { openContributorModal } from "@components/PluginSettings/ContributorModa
|
|||
import { Devs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { isEquicordPluginDev, isPluginDev, isSuncordPluginDev } from "@utils/misc";
|
||||
import { isEquicordPluginDev, isPluginDev } from "@utils/misc";
|
||||
import { closeModal, Modals, openModal } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Forms, Toasts, UserStore } from "@webpack/common";
|
||||
|
@ -35,7 +35,6 @@ import { User } from "discord-types/general";
|
|||
|
||||
const CONTRIBUTOR_BADGE = "https://vencord.dev/assets/favicon.png";
|
||||
const EQUICORD_CONTRIBUTOR_BADGE = "https://i.imgur.com/57ATLZu.png";
|
||||
const SUNCORD_CONTRIBUTOR_BADGE = "https://raw.githubusercontent.com/verticalsync/Suncord/main/src/assets/icon.png";
|
||||
|
||||
const ContributorBadge: ProfileBadge = {
|
||||
description: "Vencord Contributor",
|
||||
|
@ -53,17 +52,8 @@ const EquicordContributorBadge: ProfileBadge = {
|
|||
onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId))
|
||||
};
|
||||
|
||||
const SuncordContributorBadge: ProfileBadge = {
|
||||
description: "Suncord Contributor",
|
||||
image: SUNCORD_CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
shouldShow: ({ userId }) => isSuncordPluginDev(userId),
|
||||
onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId))
|
||||
};
|
||||
|
||||
let DonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
let EquicordDonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
let SuncordDonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
|
||||
async function loadBadges(url: string, noCache = false) {
|
||||
const init = {} as RequestInit;
|
||||
|
@ -75,11 +65,9 @@ async function loadBadges(url: string, noCache = false) {
|
|||
async function loadAllBadges(noCache = false) {
|
||||
const vencordBadges = await loadBadges("https://badges.vencord.dev/badges.json", noCache);
|
||||
const equicordBadges = await loadBadges("https://raw.githubusercontent.com/Equicord/Equibored/main/badges.json", noCache);
|
||||
const suncordBadges = await loadBadges("https://raw.githubusercontent.com/verticalsync/Suncord/main/src/assets/badges.json", noCache);
|
||||
|
||||
DonorBadges = vencordBadges;
|
||||
EquicordDonorBadges = equicordBadges;
|
||||
SuncordDonorBadges = suncordBadges;
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,7 +148,6 @@ export default definePlugin({
|
|||
async start() {
|
||||
Vencord.Api.Badges.addBadge(ContributorBadge);
|
||||
Vencord.Api.Badges.addBadge(EquicordContributorBadge);
|
||||
Vencord.Api.Badges.addBadge(SuncordContributorBadge);
|
||||
await loadAllBadges();
|
||||
},
|
||||
|
||||
|
@ -320,74 +307,5 @@ export default definePlugin({
|
|||
));
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
||||
getSuncordDonorBadges(userId: string) {
|
||||
return SuncordDonorBadges[userId]?.map(badge => ({
|
||||
image: badge.badge,
|
||||
description: badge.tooltip,
|
||||
position: BadgePosition.START,
|
||||
props: {
|
||||
style: {
|
||||
borderRadius: "50%",
|
||||
transform: "scale(0.9)" // The image is a bit too big compared to default badges
|
||||
}
|
||||
},
|
||||
onClick() {
|
||||
const modalKey = openModal(props => (
|
||||
<ErrorBoundary noop onError={() => {
|
||||
closeModal(modalKey);
|
||||
VencordNative.native.openExternal("https://github.com/sponsors/verticalsync");
|
||||
}}>
|
||||
<Modals.ModalRoot {...props}>
|
||||
<Modals.ModalHeader>
|
||||
<Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
<Forms.FormTitle
|
||||
tag="h2"
|
||||
style={{
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
margin: 0
|
||||
}}
|
||||
>
|
||||
<Heart />
|
||||
Suncord Donor
|
||||
</Forms.FormTitle>
|
||||
</Flex>
|
||||
</Modals.ModalHeader>
|
||||
<Modals.ModalContent>
|
||||
<Flex>
|
||||
<img
|
||||
role="presentation"
|
||||
src="https://cdn.discordapp.com/emojis/1026533070955872337.png"
|
||||
alt=""
|
||||
style={{ margin: "auto" }}
|
||||
/>
|
||||
<img
|
||||
role="presentation"
|
||||
src="https://cdn.discordapp.com/emojis/1026533090627174460.png"
|
||||
alt=""
|
||||
style={{ margin: "auto" }}
|
||||
/>
|
||||
</Flex>
|
||||
<div style={{ padding: "1em" }}>
|
||||
<Forms.FormText>
|
||||
This Badge is a special perk for Suncord Donors
|
||||
</Forms.FormText>
|
||||
<Forms.FormText className={Margins.top20}>
|
||||
Please consider supporting the development of Suncord by becoming a donor. It would mean a lot!!
|
||||
</Forms.FormText>
|
||||
</div>
|
||||
</Modals.ModalContent>
|
||||
<Modals.ModalFooter>
|
||||
<Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
<DonateButton />
|
||||
</Flex>
|
||||
</Modals.ModalFooter>
|
||||
</Modals.ModalRoot>
|
||||
</ErrorBoundary>
|
||||
));
|
||||
},
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -721,45 +721,6 @@ export const EquicordDevs = Object.freeze({
|
|||
},
|
||||
} satisfies Record<string, Dev>);
|
||||
|
||||
export const SuncordDevs = /* #__PURE__*/ Object.freeze({
|
||||
nyx: {
|
||||
name: "verticalsync",
|
||||
id: 328165170536775680n,
|
||||
},
|
||||
bhop: {
|
||||
name: "femeie",
|
||||
id: 442626774841556992n,
|
||||
},
|
||||
Drag: {
|
||||
name: "dragalt_",
|
||||
id: 1189903210564038697n,
|
||||
},
|
||||
Woosh: {
|
||||
name: "w00shh.",
|
||||
id: 689165844835860522n,
|
||||
},
|
||||
Cortex: {
|
||||
name: "Cortex",
|
||||
id: 825069530376044594n,
|
||||
},
|
||||
thororen: {
|
||||
name: "thororen",
|
||||
id: 848339671629299742n,
|
||||
},
|
||||
nexpid: {
|
||||
name: "Nexpid",
|
||||
id: 853550207039832084n,
|
||||
},
|
||||
KrystalSkull: {
|
||||
name: "krystalskullofficial",
|
||||
id: 929208515883569182n,
|
||||
},
|
||||
SerStars: {
|
||||
name: "SerStars",
|
||||
id: 861631850681729045n,
|
||||
},
|
||||
} satisfies Record<string, Dev>);
|
||||
|
||||
// iife so #__PURE__ works correctly
|
||||
export const VencordDevsById = /* #__PURE__*/ (() =>
|
||||
Object.freeze(Object.fromEntries(
|
||||
|
@ -776,11 +737,3 @@ export const EquicordDevsById = /* #__PURE__*/ (() =>
|
|||
.map(([_, v]) => [v.id, v] as const)
|
||||
))
|
||||
)() as Record<string, Dev>;
|
||||
|
||||
export const SuncordDevsById = /* #__PURE__*/ (() =>
|
||||
Object.freeze(Object.fromEntries(
|
||||
Object.entries(SuncordDevs)
|
||||
.filter(d => d[1].id !== 0n)
|
||||
.map(([_, v]) => [v.id, v] as const)
|
||||
))
|
||||
)() as Record<string, Dev>;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import { Clipboard, Toasts } from "@webpack/common";
|
||||
|
||||
import { EquicordDevsById, SuncordDevsById, VencordDevsById } from "./constants";
|
||||
import { EquicordDevsById, VencordDevsById } from "./constants";
|
||||
|
||||
/**
|
||||
* Calls .join(" ") on the arguments
|
||||
|
@ -96,7 +96,6 @@ export const isMobile = navigator.userAgent.includes("Mobi");
|
|||
|
||||
export const isPluginDev = (id: string) => Object.hasOwn(VencordDevsById, id);
|
||||
export const isEquicordPluginDev = (id: string) => Object.hasOwn(EquicordDevsById, id);
|
||||
export const isSuncordPluginDev = (id: string) => Object.hasOwn(SuncordDevsById, id);
|
||||
|
||||
export function pluralise(amount: number, singular: string, plural = singular + "s") {
|
||||
return amount === 1 ? `${amount} ${singular}` : `${amount} ${plural}`;
|
||||
|
|
Loading…
Add table
Reference in a new issue