aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
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/plugins
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/plugins')
-rw-r--r--src/plugins/silentMessageToggle.tsx9
1 files changed, 7 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"],