1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-09 17:36:23 +00:00

use DefinePluginSettings

This commit is contained in:
jamesbt365 2025-01-06 02:42:51 +00:00
parent ea5a750acb
commit 2759626c56
No known key found for this signature in database
GPG key ID: B375A092448F9102

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Settings } from "@api/Settings";
import { definePluginSettings, Settings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { runtimeHashMessageKey } from "@utils/intlHash";
import { Logger } from "@utils/Logger";
@ -32,10 +32,27 @@ interface MessageDeleteProps {
collapsedReason: () => any;
}
const settings = definePluginSettings({
ignoreBlockedMessages: {
description: "Completely ignores (recent) incoming messages from blocked users (locally).",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true,
},
ignoreIgnoredMessages: {
description: "Additionally apply to 'ignored' users.",
type: OptionType.BOOLEAN,
default: true,
restartNeeded: false,
},
});
export default definePlugin({
name: "NoBlockedMessages",
description: "Hides all blocked/ignored messages from chat completely.",
authors: [Devs.rushii, Devs.Samu, Devs.jamesbt365],
settings,
patches: [
{
find: "#{intl::BLOCKED_MESSAGES_HIDE}",
@ -60,21 +77,6 @@ export default definePlugin({
]
}))
],
options: {
ignoreBlockedMessages: {
description: "Completely ignores (recent) incoming messages from blocked users (locally).",
type: OptionType.BOOLEAN,
default: false,
restartNeeded: true,
},
ignoreIgnoredMessages: {
description: "Additionally apply to 'ignored' users.",
type: OptionType.BOOLEAN,
default: true,
restartNeeded: false,
},
},
shouldIgnoreMessage(message: Message) {
try {