From a8504971ea3720f1ce279611af69afbab212ec10 Mon Sep 17 00:00:00 2001 From: sid <25916907+git-sid@users.noreply.github.com> Date: Sat, 30 Jun 2018 21:32:22 +0200 Subject: [PATCH] completed telegram subscriber list functionality --- active_bots/telegrambot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index 64c5849..87733ae 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -13,8 +13,12 @@ class TelegramBot(Bot): updates = tb.get_updates().wait() reports = [] for update in updates: - reports.append(Report(update.message.from.username,self, - update.message.text,None,update.message.date)) + if update.message.text =="/stop": + remove_telegram_subscribers(self, update.message.from.id) + else: + add_telegram_subscribers(self, update.message.from.id) + reports.append(Report(update.message.from.username,self, + update.message.text,None,update.message.date)) return reports def post(self, user, report):