From 2759626c5625974e0b7d81927ac32f2524fe7b81 Mon Sep 17 00:00:00 2001 From: jamesbt365 Date: Mon, 6 Jan 2025 02:42:51 +0000 Subject: [PATCH] use DefinePluginSettings --- src/plugins/noBlockedMessages/index.ts | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index e4226d306..1c01b496f 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -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 {