diff options
author | Vendicated <vendicated@riseup.net> | 2023-05-02 04:39:27 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2023-05-02 04:39:27 +0200 |
commit | bd95a25f4c111c3d0e2564fb1bfcf5b8e12e87de (patch) | |
tree | 9c54f5ca03add94a0713518ec56b85214600df35 /src | |
parent | 6a57ecc22b1b86a5725ff09204ace7765c702235 (diff) | |
download | Vencord-bd95a25f4c111c3d0e2564fb1bfcf5b8e12e87de.tar.gz Vencord-bd95a25f4c111c3d0e2564fb1bfcf5b8e12e87de.tar.bz2 Vencord-bd95a25f4c111c3d0e2564fb1bfcf5b8e12e87de.zip |
TextReplace: Do not apply rules in #textreplace-rules channel
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/textReplace.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/textReplace.tsx b/src/plugins/textReplace.tsx index ea5f34d..431b129 100644 --- a/src/plugins/textReplace.tsx +++ b/src/plugins/textReplace.tsx @@ -191,6 +191,8 @@ function TextReplace({ title, rulesArray, rulesKey }: TextReplaceProps) { ); } +const TEXT_REPLACE_RULES_CHANNEL_ID = "1102784112584040479"; + export default definePlugin({ name: "TextReplace", description: "Replace text in your messages. You can find pre-made rules in the #textreplace-rules channel in the Vencord Server", @@ -203,7 +205,10 @@ export default definePlugin({ stringRules = await DataStore.get(STRING_RULES_KEY) ?? makeEmptyRuleArray(); regexRules = await DataStore.get(REGEX_RULES_KEY) ?? makeEmptyRuleArray(); - this.preSend = addPreSendListener((_, msg) => { + this.preSend = addPreSendListener((channelId, msg) => { + // Channel used for sharing rules, applying rules here would be messy + if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return; + // pad so that rules can use " word " to only match whole "word" msg.content = " " + msg.content + " "; |