diff --git a/src/plugins/invisibleChat.desktop/index.tsx b/src/plugins/invisibleChat.desktop/index.tsx index 58fccb9..e55f1e0 100644 --- a/src/plugins/invisibleChat.desktop/index.tsx +++ b/src/plugins/invisibleChat.desktop/index.tsx @@ -136,10 +136,10 @@ export default definePlugin({ } }, { - find: ".activeCommandOption", + find: "ChannelTextAreaButtons", replacement: { - match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } }, ], diff --git a/src/plugins/previewMessage/index.tsx b/src/plugins/previewMessage/index.tsx index 393b520..bc67511 100644 --- a/src/plugins/previewMessage/index.tsx +++ b/src/plugins/previewMessage/index.tsx @@ -129,10 +129,10 @@ export default definePlugin({ authors: [Devs.Aria], patches: [ { - find: ".activeCommandOption", + find: "ChannelTextAreaButtons", replacement: { - match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.unshift($self.previewIcon(arguments[0]))}catch{}", + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } }, ], diff --git a/src/plugins/sendTimestamps/index.tsx b/src/plugins/sendTimestamps/index.tsx index a69dbac..7904545 100644 --- a/src/plugins/sendTimestamps/index.tsx +++ b/src/plugins/sendTimestamps/index.tsx @@ -121,10 +121,10 @@ export default definePlugin({ patches: [ { - find: ".activeCommandOption", + find: "ChannelTextAreaButtons", replacement: { - match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } }, ], diff --git a/src/plugins/silentMessageToggle/index.tsx b/src/plugins/silentMessageToggle/index.tsx index 22d2c05..a1ee8de 100644 --- a/src/plugins/silentMessageToggle/index.tsx +++ b/src/plugins/silentMessageToggle/index.tsx @@ -108,13 +108,13 @@ export default definePlugin({ settings, patches: [ { - find: ".activeCommandOption", + find: "ChannelTextAreaButtons", replacement: { - match: /"gift"\)\);(?<=(\i)\.push.+?disabled:(\i),.+?)/, - replace: (m, array, disabled) => `${m};try{${disabled}||${array}.push($self.SilentMessageToggle(arguments[0]));}catch{}` + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } - } + }, ], - SilentMessageToggle: ErrorBoundary.wrap(SilentMessageToggle, { noop: true }), + chatBarIcon: ErrorBoundary.wrap(SilentMessageToggle, { noop: true }), }); diff --git a/src/plugins/silentTyping/index.tsx b/src/plugins/silentTyping/index.tsx index d4cb27b..031db09 100644 --- a/src/plugins/silentTyping/index.tsx +++ b/src/plugins/silentTyping/index.tsx @@ -85,11 +85,10 @@ export default definePlugin({ } }, { - find: ".activeCommandOption", - predicate: () => settings.store.showIcon, + find: "ChannelTextAreaButtons", replacement: { - match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } }, ], diff --git a/src/plugins/translate/index.tsx b/src/plugins/translate/index.tsx index 3007032..3b067c6 100644 --- a/src/plugins/translate/index.tsx +++ b/src/plugins/translate/index.tsx @@ -62,10 +62,10 @@ export default definePlugin({ patches: [ { - find: ".activeCommandOption", + find: "ChannelTextAreaButtons", replacement: { - match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", + match: /(\i)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, + replace: "$&,(()=>{try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}})()", } }, ],