Plugin
SuperReactionTweaks
Customize the limit of Super Reactions playing at once, and super react by default
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { definePluginSettings } from "@api/Settings";8
import { Devs } from "@utils/constants";9
import definePlugin, { OptionType } from "@utils/types";10
import { UserStore } from "@webpack/common";11
12
export const settings = definePluginSettings({13
superReactByDefault: {14
type: OptionType.BOOLEAN,15
description: "Reaction picker will default to Super Reactions",16
default: true,17
},18
unlimitedSuperReactionPlaying: {19
type: OptionType.BOOLEAN,20
description: "Remove the limit on Super Reactions playing at once",21
default: false,22
},23
24
superReactionPlayingLimit: {25
description: "Max Super Reactions to play at once. 0 to disable playing Super Reactions",26
type: OptionType.SLIDER,27
default: 20,28
markers: [0, 5, 10, 20, 40, 60, 80, 100],29
stickToMarkers: true,30
},31
}, {32
superReactionPlayingLimit: {33
disabled() { return this.store.unlimitedSuperReactionPlaying; },34
}35
});36
37
export default definePlugin({38
name: "SuperReactionTweaks",39
description: "Customize the limit of Super Reactions playing at once, and super react by default",40
tags: ["Reactions", "Emotes"],41
authors: [Devs.FieryFlames, Devs.ant0n],42
patches: [43
{44
find: ",BURST_REACTION_EFFECT_PLAY",45
replacement: [46
{47
// if (inlinedCalculatePlayingCount(a,b) >= limit) return;48
match: /(BURST_REACTION_EFFECT_PLAY:\i=>{.+?if\()(\(\(\i,\i\)=>.+?\(\i,\i\))>=5+?(?=\))/,49
replace: (_, rest, playingCount) => `${rest}!$self.shouldPlayBurstReaction(${playingCount})`50
}51
]52
},53
{54
find: ".EMOJI_PICKER_CONSTANTS_EMOJI_CONTAINER_PADDING_HORIZONTAL)",55
replacement: {56
match: /(openPopoutType:void 0(?=.+?isBurstReaction:(\i).+?;(\i===\i\.\i\.REACTION)&&\i\.push\().+?\[\2,\i\]=\i\.useState\()!1\)/,57
replace: (_, rest, _isBurstReactionVariable, isReactionIntention) => `${rest}$self.shouldSuperReactByDefault&&${isReactionIntention})`58
}59
}60
],61
settings,62
63
shouldPlayBurstReaction(playingCount: number) {64
if (settings.store.unlimitedSuperReactionPlaying) return true;65
if (settings.store.superReactionPlayingLimit > playingCount) return true;66
return false;67
},68
69
get shouldSuperReactByDefault() {70
return settings.store.superReactByDefault && UserStore.getCurrentUser().premiumType != null;71
}72
});73