summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosyid Haryadi <rosyid_haryadi@protonmail.com>2024-07-27 22:02:33 +0700
committerRosyid Haryadi <rosyid_haryadi@protonmail.com>2024-07-27 22:02:33 +0700
commitedd20f260c012938661a7e16d85d94d39d161781 (patch)
tree8f2853e99532a3bd9fb67446475458d78c7abbe6
parent38c6f914ed61c2348014a2998d1815d959ed2871 (diff)
upd case insensitive command
-rw-r--r--main.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.py b/main.py
index 771059f..99d7fa7 100644
--- a/main.py
+++ b/main.py
@@ -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}%")