Fixed regexes and readme

This commit is contained in:
Inbestigator 2024-06-27 11:46:00 -07:00
parent d7408bd486
commit f84099ab2d
2 changed files with 10 additions and 4 deletions

View file

@ -1,2 +1,8 @@
# BetterBanReasons
* Create custom reasons to use in the Discord ban modal.
* Show a text input by default instead of the options
![image](https://github.com/Vendicated/Vencord/assets/119569726/6227586b-43a2-4b05-9945-85995c3cb513)
![image](https://github.com/Vendicated/Vencord/assets/119569726/4aaaf5f1-6dc4-4844-b4a9-9b23cfb739e2)

View file

@ -75,12 +75,12 @@ export default definePlugin({
{
find: "Messages.BAN_MULTIPLE_CONFIRM_TITLE",
replacement: [{
match: /=\[[^]*?\]/,
replace: "=$self.getReasons()"
match: /\[\{name:\i\.\i\.Messages\.BAN_REASON_OPTION_SPAM_ACCOUNT.+?\}\]/,
replace: "$self.getReasons()"
},
{
match: /useState\(0\)/,
replace: "useState($self.isOtherDefault())"
match: /useState\(0\)(?=.{0,100}targetUserId:)/,
replace: "useState($self.isOtherDefault())$2"
}]
}
],