From 12b859a3a5dd23a078d64bd99e25e3172a4a64d7 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 21 Feb 2018 19:20:03 -0800 Subject: [PATCH 1/2] Added debug for safe users --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index d09d185..74a02d2 100644 --- a/bot.py +++ b/bot.py @@ -26,6 +26,8 @@ class TelegramMonitorBot: self.debug = os.environ.get('DEBUG') is not None self.safe_user_ids = map(int, os.environ['SAFE_USER_IDS'].split(',')) + print ("safe_user_ids") + print (self.safe_user_ids) self.message_ban_patterns = os.environ['MESSAGE_BAN_PATTERNS'] self.message_ban_re = (re.compile( @@ -144,7 +146,7 @@ class TelegramMonitorBot: update.message.text.encode('utf-8')) ) - if not update.message.from_user.id in self.safe_user_ids: + if not (update.message.from_user.id in self.safe_user_ids): # Security checks self.security_check_username(bot, update) self.security_check_message(bot, update) From 73d6cf94ada578b10b4683ea402b786643e52c76 Mon Sep 17 00:00:00 2001 From: Stan James Date: Wed, 21 Feb 2018 19:27:39 -0800 Subject: [PATCH 2/2] change safe id to list --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 74a02d2..1eb9f60 100644 --- a/bot.py +++ b/bot.py @@ -25,7 +25,7 @@ class TelegramMonitorBot: def __init__(self): self.debug = os.environ.get('DEBUG') is not None - self.safe_user_ids = map(int, os.environ['SAFE_USER_IDS'].split(',')) + self.safe_user_ids = list(map(int, os.environ['SAFE_USER_IDS'].split(','))) print ("safe_user_ids") print (self.safe_user_ids)