mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
feat: Phisherman integration
This commit is contained in:
parent
f92ee9ba4f
commit
13c94a81cc
18 changed files with 681 additions and 17 deletions
20
backend/src/plugins/Phisherman/functions/getDomainInfo.ts
Normal file
20
backend/src/plugins/Phisherman/functions/getDomainInfo.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { PhishermanPluginType } from "../types";
|
||||
import { PhishermanDomainInfo } from "../../../data/types/phisherman";
|
||||
import { getPhishermanDomainInfo, phishermanDomainIsSafe, trackPhishermanCaughtDomain } from "../../../data/Phisherman";
|
||||
|
||||
export async function getDomainInfo(
|
||||
pluginData: GuildPluginData<PhishermanPluginType>,
|
||||
domain: string,
|
||||
): Promise<PhishermanDomainInfo | null> {
|
||||
if (!pluginData.state.validApiKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const info = await getPhishermanDomainInfo(domain).catch(() => null);
|
||||
if (info != null && !phishermanDomainIsSafe(info)) {
|
||||
trackPhishermanCaughtDomain(pluginData.state.validApiKey, domain);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue