mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-16 02:55:03 +00:00
feat: replace Phisherman with FishFish
This commit is contained in:
parent
bf08cade15
commit
8c2058821f
13 changed files with 202 additions and 475 deletions
|
@ -1,11 +1,10 @@
|
|||
import { escapeInlineCode } from "discord.js";
|
||||
import z from "zod/v4";
|
||||
import { allowTimeout } from "../../../RegExpRunner.js";
|
||||
import { phishermanDomainIsSafe } from "../../../data/Phisherman.js";
|
||||
import { getFishFishDomain } from "../../../data/FishFish.js";
|
||||
import { getUrlsInString, zRegex } from "../../../utils.js";
|
||||
import { mergeRegexes } from "../../../utils/mergeRegexes.js";
|
||||
import { mergeWordsIntoRegex } from "../../../utils/mergeWordsIntoRegex.js";
|
||||
import { PhishermanPlugin } from "../../Phisherman/PhishermanPlugin.js";
|
||||
import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary.js";
|
||||
import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage.js";
|
||||
import { automodTrigger } from "../helpers.js";
|
||||
|
@ -40,6 +39,7 @@ const configSchema = z.strictObject({
|
|||
include_verified: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
include_malicious: z.boolean().default(false),
|
||||
only_real_links: z.boolean().default(true),
|
||||
match_messages: z.boolean().default(true),
|
||||
match_embeds: z.boolean().default(true),
|
||||
|
@ -155,22 +155,18 @@ export const MatchLinksTrigger = automodTrigger<MatchResultType>()({
|
|||
}
|
||||
}
|
||||
|
||||
if (trigger.phisherman) {
|
||||
const phishermanResult = await pluginData.getPlugin(PhishermanPlugin).getDomainInfo(normalizedHostname);
|
||||
if (phishermanResult != null && !phishermanDomainIsSafe(phishermanResult)) {
|
||||
if (
|
||||
(trigger.phisherman.include_suspected && !phishermanResult.verifiedPhish) ||
|
||||
(trigger.phisherman.include_verified && phishermanResult.verifiedPhish)
|
||||
) {
|
||||
const suspectedVerified = phishermanResult.verifiedPhish ? "verified" : "suspected";
|
||||
return {
|
||||
extra: {
|
||||
type,
|
||||
link: link.input,
|
||||
details: `using Phisherman (${suspectedVerified})`,
|
||||
},
|
||||
};
|
||||
}
|
||||
const includeMalicious =
|
||||
trigger.include_malicious || trigger.phisherman?.include_suspected || trigger.phisherman?.include_verified;
|
||||
if (includeMalicious) {
|
||||
const domainInfo = getFishFishDomain(normalizedHostname);
|
||||
if (domainInfo && domainInfo.category !== "safe") {
|
||||
return {
|
||||
extra: {
|
||||
type,
|
||||
link: link.input,
|
||||
details: `(known ${domainInfo.category} domain)`,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue