This commit is contained in:
thororen 2024-04-17 14:29:47 -04:00
parent 538b87062a
commit ea7451bcdc
326 changed files with 24876 additions and 2280 deletions

View file

@ -28,10 +28,10 @@ import { closeModal, Modals, openModal } from "@utils/modal";
import definePlugin from "@utils/types";
import { Forms, Toasts } from "@webpack/common";
const CONTRIBUTOR_BADGE = "https://vencord.dev/assets/favicon.png";
const CONTRIBUTOR_BADGE = "https://i.imgur.com/OypoHrV.png";
const ContributorBadge: ProfileBadge = {
description: "Vencord Contributor",
description: "Vencord/Equicord Contributor",
image: CONTRIBUTOR_BADGE,
position: BadgePosition.START,
props: {
@ -41,20 +41,26 @@ const ContributorBadge: ProfileBadge = {
}
},
shouldShow: ({ user }) => isPluginDev(user.id),
link: "https://github.com/Vendicated/Vencord"
link: "https://github.com/sponsors/vendicated"
};
let DonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
async function loadBadges(noCache = false) {
DonorBadges = {};
const init = {} as RequestInit;
if (noCache)
init.cache = "no-cache";
DonorBadges = await fetch("https://badges.vencord.dev/badges.json", init)
const one = await fetch("https://badges.vencord.dev/badges.json", init)
.then(r => r.json());
const two = await fetch("https://raw.githubusercontent.com/Equicord/Ignore/main/badges.json", init)
.then(r => r.json());
DonorBadges = { ...one, ...two };
}
export default definePlugin({
@ -128,7 +134,7 @@ export default definePlugin({
const modalKey = openModal(props => (
<ErrorBoundary noop onError={() => {
closeModal(modalKey);
VencordNative.native.openExternal("https://github.com/sponsors/Vendicated");
VencordNative.native.openExternal("https://patreon.com/equicord");
}}>
<Modals.ModalRoot {...props}>
<Modals.ModalHeader>
@ -142,7 +148,7 @@ export default definePlugin({
}}
>
<Heart />
Vencord Donor
Equicord Donor
</Forms.FormTitle>
</Flex>
</Modals.ModalHeader>
@ -163,10 +169,10 @@ export default definePlugin({
</Flex>
<div style={{ padding: "1em" }}>
<Forms.FormText>
This Badge is a special perk for Vencord Donors
This Badge is a special perk for Equicord Donors
</Forms.FormText>
<Forms.FormText className={Margins.top20}>
Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!
Please consider supporting the development of Equicord by becoming a donor. It would mean a lot!
</Forms.FormText>
</div>
</Modals.ModalContent>

View file

@ -13,10 +13,10 @@ export default definePlugin({
authors: [Devs.Ven],
patches: [{
find: '"sticker")',
find: '"gift")),(null',
replacement: {
match: /!\i\.isMobile(?=.+?(\i)\.push\(.{0,50}"gift")/,
replace: "$& &&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),true)"
match: /!\i\.isMobile&&(?=\(\i\.isDM.+?&&(\i)\.push\(.{0,50}"gift")/,
replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),!0)&&"
}
}]
});

View file

@ -27,9 +27,9 @@ export default definePlugin({
{
find: ".Messages.EDIT_TEXTAREA_HELP",
replacement: {
match: /(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/,
replace: (match, args) => "" +
`async ${match}` +
match: /(shouldRefocus:!1.+?value:\i,channel:\i}\)\.then\()(.+?)(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/,
replace: (_, rest1, rest2, args) => "" +
`${rest1}async ${rest2}` +
`if(await Vencord.Api.MessageEvents._handlePreEdit(${args}))` +
"return Promise.resolve({shoudClear:true,shouldRefocus:true});"
}