Merge branch 'master' of ssh://gitea.calebfontenot.com:25566/CCF_100/NoMoreAcronyms
This commit is contained in:
commit
a6d4bff89c
7
main.ts
7
main.ts
@ -94,12 +94,17 @@ function matchAbbr(abbrTarget) {
|
|||||||
|
|
||||||
function replyMessage(message, correctedMessage, abbrsUsed) {
|
function replyMessage(message, correctedMessage, abbrsUsed) {
|
||||||
var plural = "";
|
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) {
|
if (abbrsUsed == 1) {
|
||||||
plural = "an acronym";
|
plural = "an acronym";
|
||||||
} else {
|
} else {
|
||||||
plural = abbrsUsed + " acronyms"
|
plural = abbrsUsed + " acronyms"
|
||||||
}
|
}
|
||||||
message.reply({content: "Your message contains " + plural + "! Let me fix that for you: \n > " + correctedMessage + "\n \n \|\|btw I was written by Caleb Fontenot\|\|", allowedMentions: { repliedUser: false }});
|
if (stringLength > 2000) {
|
||||||
|
replyString = "Sorry, I detected " + plural + "but the resultant response was " + stringLength + " characters long, and Discord only allows a maximum of 2000."
|
||||||
|
}
|
||||||
|
message.reply({content: replyString, allowedMentions: { repliedUser: false }});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user