summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--taulubot.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/taulubot.py b/taulubot.py
index cac99c3..4910048 100644
--- a/taulubot.py
+++ b/taulubot.py
@@ -106,14 +106,15 @@ def handle(msg):
chat_id = msg["chat"]["id"]
user_id = msg["from"]["id"]
user_name = msg["from"]["first_name"]
- msg_text = msg["text"]
+ msg_text = msg.get("text", None)
+
logging.debug(
"New message! chat_id: {}, user_name: {}, msg_text: {}".format(
chat_id, user_name, msg_text
)
)
- if is_taulu_command(msg_text):
+ if msg_text is not None and is_taulu_command(msg_text):
logging.info("Taulu command found!")
attempt, ATTEMPTS = 0, 3
while attempt < ATTEMPTS: