From b70679a7b74f1e48c9e3976597e0123d19508cb3 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Tue, 1 Mar 2022 05:56:37 -0800 Subject: [PATCH] Hot fix telegram watcher. No message in results --- api/management/commands/telegram_watcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/management/commands/telegram_watcher.py b/api/management/commands/telegram_watcher.py index e415dde2..3c5e4483 100644 --- a/api/management/commands/telegram_watcher.py +++ b/api/management/commands/telegram_watcher.py @@ -31,7 +31,12 @@ class Command(BaseCommand): if len(list(response['result'])) == 0: continue for result in response['result']: - text = result['message']['text'] + + try: # if there is no key message, skips this result. + text = result['message']['text'] + except: + continue + splitted_text = text.split(' ') if splitted_text[0] == '/start': token = splitted_text[-1]