diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-07-27 22:02:33 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-07-27 22:02:33 +0700 |
commit | edd20f260c012938661a7e16d85d94d39d161781 (patch) | |
tree | 8f2853e99532a3bd9fb67446475458d78c7abbe6 | |
parent | 38c6f914ed61c2348014a2998d1815d959ed2871 (diff) |
upd case insensitive command
-rw-r--r-- | main.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -18,13 +18,14 @@ def getScore(): myScore = readCSV() try: myScore = 100 * float(myScore) - except ValueError: + except (TypeError, ValueError): myScore = 0 return myScore def processMessages(messages): - if 'update' in messages: + if 'update' in (msg.lower() for msg in messages): + logger.info("EXPLICIT SCORE UPDATE REQUESTED") score = getScore() bot.sendMessage(f"Score leantime bulan ini = {score}%") |