That if statement needs to be before its usage in replyString

master
Chloe Fontenot 🏳️‍⚧️ 2023-04-04 18:01:12 +07:00
parent 7b0806f018
commit 7827d1e63a
1 changed files with 3 additions and 2 deletions

@ -94,13 +94,14 @@ function matchAbbr(abbrTarget) {
function replyMessage(message, correctedMessage, abbrsUsed) {
var plural = "";
var replyString = "Your message contains " + plural + "! Let me fix that for you: \n > " + correctedMessage + "\n \n \|\|btw I was written by Caleb Fontenot\|\|"
var stringLength = replyString.length;
if (abbrsUsed == 1) {
plural = "an acronym";
} else {
plural = abbrsUsed + " acronyms"
}
var replyString = "Your message contains " + plural + "! Let me fix that for you: \n > " + correctedMessage + "\n \n \|\|btw I was written by Caleb Fontenot\|\|"
var stringLength = replyString.length;
if (stringLength > 2000) {
replyString = "Sorry, I detected " + plural + ", but the resultant response was " + stringLength + " characters long, and Discord only allows a maximum of 2000."
}