From bc99e19c4ccb7748cf010bd2318bb8a8941ec2ba Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 28 Jul 2016 15:12:00 -0400 Subject: Fix bug where messages are answered in a wrong Telegram chat --- project/telegramapicommunicator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'project/telegramapicommunicator.py') diff --git a/project/telegramapicommunicator.py b/project/telegramapicommunicator.py index 7fdb29c..a4b6964 100644 --- a/project/telegramapicommunicator.py +++ b/project/telegramapicommunicator.py @@ -27,7 +27,10 @@ class TelegramCommunicator(BaseCommunicator): TelegramCommunicator.send_raw("{}: {}".format(data["user"], data["text"])) @staticmethod - def send_raw(message): + def send_raw(message, chat_id=None): + if chat_id is None: + chat_id = TelegramCommunicator.chat_id + try: TelegramCommunicator.bot.sendMessage(TelegramCommunicator.chat_id, message) -- cgit v1.3