Fix phishing sync
This commit is contained in:
parent
004d8d1091
commit
d354211e0c
1 changed files with 12 additions and 4 deletions
|
@ -72,13 +72,21 @@ class Jarvis(Snake):
|
|||
|
||||
self.logger.debug(f"Found {len(data)} changes to phishing domains")
|
||||
|
||||
add = 0
|
||||
sub = 0
|
||||
|
||||
for update in data:
|
||||
if update["type"] == "add":
|
||||
if update["domain"] not in self.phishing_domains:
|
||||
self.phishing_domains.append(update["domain"])
|
||||
for domain in update["domains"]:
|
||||
if domain not in self.phishing_domains:
|
||||
add += 1
|
||||
self.phishing_domains.append(domain)
|
||||
elif update["type"] == "delete":
|
||||
if update["domain"] in self.phishing_domains:
|
||||
self.phishing_domains.remove(update["domain"])
|
||||
for domain in update["domains"]:
|
||||
if domain in self.phishing_domains:
|
||||
sub -= 1
|
||||
self.phishing_domains.remove(domain)
|
||||
self.logger.debug(f"{add} additions, {sub} removals")
|
||||
|
||||
async def _prerun(self, ctx: Context, *args, **kwargs) -> None:
|
||||
name = ctx.invoked_name
|
||||
|
|
Loading…
Add table
Reference in a new issue