diff --git a/backend/src/module/notification/plugin/telegram.py b/backend/src/module/notification/plugin/telegram.py index 6f22056b..ac35623d 100644 --- a/backend/src/module/notification/plugin/telegram.py +++ b/backend/src/module/notification/plugin/telegram.py @@ -10,7 +10,8 @@ logger = logging.getLogger(__name__) class TelegramNotification(RequestContent): def __init__(self, token, chat_id): super().__init__() - self.notification_url = f"https://api.telegram.org/bot{token}/sendPhoto" + self.photo_url = f"https://api.telegram.org/bot{token}/sendPhoto" + self.message_url = f"https://api.telegram.org/bot{token}/sendMessage" self.chat_id = chat_id @staticmethod @@ -30,9 +31,9 @@ class TelegramNotification(RequestContent): photo = load_image(notify.poster_path) if photo: resp = self.post_files( - self.notification_url, data, files={"photo": photo} + self.photo_url, data, files={"photo": photo} ) else: - resp = self.post_data(self.notification_url, data) + resp = self.post_data(self.message_url, data) logger.debug(f"Telegram notification: {resp.status_code}") return resp.status_code == 200