From 0350db76908d847d14a863fbd7bdf8f282cf6395 Mon Sep 17 00:00:00 2001 From: Kyuuhachi <1547062+Kyuuhachi@users.noreply.github.com> Date: Fri, 3 May 2024 22:42:14 +0200 Subject: [PATCH] feat(plugin): ImageLink (#2297) --- src/plugins/imageLink/README.md | 3 +++ src/plugins/imageLink/index.ts | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/plugins/imageLink/README.md create mode 100644 src/plugins/imageLink/index.ts diff --git a/src/plugins/imageLink/README.md b/src/plugins/imageLink/README.md new file mode 100644 index 0000000..add6579 --- /dev/null +++ b/src/plugins/imageLink/README.md @@ -0,0 +1,3 @@ +# ImageLink + +If a message consists of only a link to an image, Discord hides the link and shows only the image embed. This plugin makes the link show regardless. diff --git a/src/plugins/imageLink/index.ts b/src/plugins/imageLink/index.ts new file mode 100644 index 0000000..73a977f --- /dev/null +++ b/src/plugins/imageLink/index.ts @@ -0,0 +1,24 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "ImageLink", + description: "Never hide image links in messages, even if it's the only content", + authors: [Devs.Kyuuhachi], + + patches: [ + { + find: "isEmbedInline:function()", + replacement: { + match: /(?<=isEmbedInline:function\(\)\{return )\i(?=\})/, + replace: "()=>false", + }, + }, + ], +});