diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 0aa8dba7..59b967c4 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -45,14 +45,16 @@ const settings = definePluginSettings({ } }); -export function buildSeveralUsers({ a, b, count }: { a: string, b: string, count: number; }) { - return [ - {a}, - ", ", - {b}, - `, and ${count} others are typing...` - ]; -} +export const buildSeveralUsers = ErrorBoundary.wrap(({ a, b, count }: { a: string, b: string, count: number; }) => { + return ( + <> + {a}, + ", ", + {b}, + `, and ${count} others are typing...` + + ); +}, { noop: true }); interface Props { user: User; @@ -96,11 +98,12 @@ export default definePlugin({ patches: [ { find: "#{intl::THREE_USERS_TYPING}", + group: true, replacement: [ { // Style the indicator and add function call to modify the children before rendering - match: /(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i(?<=guildId:(\i).+?)/, - replace: "$self.renderTypingUsers({ users: $1, guildId: $2, children: $& })" + match: /(?<=children:\[(\i)\.length>0.{0,300}?"aria-atomic":!0,children:)\i/, + replace: "$self.renderTypingUsers({ users: $1, guildId: arguments[0]?.channel?.guild_id, children: $& })" }, { // Changes the indicator to keep the user object when creating the list of typing users