diff --git a/src/api/MessagePopover.tsx b/src/api/MessagePopover.tsx
index 45471649..0a4a0540 100644
--- a/src/api/MessagePopover.tsx
+++ b/src/api/MessagePopover.tsx
@@ -16,9 +16,10 @@
* along with this program. If not, see .
*/
+import ErrorBoundary from "@components/ErrorBoundary";
import { Logger } from "@utils/Logger";
import { Channel, Message } from "discord-types/general";
-import type { ComponentType, MouseEventHandler, ReactElement } from "react";
+import type { ComponentType, MouseEventHandler } from "react";
const logger = new Logger("MessagePopover");
@@ -48,22 +49,26 @@ export function removeButton(identifier: string) {
}
export function _buildPopoverElements(
- msg: Message,
- PopoverButton: ComponentType,
+ Component: React.ComponentType,
+ props: { message: Message; }
) {
- const items = [] as ReactElement[];
+ const items: React.ReactNode[] = [];
for (const [identifier, getItem] of buttons.entries()) {
try {
- const item = getItem(msg);
+ const item = getItem(props.message);
if (item) {
item.key ??= identifier;
- items.push();
+ items.push(
+
+
+
+ );
}
} catch (err) {
logger.error(`[${identifier}]`, err);
}
}
- return items;
+ return <>{items}>;
}
diff --git a/src/plugins/_api/messagePopover.ts b/src/plugins/_api/messagePopover.ts
index d29b9b2d..9998a46b 100644
--- a/src/plugins/_api/messagePopover.ts
+++ b/src/plugins/_api/messagePopover.ts
@@ -26,8 +26,9 @@ export default definePlugin({
patches: [{
find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL",
replacement: {
- match: /"reply-self".+?Fragment,{children:\[(?=.+?\((\i\.\i),{label:)(?<=message:(\i).+?)/,
- replace: (m, PopoverButton, msg) => `${m}...Vencord.Api.MessagePopover._buildPopoverElements(${msg},${PopoverButton}),`
+ // foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))
+ match: /\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?\(0,\i\.jsx\)\((\i\.\i).{0,200}\.\.\.(\i)\},"reply-other"/,
+ replace: "Vencord.Api.MessagePopover._buildPopoverElements($1,$2),$&"
}
}],
});