diff --git a/src/plugins/fixedForumTags/README.md b/src/plugins/fixedForumTags/README.md new file mode 100644 index 0000000000..0b5ec1fdc3 --- /dev/null +++ b/src/plugins/fixedForumTags/README.md @@ -0,0 +1,12 @@ +# Fixed Forum Tags + +Discord only allows you to filter by tags that you can add in the overflow menu, this fixes that allowing you to filter by all tags + +## Before Fixed Forum Tags + +![image](https://github.com/user-attachments/assets/56d48771-8ca4-4554-9c97-fe5b97a3528f) + + +## After Fixed Forum Tags + +![image](https://github.com/user-attachments/assets/c5fc3349-d998-448f-a6e2-130327128df4) diff --git a/src/plugins/fixedForumTags/index.ts b/src/plugins/fixedForumTags/index.ts new file mode 100644 index 0000000000..cc34a5f9db --- /dev/null +++ b/src/plugins/fixedForumTags/index.ts @@ -0,0 +1,36 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 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: "FixedForumTags", + authors: [Devs.sadan], + description: "Allows you to search and filter by all forum tags, even those that only moderators can add", + + patches: [ + // shows overflow forum tags only when second arg is true (orig func only takes one arg) + // we need to filter with a second arg because this func is also used for adding tags when posting + { + find: ':"REQUEST_FORUM_UNREADS"', + replacement: { + match: /(?=!\i.moderated)/, + replace: "arguments[1]||" + } + }, + // patches the dropdown menu where overflow forum tags are listed, + // sets the second parameter to true to not ignore moderated forum tags + { + find: "\"-all-tags-dropdown-navigator\"", + replacement: { + match: /((\i)=\(0,\i\.\i\)\(\i)(\))(?=.*children:\2\.map\()/, + replace: "$1,true$3" + } + } + ] +});