From b2460d8e3a5f9a7ce1d3c21511f5915fef8d78e0 Mon Sep 17 00:00:00 2001 From: Stan James Date: Thu, 28 Jun 2018 11:22:23 -0600 Subject: [PATCH] better handling of debug setting --- bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 8dfa176..5506b06 100644 --- a/bot.py +++ b/bot.py @@ -23,7 +23,9 @@ class TelegramMonitorBot: def __init__(self): - self.debug = os.environ.get('DEBUG') is not None + self.debug = ( + (os.environ.get('DEBUG') is not None) && + (os.environ.get('DEBUG').upper() != "false")) # Channel to notify of violoations, e.g. '@channelname' self.notify_chat = os.environ['NOTIFY_CHAT'] @@ -78,7 +80,7 @@ class TelegramMonitorBot: update.message.reply_text(log_message) print(log_message) # Notify channel - bot.sendMessage(chat_id=self.notify_chat, text=log_message) + bot.sendMessage(chat_id=self.notify_chat, text="🤖:" + log_message) # Ban the user self.ban_user(update) # Log in database