From 1515319b96d43d87ef560968485df6152e3c7963 Mon Sep 17 00:00:00 2001 From: MrCRACK <83436855+MrCRACKDev@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:05:23 -0500 Subject: [PATCH] HideAttachments: support bot components v2 (#3944) --- src/plugins/hideAttachments/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/hideAttachments/index.tsx b/src/plugins/hideAttachments/index.tsx index c5a1bbc0..0895ec86 100644 --- a/src/plugins/hideAttachments/index.tsx +++ b/src/plugins/hideAttachments/index.tsx @@ -41,7 +41,7 @@ const saveHiddenMessages = (ids: Set) => set(KEY, ids); migratePluginSettings("HideMedia", "HideAttachments"); -const hasMedia = (msg: Message) => msg.attachments.length > 0 || msg.embeds.length > 0 || msg.stickerItems.length > 0; +const hasMedia = (msg: Message) => msg.attachments.length > 0 || msg.embeds.length > 0 || msg.stickerItems.length > 0 || msg.components.length > 0; async function toggleHide(channelId: string, messageId: string) { const ids = await getHiddenMessages(); @@ -61,7 +61,7 @@ export default definePlugin({ patches: [{ find: "this.renderAttachments(", replacement: { - match: /(?<=\i=)this\.render(?:Attachments|Embeds|StickersAccessories)\((\i)\)/g, + match: /(?<=\i=)this\.render(?:Attachments|Embeds|StickersAccessories|ComponentAccessories)\((\i)\)/g, replace: "$self.shouldHide($1?.id)?null:$&" } }],