This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* BACK UP YOUR CODE | |
//* Copyright 2022, Morgan Finney | |
//* MIT License, http://www.opensource.org/licenses/mit-license.php | |
//* Limitations | |
//* - Only one folder can be updated at a time, change the m_Folder variable to choose the folder to target. | |
//* - Fails if there is a comma , in the title or the body of the field, | |
//* fields that fail will be commented with v14FLAG above, you can then search and update them manually. | |
//* - This will create multiple .addFields per embed and will not condense them down to one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
var m_TLDs; | |
module.exports = { | |
CheckMessage: async function(a_MessageReceived) { | |
const l_MessageContent = a_MessageReceived.cleanContent.toLowerCase(); | |
const l_URLRegex = /([a-zA-Z\d]+:\/\/)?((\w+:\w+@)?([a-zA-Z\d.-]+\.[A-Za-z]{2,4})(:\d+)?(\/.*)?)/ig; | |
const l_DetectedURLs = l_MessageContent.match(l_URLRegex); | |
if (!l_DetectedURLs) | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
ReplaceConfusables: async function(a_String) { | |
return await DoReplaceConfusables(a_String); | |
} | |
}; | |
async function DoReplaceConfusables(a_String) { | |
var l_ConfusablesToAlphanumericMap = [ | |
{ 'alphanumeric': 'A', 'confusables': /[\u{1D538}\u{1D434}\u5342\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/ug }, | |
{ 'alphanumeric': 'AA', 'confusables': /[\uA732]/ug }, |