let lastWord = sentence
.split(" ")
.slice(-1)[0]
- .replaceAll(/(\s)?([^\x41-\x5A\s^\x61-\x7A^\xC0-\xFF])/g, "");
+ .replaceAll(/(\s)?([^\x41-\x5A\s^\x61-\x7A^\xC0-\xFF])/g, "")
+ .replaceAll(/(?:https?|ftp):\/\/[\n\S]+/g, '');
return lastWord;
};
try {
// Get the completed word found by the db.
- let response = await completeWord(cutWord(message.content));
+ let response = await completeWord(cutWord(message.cleanContent));
// Ignore if there is no completion
if ((response || response === "") && Math.random() > 0.6) {