UserPFP: Dont set animated if not from img repo

This commit is contained in:
thororen1234 2026-06-14 20:46:54 -04:00
parent a75c31773e
commit da11b4ee27
No known key found for this signature in database

View file

@ -20,13 +20,14 @@ import { openInviteModal } from "@utils/discord";
import definePlugin, { OptionType } from "@utils/types";
import { User } from "@vencord/discord-types";
import { extractAndLoadChunksLazy } from "@webpack";
import { IconUtils, Menu, openModal,UserStore } from "@webpack/common";
import { IconUtils, Menu, openModal, UserStore } from "@webpack/common";
import { SetAvatarModal } from "./AvatarModal";
const cl = classNameFactory("vc-userpfp-");
const DONO_URL = "https://ko-fi.com/coolesding";
const INVITE_LINK = "userpfp-1129784704267210844";
const USERPFP_IMG_URL = "https://raw.githubusercontent.com/UserPFP/img";
export const requireSettingsModal = extractAndLoadChunksLazy(['type:"USER_SETTINGS_MODAL_OPEN"']);
export const KEY_DATASTORE = "vencord-custom-avatars";
@ -135,9 +136,11 @@ export default definePlugin({
try {
const res = new URL(avatarUrl);
res.searchParams.set("animated", animated ? "true" : "false");
if (!animated) {
res.pathname = res.pathname.replaceAll(/\.gifv?/g, ".png");
if (avatarUrl.startsWith(USERPFP_IMG_URL)) {
res.searchParams.set("animated", animated ? "true" : "false");
if (!animated) {
res.pathname = res.pathname.replaceAll(/\.gifv?/g, ".png");
}
}
return res.toString();
} catch {