From 165f8817c4215291376c49303932a6e8af890f08 Mon Sep 17 00:00:00 2001 From: Sergey Melekhin Date: Sun, 8 Sep 2024 10:14:19 +0700 Subject: [PATCH] backdoor plus logs --- bot/skills/towel_mode.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bot/skills/towel_mode.py b/bot/skills/towel_mode.py index cf9ee36..06226d7 100644 --- a/bot/skills/towel_mode.py +++ b/bot/skills/towel_mode.py @@ -73,7 +73,15 @@ def delete_user(self, user_id: str): return self._coll.delete_one({"_id": user_id}) def delete_all_users(self): - return self._coll.delete_many({}) + return self._coll.delete_many({}) - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv==2022.9.24 + pipenv install --system --dev + - name: Lint + run: make lint + - name: Test with pytest + run: export PYTHONPATH=./bot && pytest db = DB("towel_mode") @@ -198,6 +206,11 @@ def catch_reply(update: Update, context: CallbackContext): def is_worthy(text: str) -> bool: """check if reply is a valid bio as requested""" + + ## backdoor for testing + if text.lower().find("i love vldc") != -1: + return True + if len(text) < 15: return False @@ -220,6 +233,8 @@ def is_worthy(text: str) -> bool: presence_penalty=0.6, ) + logger.info("text: %q is %s", text, response.choices[0].message.content) + return response.choices[0].message.content == "worthy"