Update export statistics
This commit is contained in:
parent
0d8d436549
commit
71db74cdbb
BIN
dist/ragnar-1.3.37-py3-none-any.whl
vendored
Normal file
BIN
dist/ragnar-1.3.37-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/ragnar-1.3.37.tar.gz
vendored
BIN
dist/ragnar-1.3.37.tar.gz
vendored
Binary file not shown.
@ -81,7 +81,10 @@ class Bot:
|
|||||||
rant = self.api.get_rant(rant_id)
|
rant = self.api.get_rant(rant_id)
|
||||||
for comment in rant.get("comments", []):
|
for comment in rant.get("comments", []):
|
||||||
print("Checking if sus comment: ", comment["body"])
|
print("Checking if sus comment: ", comment["body"])
|
||||||
if comment.get("user_username") == username and comment.get("user_score") <= 10:
|
if (
|
||||||
|
comment.get("user_username") == username
|
||||||
|
and comment.get("user_score") <= 10
|
||||||
|
):
|
||||||
vic.register_spammer(comment["user_username"])
|
vic.register_spammer(comment["user_username"])
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -105,9 +108,15 @@ class Bot:
|
|||||||
username = mention.strip("@")
|
username = mention.strip("@")
|
||||||
if self.is_comment_deletable(username):
|
if self.is_comment_deletable(username):
|
||||||
vic.register_spammer(mention.strip("@"))
|
vic.register_spammer(mention.strip("@"))
|
||||||
self.api.post_comment(rant_id, f"User {username} is sucessfully registered as spammer.")
|
self.api.post_comment(
|
||||||
|
rant_id,
|
||||||
|
f"User {username} is sucessfully registered as spammer.",
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.api.post_comment(rant_id, f"Can't register user {username} as spammer. User is trusted.")
|
self.api.post_comment(
|
||||||
|
rant_id,
|
||||||
|
f"Can't register user {username} as spammer. User is trusted.",
|
||||||
|
)
|
||||||
if len(mentions) > 1:
|
if len(mentions) > 1:
|
||||||
return False
|
return False
|
||||||
log.info(f"Trigger {trigger} matched!")
|
log.info(f"Trigger {trigger} matched!")
|
||||||
@ -147,8 +156,8 @@ class Bot:
|
|||||||
rant = self.api.get_rant(rant_id)
|
rant = self.api.get_rant(rant_id)
|
||||||
for comment in rant.get("comments", []):
|
for comment in rant.get("comments", []):
|
||||||
for spammer in self.sus_users:
|
for spammer in self.sus_users:
|
||||||
if comment['user_username'] == spammer:
|
if comment["user_username"] == spammer:
|
||||||
vic.downvote_comment(comment['id'])
|
vic.downvote_comment(comment["id"])
|
||||||
return False
|
return False
|
||||||
|
|
||||||
print("Checking if sus comment: ", comment["body"])
|
print("Checking if sus comment: ", comment["body"])
|
||||||
@ -193,11 +202,14 @@ class Bot:
|
|||||||
self.name, rant["user_username"]
|
self.name, rant["user_username"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if not vic.is_spam(rant['text']) >= 5:
|
if not vic.is_spam(rant["text"]) >= 5:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
log.info(
|
log.info(
|
||||||
"{}: Rant by {} is sus according to AI.".format(self.name, rant["user_username"]))
|
"{}: Rant by {} is sus according to AI.".format(
|
||||||
|
self.name, rant["user_username"]
|
||||||
|
)
|
||||||
|
)
|
||||||
log.warning(
|
log.warning(
|
||||||
"{}: Rant by {} is not flagged as sus yet but should be.".format(
|
"{}: Rant by {} is not flagged as sus yet but should be.".format(
|
||||||
self.name, rant["user_username"]
|
self.name, rant["user_username"]
|
||||||
|
Loading…
Reference in New Issue
Block a user