Fix AlwaysAnimate

This commit is contained in:
Nuckyz 2023-10-28 17:43:27 -03:00
parent 4b958d17fd
commit af135b9245
No known key found for this signature in database
GPG Key ID: 440BF8296E1C4AD9

View File

@ -21,16 +21,30 @@ import definePlugin from "@utils/types";
export default definePlugin({
name: "AlwaysAnimate",
description: "Animates anything that can be animated, besides status emojis.",
description: "Animates anything that can be animated",
authors: [Devs.FieryFlames],
patches: [
{
find: ".canAnimate",
find: "canAnimate:",
all: true,
// Some modules match the find but the replacement is returned untouched
noWarn: true,
replacement: {
match: /\.canAnimate\b/g,
replace: ".canAnimate || true"
match: /canAnimate:.+?(?=([,}].*?\)))/g,
replace: (m, rest) => {
const destructuringMatch = rest.match(/}=.+/);
if (destructuringMatch == null) return "canAnimate:!0";
return m;
}
}
},
{
// Status emojis
find: ".Messages.GUILD_OWNER,",
replacement: {
match: /(?<=\.activityEmoji,.+?animate:)\i/,
replace: "!0"
}
}
]