mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 00:36:23 +00:00
make plugin
This commit is contained in:
parent
7be3a40b7c
commit
7f53657a1c
2 changed files with 43 additions and 0 deletions
7
src/plugins/fixedForumTags/README.md
Normal file
7
src/plugins/fixedForumTags/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Fixed Forum Tags
|
||||
|
||||
Discord only allows you to filter by non-moderated tags in the overflow menu, this fixes that allowing you to filter by all tags
|
||||
|
||||
## Before Fixed Forum Tags
|
||||
|
||||
## After Fixed Forum Tags
|
36
src/plugins/fixedForumTags/index.ts
Normal file
36
src/plugins/fixedForumTags/index.ts
Normal file
|
@ -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 moderated forum tags",
|
||||
|
||||
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: "2023-01_forums_non_community",
|
||||
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"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
Loading…
Reference in a new issue