Skip to content

Commit 9e30dba

Browse files
authored
Merge pull request #17 from clairefro/strengthen-spam-check
Strengthen spam check
2 parents 72b01ba + 5c39112 commit 9e30dba

File tree

2 files changed

+176
-166
lines changed

2 files changed

+176
-166
lines changed

src/util/isSuspiciousLink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { distance } from "fastest-levenshtein";
33
/** Most spam links try to typosquat 'discord' to trick users into thinking the link is safe (ex: "discorde")*/
44
const TYPOSQUAT_TARGET = "discord";
55

6-
function isSuspiciousLink(link, threshold = 3) {
6+
function isSuspiciousLink(link, threshold = 4) {
77
// get base domain
88
const matches = link.match(/^https?:\/\/(\S+?)\./);
99
if (!matches) return;

0 commit comments

Comments
 (0)