diff options
author | Nick <nwowens32@gmail.com> | 2023-01-31 00:35:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 06:35:52 +0100 |
commit | 8f4e8d0a9bd29b59cd9ea4e3228fd1b3e73fbfd9 (patch) | |
tree | c834659835c967db733192d05d5d7b594744f651 | |
parent | 62f7e4d45c0aa7bdbedecd639e51e6f2446fcc2b (diff) | |
download | Vencord-8f4e8d0a9bd29b59cd9ea4e3228fd1b3e73fbfd9.tar.gz Vencord-8f4e8d0a9bd29b59cd9ea4e3228fd1b3e73fbfd9.tar.bz2 Vencord-8f4e8d0a9bd29b59cd9ea4e3228fd1b3e73fbfd9.zip |
TypingTweaks: fix crash on non en-US locales (#463)
-rw-r--r-- | src/plugins/typingTweaks.tsx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/typingTweaks.tsx b/src/plugins/typingTweaks.tsx index bc18831..96c04b9 100644 --- a/src/plugins/typingTweaks.tsx +++ b/src/plugins/typingTweaks.tsx @@ -66,10 +66,18 @@ export default definePlugin({ }, // Changes indicator to format message with the typing users { - find: ',"SEVERAL_USERS_TYPING","', + find: '"SEVERAL_USERS_TYPING":"', replacement: { - match: /(\i)\((\i),"SEVERAL_USERS_TYPING",".+?"\)/, - replace: "$1($2,\"SEVERAL_USERS_TYPING\",\"**!!{a}!!**, **!!{b}!!**, and {c} others are typing...\")" + match: /("SEVERAL_USERS_TYPING"):".+?"/, + replace: "$1:\"**!!{a}!!**, **!!{b}!!**, and {c} others are typing...\"" + }, + predicate: () => settings.store.alternativeFormatting + }, + { + find: ",\"SEVERAL_USERS_TYPING\",\"", + replacement: { + match: /(\i)\((\i),("SEVERAL_USERS_TYPING"),".+?"\)/, + replace: "$1($2,$3,\"**!!{a}!!**, **!!{b}!!**, and {c} others are typing...\")" }, predicate: () => settings.store.alternativeFormatting }, @@ -78,7 +86,7 @@ export default definePlugin({ find: "getCooldownTextStyle", replacement: { match: /(\i)\.length\?.\..\.Messages\.THREE_USERS_TYPING.format\(\{a:(\i),b:(\i),c:.}\).+?SEVERAL_USERS_TYPING/, - replace: "$&.format({a:$2,b:$3,c:$1.length})" + replace: "$&.format({a:$2,b:$3,c:$1.length-2})" }, predicate: () => settings.store.alternativeFormatting } @@ -105,7 +113,7 @@ export default definePlugin({ size={Avatar.Sizes.SIZE_16} src={user.getAvatarURL(guildId, 128)}/> </div>} - {user.username} + {GuildMemberStore.getNick(guildId!, user.id) || user.username} </strong>; }, { noop: true }) }); |