Bots update.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m25s
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m25s
This commit is contained in:
parent
f447a2d0bf
commit
2c72163d3c
@ -55,7 +55,7 @@ class Bot:
|
|||||||
self.api = Api(username=self.username, password=self.password)
|
self.api = Api(username=self.username, password=self.password)
|
||||||
|
|
||||||
def rsleepii(self):
|
def rsleepii(self):
|
||||||
time.sleep(random.randint(1, 3))
|
time.sleep(random.randint(1, 60))
|
||||||
|
|
||||||
@method_cache
|
@method_cache
|
||||||
def login(self):
|
def login(self):
|
||||||
@ -91,7 +91,6 @@ class Bot:
|
|||||||
def is_flagged_as_sus(self, rant_id, num_comments):
|
def is_flagged_as_sus(self, rant_id, num_comments):
|
||||||
if not num_comments:
|
if not num_comments:
|
||||||
return False
|
return False
|
||||||
self.rsleepii()
|
|
||||||
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", []):
|
||||||
if self.names.get(self.username, "") in comment.get("body", ""):
|
if self.names.get(self.username, "") in comment.get("body", ""):
|
||||||
@ -127,9 +126,9 @@ class Bot:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def mark_as_sus(self, rant):
|
def mark_as_sus(self, rant):
|
||||||
self.rsleepii()
|
|
||||||
self.api.post_comment(rant["id"], self.mark_text)
|
self.api.post_comment(rant["id"], self.mark_text)
|
||||||
|
self.rsleepii()
|
||||||
|
|
||||||
def fight(self):
|
def fight(self):
|
||||||
self.rsleepii()
|
self.rsleepii()
|
||||||
rants = self.api.get_rants("recent", self.amount_of_rants_to_check, 0)
|
rants = self.api.get_rants("recent", self.amount_of_rants_to_check, 0)
|
||||||
|
@ -31,7 +31,7 @@ def bot_task(username, password):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
usernames = vic.get_friends()
|
usernames = vic.get_friends()
|
||||||
|
|
||||||
with Executor(len(usernames)) as executor:
|
with Executor(len(usernames)) as executor:
|
||||||
for username in usernames:
|
for username in usernames:
|
||||||
|
Loading…
Reference in New Issue
Block a user