Add more chars to regex
This commit is contained in:
parent
fd90b28b6b
commit
dd5f9a8bd2
6
main.ts
6
main.ts
@ -93,7 +93,7 @@ function matchAbbr(abbrTarget) {
|
||||
}
|
||||
|
||||
function replyMessage(message, correctedMessage) {
|
||||
message.reply("Your message contains an acronym! Let me fix that for you: \n `" + correctedMessage + "`");
|
||||
message.reply("Your message contains an acronym! Let me fix that for you: \n >" + correctedMessage);
|
||||
}
|
||||
|
||||
client.on('messageCreate', message => {
|
||||
@ -101,13 +101,13 @@ client.on('messageCreate', message => {
|
||||
if (message.author.bot) {
|
||||
return;
|
||||
}
|
||||
var matchMessageArray = message.content.toLowerCase().split(/[ ,!@#$%^&*()]+/);
|
||||
var matchMessageArray = message.content.toLowerCase().split(/[ ,!@#$%^&*().;:|\\\]\[\{\}]]+/);
|
||||
|
||||
console.log(matchMessageArray);
|
||||
let correctedMessage = message.content;
|
||||
let matchDetected = false;
|
||||
for (let i = 0; i < matchMessageArray.length; ++i) {
|
||||
console.log("Corrected Message: " + correctedMessage);
|
||||
//console.log("Corrected Message: " + correctedMessage);
|
||||
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
||||
matchDetected = true;
|
||||
//Return key
|
||||
|
Loading…
Reference in New Issue
Block a user