From 4759388adb79aa7887c820632b170d9c441dcedf Mon Sep 17 00:00:00 2001 From: Anon Date: Sun, 19 Mar 2023 19:21:02 -0700 Subject: [PATCH] Added callback param to post() --- fedibot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedibot.py b/fedibot.py index bf91e8a..f1ffdb3 100644 --- a/fedibot.py +++ b/fedibot.py @@ -195,17 +195,17 @@ class YandereBot: # popping it at index 0. This should handle any error that might occur while posting. # # This function should return 'None' if a post failed, and the picked item from self.listPictures if it succeeded. - def post(self): + def post(self, callback=None): # Post - picked = self.pick() - self._post(picked) + _picked = callback() if callable(callback) else self.pick() + self._post(_picked) # After a successful post self.currentSessionCount += 1 self.consecutive_failed_uploads = 0 # The post was successful - return picked + return _picked # [BEGIN THE PROGRAM] def prime_bot(self):