Fix AlwaysAnimate
This commit is contained in:
parent
4b958d17fd
commit
af135b9245
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user