3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 23:55:02 +00:00

automod: only match highlighted links in match_links by default

This commit is contained in:
Dragory 2020-04-17 23:28:09 +03:00
parent 96a59d4ca7
commit 301ea2f122
2 changed files with 7 additions and 0 deletions

View file

@ -116,6 +116,7 @@ const defaultMatchLinksTrigger: Partial<TMatchLinksTrigger> = {
match_usernames: false,
match_nicknames: false,
match_custom_status: false,
only_real_links: true,
};
const defaultMatchAttachmentTypeTrigger: Partial<TMatchAttachmentTypeTrigger> = {
@ -456,6 +457,11 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
const links = getUrlsInString(str, true);
for (const link of links) {
// "real link" = a link that Discord highlights
if (trigger.only_real_links && !link.input.match(/^https?:\/\//i)) {
continue;
}
const normalizedHostname = link.hostname.toLowerCase();
// Exclude > Include