From dc6a8b7c0cb39c3c9b8d679ebc643c5ddc82b3af Mon Sep 17 00:00:00 2001 From: louisevelayo Date: Fri, 1 Dec 2023 14:10:26 +0100 Subject: [PATCH] fix mypy --- node_monitor/bot_slack.py | 4 ++-- node_monitor/bot_telegram.py | 4 ++-- node_monitor/node_monitor.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/node_monitor/bot_slack.py b/node_monitor/bot_slack.py index eaeff4a..22da06e 100644 --- a/node_monitor/bot_slack.py +++ b/node_monitor/bot_slack.py @@ -28,13 +28,13 @@ def send_message( def send_messages( - self, slack_channel_names: List[str], + self, slack_channel_names: List[str], subject: str, message: str) -> None | SlackApiError: """Send a message to multiple Slack channels.""" # Propagate the last error that occurs err = None for slack_channel_name in slack_channel_names: - this_err = self.send_message(slack_channel_name, message) + this_err = self.send_message(slack_channel_name, subject, message) if this_err is not None: err = this_err return err diff --git a/node_monitor/bot_telegram.py b/node_monitor/bot_telegram.py index 7268c3b..f9cb0af 100644 --- a/node_monitor/bot_telegram.py +++ b/node_monitor/bot_telegram.py @@ -30,13 +30,13 @@ def send_message( def send_messages( - self, chat_ids: List[str], message: str + self, chat_ids: List[str], subject: str, message: str ) -> None | requests.exceptions.HTTPError: """Send a message to multiple Telegram chats.""" # Propagate the last error that occurs err = None for chat_id in chat_ids: - this_err = self.send_message(chat_id, message) + this_err = self.send_message(chat_id, subject, message) if this_err is not None: err = this_err return err diff --git a/node_monitor/node_monitor.py b/node_monitor/node_monitor.py index 6ad2761..51e1d14 100644 --- a/node_monitor/node_monitor.py +++ b/node_monitor/node_monitor.py @@ -125,12 +125,12 @@ def broadcaster(node_provider_id: str, if self.slack_bot: channels = slack_channels.get(node_provider_id, []) if channels: - err1 = self.slack_bot.send_messages(channels, message) + err1 = self.slack_bot.send_messages(channels, subject, message) if preferences['notify_telegram'] == True: if self.telegram_bot: chats = telegram_chats.get(node_provider_id, []) if chats: - err2 = self.telegram_bot.send_messages(chats, message) + err2 = self.telegram_bot.send_messages(chats, subject, message) return None return broadcaster