diff --git a/src/plugins/silentMessageToggle.tsx b/src/plugins/silentMessageToggle.tsx index f5be5ceb..22d2c054 100644 --- a/src/plugins/silentMessageToggle.tsx +++ b/src/plugins/silentMessageToggle.tsx @@ -33,6 +33,11 @@ const settings = definePluginSettings({ onChange(newValue: boolean) { if (newValue === false) lastState = false; } + }, + autoDisable: { + type: OptionType.BOOLEAN, + description: "Automatically disable the silent message toggle again after sending one", + default: true } }); @@ -51,7 +56,7 @@ function SilentMessageToggle(chatBoxProps: { React.useEffect(() => { const listener: SendListener = (_, message) => { if (enabled) { - setEnabledValue(false); + if (settings.store.autoDisable) setEnabledValue(false); if (!message.content.startsWith("@silent ")) message.content = "@silent " + message.content; } }; @@ -96,7 +101,7 @@ function SilentMessageToggle(chatBoxProps: { export default definePlugin({ name: "SilentMessageToggle", - authors: [Devs.Nuckyz], + authors: [Devs.Nuckyz, Devs.CatNoir], description: "Adds a button to the chat bar to toggle sending a silent message.", dependencies: ["MessageEventsAPI"], diff --git a/src/utils/constants.ts b/src/utils/constants.ts index a10a0a58..b53c1d7c 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -286,5 +286,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({ carince: { name: "carince", id: 818323528755314698n + }, + CatNoir: { + name: "CatNoir", + id: 260371016348336128n } });