From 70fc02b24243ed66d1223ed709aa9c2719ddfd21 Mon Sep 17 00:00:00 2001 From: koalasat Date: Thu, 18 Jul 2024 14:06:57 +0200 Subject: [PATCH] Fix telegram bot --- api/management/commands/telegram_watcher.py | 2 -- api/notifications.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/management/commands/telegram_watcher.py b/api/management/commands/telegram_watcher.py index bc5703634..d626b7569 100644 --- a/api/management/commands/telegram_watcher.py +++ b/api/management/commands/telegram_watcher.py @@ -52,7 +52,6 @@ def handle(self, *args, **options): self.notifications.send_telegram_message( result["message"]["from"]["id"], 'You must enable the notifications bot using the RoboSats client. Click on your "Robot robot" -> "Enable Telegram" and follow the link or scan the QR code.', - "", ) continue token = parts[-1] @@ -61,7 +60,6 @@ def handle(self, *args, **options): self.notifications.send_telegram_message( result["message"]["from"]["id"], f'Wops, invalid token! There is no Robot with telegram chat token "{token}"', - "", ) continue diff --git a/api/notifications.py b/api/notifications.py index 7adc9f609..57ec4a429 100644 --- a/api/notifications.py +++ b/api/notifications.py @@ -37,13 +37,13 @@ def send_message(self, order, robot, title, description=""): if robot.telegram_enabled: self.send_telegram_message(robot.telegram_chat_id, title, description) - def save_message(self, order, robot, title, description): + def save_message(self, order, robot, title, description=""): """Save a message for a user""" Notification.objects.create( title=title, description=description, robot=robot, order=order ) - def send_telegram_message(self, chat_id, title, description): + def send_telegram_message(self, chat_id, title, description=""): """sends a message to a user with telegram notifications enabled""" bot_token = config("TELEGRAM_TOKEN")