diff options
| author | Tianhao Wang <shrik3@riseup.net> | 2023-04-04 09:43:32 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@riseup.net> | 2023-04-04 09:43:32 +0200 |
| commit | 75989747fb71753ed4f4839002e933d5e8aa7da5 (patch) | |
| tree | 9995fd2740b35720c3ac77dcf452a7f5905ee1c6 | |
| parent | 917954ecf051198ca3916db4173503514642550a (diff) | |
fix syntax
| -rw-r--r-- | cat.py | 7 | ||||
| -rw-r--r-- | config.py | 6 |
2 files changed, 9 insertions, 4 deletions
@@ -52,7 +52,7 @@ class VnilCat: exit() self.intimacy = {} print("[booting] init intimacy") - self.update_intimacy(self) + self.update_intimacy() # try to fetch the lastest status from the timeline # so that we can skip the ones before we start. @@ -69,7 +69,7 @@ class VnilCat: print(f"[booting] Cat booted, all systems green, my name is {self.config.UNAME}, prepare to die, human") print("-------------") - def update_intimacy(): + def update_intimacy(self): res = self.db.count_interaction() if res != None: self.intimacy = res @@ -105,7 +105,7 @@ class VnilCat: def catch_birds(self, status, content): - if re_contains_bird.search(content) is not None and len(content) < 10: + if re_contains_bird.search(content) is not None and len(content) < self.config.CATCH_BIRD_MAX_LENGTH: print("i see a bird", status["id"], " from ", status["account"]["acct"]) try: s = self.session.status_reply( @@ -149,7 +149,6 @@ class VnilCat: # important! make sure to iterate from older status to newer # otherwise the 'last_seen' won't be updated correctly for status in reversed(tl): - # skip if it's from myself self.handle_home_status(status=status) # For now we don't handle other interaction types @@ -28,7 +28,13 @@ except: ADMINS = ["shrik3"] +# INTIMACY THREHOLDS +INTIMACY_FRIENDLY = 10 +INTIMACY_ACTIVE = 50 +INTIMACY_LOVE = 100 +# BEHAVIOURS .. +CATCH_BIRD_MAX_LENGTH = 30 ## DB CONFIGS ----------------------------- # TODO, currently the bot and the db handler is sharing |
