mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 20:55:13 +00:00
HideAttachments: support bot components v2 (#3944)
This commit is contained in:
parent
0799be1b62
commit
1515319b96
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ const saveHiddenMessages = (ids: Set<string>) => 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:$&"
|
||||
}
|
||||
}],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue