aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSupertiger <saawalkhn@googlemail.com>2023-05-12 01:58:53 +0100
committerGitHub <noreply@github.com>2023-05-12 00:58:53 +0000
commit63387a48ee1862ac192966a99db8036368b9a08f (patch)
tree5b513e9809498f9d2f82d5690bc08e358975a0db /src
parent3bb68467bb9dce53334125abef399caeab3180d3 (diff)
downloadVencord-63387a48ee1862ac192966a99db8036368b9a08f.tar.gz
Vencord-63387a48ee1862ac192966a99db8036368b9a08f.tar.bz2
Vencord-63387a48ee1862ac192966a99db8036368b9a08f.zip
silentMessageToggle: Add setting to disable auto disable (#1062)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/silentMessageToggle.tsx9
-rw-r--r--src/utils/constants.ts4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/silentMessageToggle.tsx b/src/plugins/silentMessageToggle.tsx
index f5be5ce..22d2c05 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 a10a0a5..b53c1d7 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
}
});