def dispatch_telegram_msg(self, events):
"""
Dispatch a telegram push message
:param events: List of events that were found
:type events: dict[models.Event]
:return: None
"""
if not any(events):
return print("[-] No events detected, skipping telegram push notification.")
if not self.config.telegram_api_token:
return print("[-] No telegram api token configured, skipping push notification.")
if not self.config.telegram_api_chat_id:
return print("[-] No telegram chat id configured, skipping push notification.")
bot = Updater(token=self.config.telegram_api_token).bot
bot.sendMessage(chat_id=self.config.telegram_api_chat_id, text=self._get_email_body_from_events(events))
评论列表
文章目录