diff --git a/handler.py b/handler.py index 93e6741..e602d1f 100644 --- a/handler.py +++ b/handler.py @@ -12,21 +12,21 @@ import smtplib, ssl from email.mime.text import MIMEText def send_alert(data): - if config.telegram: + if config.send_telegram_alerts: try: tg_bot = Bot(token=config.tg_token) tg_bot.sendMessage(config.channel, data, parse_mode = 'MARKDOWN') except Exception as e: print(e) - if config.discord: + if config.send_discord_alerts: try: discord_alert = DiscordWebhook(url=config.discord_webhook, content=data) response = discord_alert.execute() except Exception as e: print(e) - if config.twitter: + if config.send_twitter_alerts: tw_auth = tweepy.OAuthHandler(config.tw_ckey, config.tw_csecret) tw_auth.set_access_token(config.tw_atoken, config.tw_asecret) tw_api = tweepy.API(tw_auth) @@ -35,7 +35,7 @@ def send_alert(data): except Exception as e: print(e) - if config.email: + if config.send_email_alerts: try: email_msg = MIMEText(data) email_msg['Subject'] = config.email_subject